Skip to content

Commit a3e171a

Browse files
Christoph Hellwigkdave
authored andcommitted
btrfs: move struct btrfs_dio_private to inode.c
The btrfs_dio_private structure is only used in inode.c, so move the definition there. Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent acb8b52 commit a3e171a

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

fs/btrfs/btrfs_inode.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -395,30 +395,6 @@ static inline bool btrfs_inode_can_compress(const struct btrfs_inode *inode)
395395
return true;
396396
}
397397

398-
struct btrfs_dio_private {
399-
struct inode *inode;
400-
401-
/*
402-
* Since DIO can use anonymous page, we cannot use page_offset() to
403-
* grab the file offset, thus need a dedicated member for file offset.
404-
*/
405-
u64 file_offset;
406-
/* Used for bio::bi_size */
407-
u32 bytes;
408-
409-
/*
410-
* References to this structure. There is one reference per in-flight
411-
* bio plus one while we're still setting up.
412-
*/
413-
refcount_t refs;
414-
415-
/* dio_bio came from fs/direct-io.c */
416-
struct bio *dio_bio;
417-
418-
/* Array of checksums */
419-
u8 csums[];
420-
};
421-
422398
/*
423399
* btrfs_inode_item stores flags in a u64, btrfs_inode stores them in two
424400
* separate u32s. These two functions convert between the two representations.

fs/btrfs/ctree.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3218,7 +3218,6 @@ int btrfs_del_orphan_item(struct btrfs_trans_handle *trans,
32183218
int btrfs_find_orphan_item(struct btrfs_root *root, u64 offset);
32193219

32203220
/* file-item.c */
3221-
struct btrfs_dio_private;
32223221
int btrfs_del_csums(struct btrfs_trans_handle *trans,
32233222
struct btrfs_root *root, u64 bytenr, u64 len);
32243223
blk_status_t btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, u8 *dst);

fs/btrfs/inode.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,30 @@ struct btrfs_dio_data {
6868
bool nocow_done;
6969
};
7070

71+
struct btrfs_dio_private {
72+
struct inode *inode;
73+
74+
/*
75+
* Since DIO can use anonymous page, we cannot use page_offset() to
76+
* grab the file offset, thus need a dedicated member for file offset.
77+
*/
78+
u64 file_offset;
79+
/* Used for bio::bi_size */
80+
u32 bytes;
81+
82+
/*
83+
* References to this structure. There is one reference per in-flight
84+
* bio plus one while we're still setting up.
85+
*/
86+
refcount_t refs;
87+
88+
/* dio_bio came from fs/direct-io.c */
89+
struct bio *dio_bio;
90+
91+
/* Array of checksums */
92+
u8 csums[];
93+
};
94+
7195
struct btrfs_rename_ctx {
7296
/* Output field. Stores the index number of the old directory entry. */
7397
u64 index;

0 commit comments

Comments
 (0)