diff mbox series

[08/15] btrfs: move btrfs_dio_private to inode.c

Message ID 7cb31cf9673d1d232e770145924ef779d3681058.1583789410.git.osandov@fb.com (mailing list archive)
State New, archived
Headers show
Series btrfs: read repair/direct I/O improvements | expand

Commit Message

Omar Sandoval March 9, 2020, 9:32 p.m. UTC
From: Omar Sandoval <osandov@fb.com>

This hasn't been needed outside of inode.c since commit 23ea8e5a0767
("Btrfs: load checksum data once when submitting a direct read io").

Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 fs/btrfs/btrfs_inode.h | 30 ------------------------------
 fs/btrfs/inode.c       | 30 ++++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 30 deletions(-)

Comments

Johannes Thumshirn March 10, 2020, 2:56 p.m. UTC | #1
There's still a forward declaration in ctree.h:
johannes@redsun60:linux(btrfs-misc-next)$ git grep -n btrfs_dio_private
[...]
fs/btrfs/ctree.h:2808:struct btrfs_dio_private;
[...]
Omar Sandoval March 11, 2020, 8:48 a.m. UTC | #2
On Tue, Mar 10, 2020 at 02:56:55PM +0000, Johannes Thumshirn wrote:
> There's still a forward declaration in ctree.h:
> johannes@redsun60:linux(btrfs-misc-next)$ git grep -n btrfs_dio_private
> [...]
> fs/btrfs/ctree.h:2808:struct btrfs_dio_private;
> [...]

Good catch, I'll remove that.
Nikolay Borisov March 17, 2020, 2:53 p.m. UTC | #3
On 9.03.20 г. 23:32 ч., Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> This hasn't been needed outside of inode.c since commit 23ea8e5a0767
> ("Btrfs: load checksum data once when submitting a direct read io").
> 
> Signed-off-by: Omar Sandoval <osandov@fb.com>

While doing this can you perhaps remove the forward declaration in
ctree.h as well ?
David Sterba March 19, 2020, 4:16 p.m. UTC | #4
On Mon, Mar 09, 2020 at 02:32:34PM -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> This hasn't been needed outside of inode.c since commit 23ea8e5a0767
> ("Btrfs: load checksum data once when submitting a direct read io").

For ease of merging with Goldwyn's dio-iomap patches, can you please
avoid moving code? In this case it's btrfs_dio_private and some followup
patches that modify it.
diff mbox series

Patch

diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 27a1fefce508..ade5c6adec06 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -293,36 +293,6 @@  static inline int btrfs_inode_in_log(struct btrfs_inode *inode, u64 generation)
 	return ret;
 }
 
-#define BTRFS_DIO_ORIG_BIO_SUBMITTED	0x1
-
-struct btrfs_dio_private {
-	struct inode *inode;
-	unsigned long flags;
-	u64 logical_offset;
-	u64 disk_bytenr;
-	u64 bytes;
-	void *private;
-
-	/* number of bios pending for this dio */
-	atomic_t pending_bios;
-
-	/* IO errors */
-	int errors;
-
-	/* orig_bio is our btrfs_io_bio */
-	struct bio *orig_bio;
-
-	/* dio_bio came from fs/direct-io.c */
-	struct bio *dio_bio;
-
-	/*
-	 * The original bio may be split to several sub-bios, this is
-	 * done during endio of sub-bios
-	 */
-	blk_status_t (*subio_endio)(struct inode *, struct btrfs_io_bio *,
-			blk_status_t);
-};
-
 /*
  * Disable DIO read nolock optimization, so new dio readers will be forced
  * to grab i_mutex. It is used to avoid the endless truncate due to
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 50476ae96552..9d3a275ef253 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -54,6 +54,36 @@  struct btrfs_iget_args {
 	struct btrfs_root *root;
 };
 
+#define BTRFS_DIO_ORIG_BIO_SUBMITTED	0x1
+
+struct btrfs_dio_private {
+	struct inode *inode;
+	unsigned long flags;
+	u64 logical_offset;
+	u64 disk_bytenr;
+	u64 bytes;
+	void *private;
+
+	/* number of bios pending for this dio */
+	atomic_t pending_bios;
+
+	/* IO errors */
+	int errors;
+
+	/* orig_bio is our btrfs_io_bio */
+	struct bio *orig_bio;
+
+	/* dio_bio came from fs/direct-io.c */
+	struct bio *dio_bio;
+
+	/*
+	 * The original bio may be split to several sub-bios, this is
+	 * done during endio of sub-bios
+	 */
+	blk_status_t (*subio_endio)(struct inode *, struct btrfs_io_bio *,
+			blk_status_t);
+};
+
 struct btrfs_dio_data {
 	u64 reserve;
 	u64 unsubmitted_oe_range_start;