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.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 57c3bb2884ce..93b1aa932014 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 {
@@ -152,20 +153,34 @@ struct btrfs_inode {
152 unsigned ordered_data_close:1; 153 unsigned ordered_data_close:1;
153 unsigned orphan_meta_reserved:1; 154 unsigned orphan_meta_reserved:1;
154 unsigned dummy_inode:1; 155 unsigned dummy_inode:1;
156 unsigned in_defrag:1;
155 157
156 /* 158 /*
157 * always compress this one file 159 * always compress this one file
158 */ 160 */
159 unsigned force_compress:4; 161 unsigned force_compress:4;
160 162
163 struct btrfs_delayed_node *delayed_node;
164
161 struct inode vfs_inode; 165 struct inode vfs_inode;
162}; 166};
163 167
168extern unsigned char btrfs_filetype_table[];
169
164static inline struct btrfs_inode *BTRFS_I(struct inode *inode) 170static inline struct btrfs_inode *BTRFS_I(struct inode *inode)
165{ 171{
166 return container_of(inode, struct btrfs_inode, vfs_inode); 172 return container_of(inode, struct btrfs_inode, vfs_inode);
167} 173}
168 174
175static inline u64 btrfs_ino(struct inode *inode)
176{
177 u64 ino = BTRFS_I(inode)->location.objectid;
178
179 if (ino <= BTRFS_FIRST_FREE_OBJECTID)
180 ino = inode->i_ino;
181 return ino;
182}
183
169static inline void btrfs_i_size_write(struct inode *inode, u64 size) 184static inline void btrfs_i_size_write(struct inode *inode, u64 size)
170{ 185{
171 i_size_write(inode, size); 186 i_size_write(inode, size);