diff options
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 7c7bf818f3c1..ed8ca7ca5eff 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
@@ -144,6 +144,9 @@ struct btrfs_inode { | |||
144 | /* flags field from the on disk inode */ | 144 | /* flags field from the on disk inode */ |
145 | u32 flags; | 145 | u32 flags; |
146 | 146 | ||
147 | /* a local copy of root's last_log_commit */ | ||
148 | unsigned long last_log_commit; | ||
149 | |||
147 | /* | 150 | /* |
148 | * Counters to keep track of the number of extent item's we may use due | 151 | * Counters to keep track of the number of extent item's we may use due |
149 | * to delalloc and such. outstanding_extents is the number of extent | 152 | * to delalloc and such. outstanding_extents is the number of extent |
@@ -203,15 +206,10 @@ static inline bool btrfs_is_free_space_inode(struct inode *inode) | |||
203 | 206 | ||
204 | static inline int btrfs_inode_in_log(struct inode *inode, u64 generation) | 207 | static inline int btrfs_inode_in_log(struct inode *inode, u64 generation) |
205 | { | 208 | { |
206 | struct btrfs_root *root = BTRFS_I(inode)->root; | ||
207 | int ret = 0; | ||
208 | |||
209 | mutex_lock(&root->log_mutex); | ||
210 | if (BTRFS_I(inode)->logged_trans == generation && | 209 | if (BTRFS_I(inode)->logged_trans == generation && |
211 | BTRFS_I(inode)->last_sub_trans <= root->last_log_commit) | 210 | BTRFS_I(inode)->last_sub_trans <= BTRFS_I(inode)->last_log_commit) |
212 | ret = 1; | 211 | return 1; |
213 | mutex_unlock(&root->log_mutex); | 212 | return 0; |
214 | return ret; | ||
215 | } | 213 | } |
216 | 214 | ||
217 | #endif | 215 | #endif |