aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/btrfs_inode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r--fs/btrfs/btrfs_inode.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 6ad63f17eca0..52d7eca8c7bf 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -22,6 +22,7 @@
22#include "extent_map.h" 22#include "extent_map.h"
23#include "extent_io.h" 23#include "extent_io.h"
24#include "ordered-data.h" 24#include "ordered-data.h"
25#include "delayed-inode.h"
25 26
26/* in memory btrfs inode */ 27/* in memory btrfs inode */
27struct btrfs_inode { 28struct btrfs_inode {
@@ -120,9 +121,6 @@ struct btrfs_inode {
120 */ 121 */
121 u64 index_cnt; 122 u64 index_cnt;
122 123
123 /* the start of block group preferred for allocations. */
124 u64 block_group;
125
126 /* the fsync log has some corner cases that mean we have to check 124 /* the fsync log has some corner cases that mean we have to check
127 * directories to see if any unlinks have been done before 125 * directories to see if any unlinks have been done before
128 * the directory was logged. See tree-log.c for all the 126 * the directory was logged. See tree-log.c for all the
@@ -136,9 +134,8 @@ struct btrfs_inode {
136 * items we think we'll end up using, and reserved_extents is the number 134 * items we think we'll end up using, and reserved_extents is the number
137 * of extent items we've reserved metadata for. 135 * of extent items we've reserved metadata for.
138 */ 136 */
139 spinlock_t accounting_lock;
140 atomic_t outstanding_extents; 137 atomic_t outstanding_extents;
141 int reserved_extents; 138 atomic_t reserved_extents;
142 139
143 /* 140 /*
144 * ordered_data_close is set by truncate when a file that used 141 * ordered_data_close is set by truncate when a file that used
@@ -153,20 +150,34 @@ struct btrfs_inode {
153 unsigned ordered_data_close:1; 150 unsigned ordered_data_close:1;
154 unsigned orphan_meta_reserved:1; 151 unsigned orphan_meta_reserved:1;
155 unsigned dummy_inode:1; 152 unsigned dummy_inode:1;
153 unsigned in_defrag:1;
156 154
157 /* 155 /*
158 * always compress this one file 156 * always compress this one file
159 */ 157 */
160 unsigned force_compress:1; 158 unsigned force_compress:4;
159
160 struct btrfs_delayed_node *delayed_node;
161 161
162 struct inode vfs_inode; 162 struct inode vfs_inode;
163}; 163};
164 164
165extern unsigned char btrfs_filetype_table[];
166
165static inline struct btrfs_inode *BTRFS_I(struct inode *inode) 167static inline struct btrfs_inode *BTRFS_I(struct inode *inode)
166{ 168{
167 return container_of(inode, struct btrfs_inode, vfs_inode); 169 return container_of(inode, struct btrfs_inode, vfs_inode);
168} 170}
169 171
172static inline u64 btrfs_ino(struct inode *inode)
173{
174 u64 ino = BTRFS_I(inode)->location.objectid;
175
176 if (ino <= BTRFS_FIRST_FREE_OBJECTID)
177 ino = inode->i_ino;
178 return ino;
179}
180
170static inline void btrfs_i_size_write(struct inode *inode, u64 size) 181static inline void btrfs_i_size_write(struct inode *inode, u64 size)
171{ 182{
172 i_size_write(inode, size); 183 i_size_write(inode, size);