diff options
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
| -rw-r--r-- | fs/btrfs/btrfs_inode.h | 35 | 
1 files changed, 29 insertions, 6 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 9dc21622806e..ec2ae4406c16 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -142,11 +142,22 @@ struct btrfs_inode {  	/* a local copy of root's last_log_commit */  	int last_log_commit; -	/* -	 * Total number of bytes pending delalloc, used by stat to calculate the -	 * real block usage of the file. This is used only for files. -	 */ -	u64 delalloc_bytes; +	union { +		/* +		 * Total number of bytes pending delalloc, used by stat to +		 * calculate the real block usage of the file. This is used +		 * only for files. +		 */ +		u64 delalloc_bytes; +		/* +		 * The lowest possible index of the next dir index key which +		 * points to an inode that needs to be logged. +		 * This is used only for directories. +		 * Use the helpers btrfs_get_first_dir_index_to_log() and +		 * btrfs_set_first_dir_index_to_log() to access this field. +		 */ +		u64 first_dir_index_to_log; +	};  	union {  		/* @@ -247,6 +258,17 @@ struct btrfs_inode {  	struct inode vfs_inode;  }; +static inline u64 btrfs_get_first_dir_index_to_log(const struct btrfs_inode *inode) +{ +	return READ_ONCE(inode->first_dir_index_to_log); +} + +static inline void btrfs_set_first_dir_index_to_log(struct btrfs_inode *inode, +						    u64 index) +{ +	WRITE_ONCE(inode->first_dir_index_to_log, index); +} +  static inline struct btrfs_inode *BTRFS_I(const struct inode *inode)  {  	return container_of(inode, struct btrfs_inode, vfs_inode); @@ -407,7 +429,8 @@ static inline void btrfs_inode_split_flags(u64 inode_item_flags,  int btrfs_check_sector_csum(struct btrfs_fs_info *fs_info, struct page *page,  			    u32 pgoff, u8 *csum, const u8 * const csum_expected); -blk_status_t btrfs_extract_ordered_extent(struct btrfs_bio *bbio); +int btrfs_extract_ordered_extent(struct btrfs_bio *bbio, +				 struct btrfs_ordered_extent *ordered);  bool btrfs_data_csum_ok(struct btrfs_bio *bbio, struct btrfs_device *dev,  			u32 bio_offset, struct bio_vec *bv);  noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len,  |