diff options
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
| -rw-r--r-- | fs/btrfs/btrfs_inode.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 5b2ad6bc4fe7..ed8ca7ca5eff 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #define BTRFS_INODE_DELALLOC_META_RESERVED 4 | 38 | #define BTRFS_INODE_DELALLOC_META_RESERVED 4 |
| 39 | #define BTRFS_INODE_HAS_ORPHAN_ITEM 5 | 39 | #define BTRFS_INODE_HAS_ORPHAN_ITEM 5 |
| 40 | #define BTRFS_INODE_HAS_ASYNC_EXTENT 6 | 40 | #define BTRFS_INODE_HAS_ASYNC_EXTENT 6 |
| 41 | #define BTRFS_INODE_NEEDS_FULL_SYNC 7 | ||
| 41 | 42 | ||
| 42 | /* in memory btrfs inode */ | 43 | /* in memory btrfs inode */ |
| 43 | struct btrfs_inode { | 44 | struct btrfs_inode { |
| @@ -143,6 +144,9 @@ struct btrfs_inode { | |||
| 143 | /* flags field from the on disk inode */ | 144 | /* flags field from the on disk inode */ |
| 144 | u32 flags; | 145 | u32 flags; |
| 145 | 146 | ||
| 147 | /* a local copy of root's last_log_commit */ | ||
| 148 | unsigned long last_log_commit; | ||
| 149 | |||
| 146 | /* | 150 | /* |
| 147 | * 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 |
| 148 | * to delalloc and such. outstanding_extents is the number of extent | 152 | * to delalloc and such. outstanding_extents is the number of extent |
| @@ -202,15 +206,10 @@ static inline bool btrfs_is_free_space_inode(struct inode *inode) | |||
| 202 | 206 | ||
| 203 | 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) |
| 204 | { | 208 | { |
| 205 | struct btrfs_root *root = BTRFS_I(inode)->root; | ||
| 206 | int ret = 0; | ||
| 207 | |||
| 208 | mutex_lock(&root->log_mutex); | ||
| 209 | if (BTRFS_I(inode)->logged_trans == generation && | 209 | if (BTRFS_I(inode)->logged_trans == generation && |
| 210 | BTRFS_I(inode)->last_sub_trans <= root->last_log_commit) | 210 | BTRFS_I(inode)->last_sub_trans <= BTRFS_I(inode)->last_log_commit) |
| 211 | ret = 1; | 211 | return 1; |
| 212 | mutex_unlock(&root->log_mutex); | 212 | return 0; |
| 213 | return ret; | ||
| 214 | } | 213 | } |
| 215 | 214 | ||
| 216 | #endif | 215 | #endif |
