diff options
Diffstat (limited to 'fs/xfs')
33 files changed, 437 insertions, 426 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 21af043bbee8..dd0f48ff8832 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_btree.h" |
30 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_attr_sf.h" | 32 | #include "xfs_attr_sf.h" |
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c index e90a8760bc3d..60b60c008fb7 100644 --- a/fs/xfs/xfs_attr_inactive.c +++ b/fs/xfs/xfs_attr_inactive.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_btree.h" |
30 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_alloc_btree.h" | 32 | #include "xfs_alloc_btree.h" |
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 86db20a9cc02..94838fe67386 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_btree.h" |
30 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_alloc_btree.h" | 32 | #include "xfs_alloc_btree.h" |
diff --git a/fs/xfs/xfs_attr_leaf.h b/fs/xfs/xfs_attr_leaf.h index da34e64b5323..3ec5ec0b8678 100644 --- a/fs/xfs/xfs_attr_leaf.h +++ b/fs/xfs/xfs_attr_leaf.h | |||
@@ -19,16 +19,6 @@ | |||
19 | #ifndef __XFS_ATTR_LEAF_H__ | 19 | #ifndef __XFS_ATTR_LEAF_H__ |
20 | #define __XFS_ATTR_LEAF_H__ | 20 | #define __XFS_ATTR_LEAF_H__ |
21 | 21 | ||
22 | /* | ||
23 | * Attribute storage layout, internal structure, access macros, etc. | ||
24 | * | ||
25 | * Attribute lists are structured around Btrees where all the data | ||
26 | * elements are in the leaf nodes. Attribute names are hashed into an int, | ||
27 | * then that int is used as the index into the Btree. Since the hashval | ||
28 | * of an attribute name may not be unique, we may have duplicate keys. The | ||
29 | * internal links in the Btree are logical block offsets into the file. | ||
30 | */ | ||
31 | |||
32 | struct attrlist; | 22 | struct attrlist; |
33 | struct attrlist_cursor_kern; | 23 | struct attrlist_cursor_kern; |
34 | struct xfs_attr_list_context; | 24 | struct xfs_attr_list_context; |
@@ -38,226 +28,6 @@ struct xfs_da_state_blk; | |||
38 | struct xfs_inode; | 28 | struct xfs_inode; |
39 | struct xfs_trans; | 29 | struct xfs_trans; |
40 | 30 | ||
41 | /*======================================================================== | ||
42 | * Attribute structure when equal to XFS_LBSIZE(mp) bytes. | ||
43 | *========================================================================*/ | ||
44 | |||
45 | /* | ||
46 | * This is the structure of the leaf nodes in the Btree. | ||
47 | * | ||
48 | * Struct leaf_entry's are packed from the top. Name/values grow from the | ||
49 | * bottom but are not packed. The freemap contains run-length-encoded entries | ||
50 | * for the free bytes after the leaf_entry's, but only the N largest such, | ||
51 | * smaller runs are dropped. When the freemap doesn't show enough space | ||
52 | * for an allocation, we compact the name/value area and try again. If we | ||
53 | * still don't have enough space, then we have to split the block. The | ||
54 | * name/value structs (both local and remote versions) must be 32bit aligned. | ||
55 | * | ||
56 | * Since we have duplicate hash keys, for each key that matches, compare | ||
57 | * the actual name string. The root and intermediate node search always | ||
58 | * takes the first-in-the-block key match found, so we should only have | ||
59 | * to work "forw"ard. If none matches, continue with the "forw"ard leaf | ||
60 | * nodes until the hash key changes or the attribute name is found. | ||
61 | * | ||
62 | * We store the fact that an attribute is a ROOT/USER/SECURE attribute in | ||
63 | * the leaf_entry. The namespaces are independent only because we also look | ||
64 | * at the namespace bit when we are looking for a matching attribute name. | ||
65 | * | ||
66 | * We also store an "incomplete" bit in the leaf_entry. It shows that an | ||
67 | * attribute is in the middle of being created and should not be shown to | ||
68 | * the user if we crash during the time that the bit is set. We clear the | ||
69 | * bit when we have finished setting up the attribute. We do this because | ||
70 | * we cannot create some large attributes inside a single transaction, and we | ||
71 | * need some indication that we weren't finished if we crash in the middle. | ||
72 | */ | ||
73 | #define XFS_ATTR_LEAF_MAPSIZE 3 /* how many freespace slots */ | ||
74 | |||
75 | typedef struct xfs_attr_leaf_map { /* RLE map of free bytes */ | ||
76 | __be16 base; /* base of free region */ | ||
77 | __be16 size; /* length of free region */ | ||
78 | } xfs_attr_leaf_map_t; | ||
79 | |||
80 | typedef struct xfs_attr_leaf_hdr { /* constant-structure header block */ | ||
81 | xfs_da_blkinfo_t info; /* block type, links, etc. */ | ||
82 | __be16 count; /* count of active leaf_entry's */ | ||
83 | __be16 usedbytes; /* num bytes of names/values stored */ | ||
84 | __be16 firstused; /* first used byte in name area */ | ||
85 | __u8 holes; /* != 0 if blk needs compaction */ | ||
86 | __u8 pad1; | ||
87 | xfs_attr_leaf_map_t freemap[XFS_ATTR_LEAF_MAPSIZE]; | ||
88 | /* N largest free regions */ | ||
89 | } xfs_attr_leaf_hdr_t; | ||
90 | |||
91 | typedef struct xfs_attr_leaf_entry { /* sorted on key, not name */ | ||
92 | __be32 hashval; /* hash value of name */ | ||
93 | __be16 nameidx; /* index into buffer of name/value */ | ||
94 | __u8 flags; /* LOCAL/ROOT/SECURE/INCOMPLETE flag */ | ||
95 | __u8 pad2; /* unused pad byte */ | ||
96 | } xfs_attr_leaf_entry_t; | ||
97 | |||
98 | typedef struct xfs_attr_leaf_name_local { | ||
99 | __be16 valuelen; /* number of bytes in value */ | ||
100 | __u8 namelen; /* length of name bytes */ | ||
101 | __u8 nameval[1]; /* name/value bytes */ | ||
102 | } xfs_attr_leaf_name_local_t; | ||
103 | |||
104 | typedef struct xfs_attr_leaf_name_remote { | ||
105 | __be32 valueblk; /* block number of value bytes */ | ||
106 | __be32 valuelen; /* number of bytes in value */ | ||
107 | __u8 namelen; /* length of name bytes */ | ||
108 | __u8 name[1]; /* name bytes */ | ||
109 | } xfs_attr_leaf_name_remote_t; | ||
110 | |||
111 | typedef struct xfs_attr_leafblock { | ||
112 | xfs_attr_leaf_hdr_t hdr; /* constant-structure header block */ | ||
113 | xfs_attr_leaf_entry_t entries[1]; /* sorted on key, not name */ | ||
114 | xfs_attr_leaf_name_local_t namelist; /* grows from bottom of buf */ | ||
115 | xfs_attr_leaf_name_remote_t valuelist; /* grows from bottom of buf */ | ||
116 | } xfs_attr_leafblock_t; | ||
117 | |||
118 | /* | ||
119 | * CRC enabled leaf structures. Called "version 3" structures to match the | ||
120 | * version number of the directory and dablk structures for this feature, and | ||
121 | * attr2 is already taken by the variable inode attribute fork size feature. | ||
122 | */ | ||
123 | struct xfs_attr3_leaf_hdr { | ||
124 | struct xfs_da3_blkinfo info; | ||
125 | __be16 count; | ||
126 | __be16 usedbytes; | ||
127 | __be16 firstused; | ||
128 | __u8 holes; | ||
129 | __u8 pad1; | ||
130 | struct xfs_attr_leaf_map freemap[XFS_ATTR_LEAF_MAPSIZE]; | ||
131 | __be32 pad2; /* 64 bit alignment */ | ||
132 | }; | ||
133 | |||
134 | #define XFS_ATTR3_LEAF_CRC_OFF (offsetof(struct xfs_attr3_leaf_hdr, info.crc)) | ||
135 | |||
136 | struct xfs_attr3_leafblock { | ||
137 | struct xfs_attr3_leaf_hdr hdr; | ||
138 | struct xfs_attr_leaf_entry entries[1]; | ||
139 | |||
140 | /* | ||
141 | * The rest of the block contains the following structures after the | ||
142 | * leaf entries, growing from the bottom up. The variables are never | ||
143 | * referenced, the locations accessed purely from helper functions. | ||
144 | * | ||
145 | * struct xfs_attr_leaf_name_local | ||
146 | * struct xfs_attr_leaf_name_remote | ||
147 | */ | ||
148 | }; | ||
149 | |||
150 | /* | ||
151 | * incore, neutral version of the attribute leaf header | ||
152 | */ | ||
153 | struct xfs_attr3_icleaf_hdr { | ||
154 | __uint32_t forw; | ||
155 | __uint32_t back; | ||
156 | __uint16_t magic; | ||
157 | __uint16_t count; | ||
158 | __uint16_t usedbytes; | ||
159 | __uint16_t firstused; | ||
160 | __u8 holes; | ||
161 | struct { | ||
162 | __uint16_t base; | ||
163 | __uint16_t size; | ||
164 | } freemap[XFS_ATTR_LEAF_MAPSIZE]; | ||
165 | }; | ||
166 | |||
167 | /* | ||
168 | * Flags used in the leaf_entry[i].flags field. | ||
169 | * NOTE: the INCOMPLETE bit must not collide with the flags bits specified | ||
170 | * on the system call, they are "or"ed together for various operations. | ||
171 | */ | ||
172 | #define XFS_ATTR_LOCAL_BIT 0 /* attr is stored locally */ | ||
173 | #define XFS_ATTR_ROOT_BIT 1 /* limit access to trusted attrs */ | ||
174 | #define XFS_ATTR_SECURE_BIT 2 /* limit access to secure attrs */ | ||
175 | #define XFS_ATTR_INCOMPLETE_BIT 7 /* attr in middle of create/delete */ | ||
176 | #define XFS_ATTR_LOCAL (1 << XFS_ATTR_LOCAL_BIT) | ||
177 | #define XFS_ATTR_ROOT (1 << XFS_ATTR_ROOT_BIT) | ||
178 | #define XFS_ATTR_SECURE (1 << XFS_ATTR_SECURE_BIT) | ||
179 | #define XFS_ATTR_INCOMPLETE (1 << XFS_ATTR_INCOMPLETE_BIT) | ||
180 | |||
181 | /* | ||
182 | * Conversion macros for converting namespace bits from argument flags | ||
183 | * to ondisk flags. | ||
184 | */ | ||
185 | #define XFS_ATTR_NSP_ARGS_MASK (ATTR_ROOT | ATTR_SECURE) | ||
186 | #define XFS_ATTR_NSP_ONDISK_MASK (XFS_ATTR_ROOT | XFS_ATTR_SECURE) | ||
187 | #define XFS_ATTR_NSP_ONDISK(flags) ((flags) & XFS_ATTR_NSP_ONDISK_MASK) | ||
188 | #define XFS_ATTR_NSP_ARGS(flags) ((flags) & XFS_ATTR_NSP_ARGS_MASK) | ||
189 | #define XFS_ATTR_NSP_ARGS_TO_ONDISK(x) (((x) & ATTR_ROOT ? XFS_ATTR_ROOT : 0) |\ | ||
190 | ((x) & ATTR_SECURE ? XFS_ATTR_SECURE : 0)) | ||
191 | #define XFS_ATTR_NSP_ONDISK_TO_ARGS(x) (((x) & XFS_ATTR_ROOT ? ATTR_ROOT : 0) |\ | ||
192 | ((x) & XFS_ATTR_SECURE ? ATTR_SECURE : 0)) | ||
193 | |||
194 | /* | ||
195 | * Alignment for namelist and valuelist entries (since they are mixed | ||
196 | * there can be only one alignment value) | ||
197 | */ | ||
198 | #define XFS_ATTR_LEAF_NAME_ALIGN ((uint)sizeof(xfs_dablk_t)) | ||
199 | |||
200 | static inline int | ||
201 | xfs_attr3_leaf_hdr_size(struct xfs_attr_leafblock *leafp) | ||
202 | { | ||
203 | if (leafp->hdr.info.magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) | ||
204 | return sizeof(struct xfs_attr3_leaf_hdr); | ||
205 | return sizeof(struct xfs_attr_leaf_hdr); | ||
206 | } | ||
207 | |||
208 | static inline struct xfs_attr_leaf_entry * | ||
209 | xfs_attr3_leaf_entryp(xfs_attr_leafblock_t *leafp) | ||
210 | { | ||
211 | if (leafp->hdr.info.magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) | ||
212 | return &((struct xfs_attr3_leafblock *)leafp)->entries[0]; | ||
213 | return &leafp->entries[0]; | ||
214 | } | ||
215 | |||
216 | /* | ||
217 | * Cast typed pointers for "local" and "remote" name/value structs. | ||
218 | */ | ||
219 | static inline char * | ||
220 | xfs_attr3_leaf_name(xfs_attr_leafblock_t *leafp, int idx) | ||
221 | { | ||
222 | struct xfs_attr_leaf_entry *entries = xfs_attr3_leaf_entryp(leafp); | ||
223 | |||
224 | return &((char *)leafp)[be16_to_cpu(entries[idx].nameidx)]; | ||
225 | } | ||
226 | |||
227 | static inline xfs_attr_leaf_name_remote_t * | ||
228 | xfs_attr3_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) | ||
229 | { | ||
230 | return (xfs_attr_leaf_name_remote_t *)xfs_attr3_leaf_name(leafp, idx); | ||
231 | } | ||
232 | |||
233 | static inline xfs_attr_leaf_name_local_t * | ||
234 | xfs_attr3_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) | ||
235 | { | ||
236 | return (xfs_attr_leaf_name_local_t *)xfs_attr3_leaf_name(leafp, idx); | ||
237 | } | ||
238 | |||
239 | /* | ||
240 | * Calculate total bytes used (including trailing pad for alignment) for | ||
241 | * a "local" name/value structure, a "remote" name/value structure, and | ||
242 | * a pointer which might be either. | ||
243 | */ | ||
244 | static inline int xfs_attr_leaf_entsize_remote(int nlen) | ||
245 | { | ||
246 | return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \ | ||
247 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | ||
248 | } | ||
249 | |||
250 | static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen) | ||
251 | { | ||
252 | return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) + | ||
253 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | ||
254 | } | ||
255 | |||
256 | static inline int xfs_attr_leaf_entsize_local_max(int bsize) | ||
257 | { | ||
258 | return (((bsize) >> 1) + ((bsize) >> 2)); | ||
259 | } | ||
260 | |||
261 | /* | 31 | /* |
262 | * Used to keep a list of "remote value" extents when unlinking an inode. | 32 | * Used to keep a list of "remote value" extents when unlinking an inode. |
263 | */ | 33 | */ |
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c index cbc80d485177..8ba8e4b5e310 100644 --- a/fs/xfs/xfs_attr_list.c +++ b/fs/xfs/xfs_attr_list.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
26 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
27 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
28 | #include "xfs_da_format.h" | ||
28 | #include "xfs_da_btree.h" | 29 | #include "xfs_da_btree.h" |
29 | #include "xfs_bmap_btree.h" | 30 | #include "xfs_bmap_btree.h" |
30 | #include "xfs_alloc_btree.h" | 31 | #include "xfs_alloc_btree.h" |
diff --git a/fs/xfs/xfs_attr_remote.c b/fs/xfs/xfs_attr_remote.c index 712a502de619..578f21b70875 100644 --- a/fs/xfs/xfs_attr_remote.c +++ b/fs/xfs/xfs_attr_remote.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_error.h" | 30 | #include "xfs_error.h" |
30 | #include "xfs_da_btree.h" | 31 | #include "xfs_da_btree.h" |
31 | #include "xfs_bmap_btree.h" | 32 | #include "xfs_bmap_btree.h" |
diff --git a/fs/xfs/xfs_attr_remote.h b/fs/xfs/xfs_attr_remote.h index b3e1e1bdfb3b..5a9acfa156d7 100644 --- a/fs/xfs/xfs_attr_remote.h +++ b/fs/xfs/xfs_attr_remote.h | |||
@@ -18,33 +18,6 @@ | |||
18 | #ifndef __XFS_ATTR_REMOTE_H__ | 18 | #ifndef __XFS_ATTR_REMOTE_H__ |
19 | #define __XFS_ATTR_REMOTE_H__ | 19 | #define __XFS_ATTR_REMOTE_H__ |
20 | 20 | ||
21 | #define XFS_ATTR3_RMT_MAGIC 0x5841524d /* XARM */ | ||
22 | |||
23 | /* | ||
24 | * There is one of these headers per filesystem block in a remote attribute. | ||
25 | * This is done to ensure there is a 1:1 mapping between the attribute value | ||
26 | * length and the number of blocks needed to store the attribute. This makes the | ||
27 | * verification of a buffer a little more complex, but greatly simplifies the | ||
28 | * allocation, reading and writing of these attributes as we don't have to guess | ||
29 | * the number of blocks needed to store the attribute data. | ||
30 | */ | ||
31 | struct xfs_attr3_rmt_hdr { | ||
32 | __be32 rm_magic; | ||
33 | __be32 rm_offset; | ||
34 | __be32 rm_bytes; | ||
35 | __be32 rm_crc; | ||
36 | uuid_t rm_uuid; | ||
37 | __be64 rm_owner; | ||
38 | __be64 rm_blkno; | ||
39 | __be64 rm_lsn; | ||
40 | }; | ||
41 | |||
42 | #define XFS_ATTR3_RMT_CRC_OFF offsetof(struct xfs_attr3_rmt_hdr, rm_crc) | ||
43 | |||
44 | #define XFS_ATTR3_RMT_BUF_SPACE(mp, bufsize) \ | ||
45 | ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \ | ||
46 | sizeof(struct xfs_attr3_rmt_hdr) : 0)) | ||
47 | |||
48 | int xfs_attr3_rmt_blocks(struct xfs_mount *mp, int attrlen); | 21 | int xfs_attr3_rmt_blocks(struct xfs_mount *mp, int attrlen); |
49 | 22 | ||
50 | int xfs_attr_rmtval_get(struct xfs_da_args *args); | 23 | int xfs_attr_rmtval_get(struct xfs_da_args *args); |
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 6870aad5d815..b5cb377bd2bb 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -26,8 +26,8 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_btree.h" |
30 | #include "xfs_dir2_format.h" | ||
31 | #include "xfs_dir2.h" | 31 | #include "xfs_dir2.h" |
32 | #include "xfs_bmap_btree.h" | 32 | #include "xfs_bmap_btree.h" |
33 | #include "xfs_alloc_btree.h" | 33 | #include "xfs_alloc_btree.h" |
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 4f246628a900..74ff478b9b75 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "xfs_sb.h" | 27 | #include "xfs_sb.h" |
28 | #include "xfs_ag.h" | 28 | #include "xfs_ag.h" |
29 | #include "xfs_mount.h" | 29 | #include "xfs_mount.h" |
30 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_format.h" |
31 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
32 | #include "xfs_alloc_btree.h" | 32 | #include "xfs_alloc_btree.h" |
33 | #include "xfs_ialloc_btree.h" | 33 | #include "xfs_ialloc_btree.h" |
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index ac51abeb4782..4ec68c361c4c 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c | |||
@@ -26,9 +26,9 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_btree.h" |
30 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_dir2_format.h" | ||
32 | #include "xfs_dir2.h" | 32 | #include "xfs_dir2.h" |
33 | #include "xfs_dir2_priv.h" | 33 | #include "xfs_dir2_priv.h" |
34 | #include "xfs_dinode.h" | 34 | #include "xfs_dinode.h" |
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h index a762cfa4097d..e492dcadd032 100644 --- a/fs/xfs/xfs_da_btree.h +++ b/fs/xfs/xfs_da_btree.h | |||
@@ -25,146 +25,6 @@ struct xfs_trans; | |||
25 | struct zone; | 25 | struct zone; |
26 | 26 | ||
27 | /*======================================================================== | 27 | /*======================================================================== |
28 | * Directory Structure when greater than XFS_LBSIZE(mp) bytes. | ||
29 | *========================================================================*/ | ||
30 | |||
31 | /* | ||
32 | * This structure is common to both leaf nodes and non-leaf nodes in the Btree. | ||
33 | * | ||
34 | * It is used to manage a doubly linked list of all blocks at the same | ||
35 | * level in the Btree, and to identify which type of block this is. | ||
36 | */ | ||
37 | #define XFS_DA_NODE_MAGIC 0xfebe /* magic number: non-leaf blocks */ | ||
38 | #define XFS_ATTR_LEAF_MAGIC 0xfbee /* magic number: attribute leaf blks */ | ||
39 | #define XFS_DIR2_LEAF1_MAGIC 0xd2f1 /* magic number: v2 dirlf single blks */ | ||
40 | #define XFS_DIR2_LEAFN_MAGIC 0xd2ff /* magic number: v2 dirlf multi blks */ | ||
41 | |||
42 | typedef struct xfs_da_blkinfo { | ||
43 | __be32 forw; /* previous block in list */ | ||
44 | __be32 back; /* following block in list */ | ||
45 | __be16 magic; /* validity check on block */ | ||
46 | __be16 pad; /* unused */ | ||
47 | } xfs_da_blkinfo_t; | ||
48 | |||
49 | /* | ||
50 | * CRC enabled directory structure types | ||
51 | * | ||
52 | * The headers change size for the additional verification information, but | ||
53 | * otherwise the tree layouts and contents are unchanged. Hence the da btree | ||
54 | * code can use the struct xfs_da_blkinfo for manipulating the tree links and | ||
55 | * magic numbers without modification for both v2 and v3 nodes. | ||
56 | */ | ||
57 | #define XFS_DA3_NODE_MAGIC 0x3ebe /* magic number: non-leaf blocks */ | ||
58 | #define XFS_ATTR3_LEAF_MAGIC 0x3bee /* magic number: attribute leaf blks */ | ||
59 | #define XFS_DIR3_LEAF1_MAGIC 0x3df1 /* magic number: v2 dirlf single blks */ | ||
60 | #define XFS_DIR3_LEAFN_MAGIC 0x3dff /* magic number: v2 dirlf multi blks */ | ||
61 | |||
62 | struct xfs_da3_blkinfo { | ||
63 | /* | ||
64 | * the node link manipulation code relies on the fact that the first | ||
65 | * element of this structure is the struct xfs_da_blkinfo so it can | ||
66 | * ignore the differences in the rest of the structures. | ||
67 | */ | ||
68 | struct xfs_da_blkinfo hdr; | ||
69 | __be32 crc; /* CRC of block */ | ||
70 | __be64 blkno; /* first block of the buffer */ | ||
71 | __be64 lsn; /* sequence number of last write */ | ||
72 | uuid_t uuid; /* filesystem we belong to */ | ||
73 | __be64 owner; /* inode that owns the block */ | ||
74 | }; | ||
75 | |||
76 | /* | ||
77 | * This is the structure of the root and intermediate nodes in the Btree. | ||
78 | * The leaf nodes are defined above. | ||
79 | * | ||
80 | * Entries are not packed. | ||
81 | * | ||
82 | * Since we have duplicate keys, use a binary search but always follow | ||
83 | * all match in the block, not just the first match found. | ||
84 | */ | ||
85 | #define XFS_DA_NODE_MAXDEPTH 5 /* max depth of Btree */ | ||
86 | |||
87 | typedef struct xfs_da_node_hdr { | ||
88 | struct xfs_da_blkinfo info; /* block type, links, etc. */ | ||
89 | __be16 __count; /* count of active entries */ | ||
90 | __be16 __level; /* level above leaves (leaf == 0) */ | ||
91 | } xfs_da_node_hdr_t; | ||
92 | |||
93 | struct xfs_da3_node_hdr { | ||
94 | struct xfs_da3_blkinfo info; /* block type, links, etc. */ | ||
95 | __be16 __count; /* count of active entries */ | ||
96 | __be16 __level; /* level above leaves (leaf == 0) */ | ||
97 | __be32 __pad32; | ||
98 | }; | ||
99 | |||
100 | #define XFS_DA3_NODE_CRC_OFF (offsetof(struct xfs_da3_node_hdr, info.crc)) | ||
101 | |||
102 | typedef struct xfs_da_node_entry { | ||
103 | __be32 hashval; /* hash value for this descendant */ | ||
104 | __be32 before; /* Btree block before this key */ | ||
105 | } xfs_da_node_entry_t; | ||
106 | |||
107 | typedef struct xfs_da_intnode { | ||
108 | struct xfs_da_node_hdr hdr; | ||
109 | struct xfs_da_node_entry __btree[]; | ||
110 | } xfs_da_intnode_t; | ||
111 | |||
112 | struct xfs_da3_intnode { | ||
113 | struct xfs_da3_node_hdr hdr; | ||
114 | struct xfs_da_node_entry __btree[]; | ||
115 | }; | ||
116 | |||
117 | /* | ||
118 | * In-core version of the node header to abstract the differences in the v2 and | ||
119 | * v3 disk format of the headers. Callers need to convert to/from disk format as | ||
120 | * appropriate. | ||
121 | */ | ||
122 | struct xfs_da3_icnode_hdr { | ||
123 | __uint32_t forw; | ||
124 | __uint32_t back; | ||
125 | __uint16_t magic; | ||
126 | __uint16_t count; | ||
127 | __uint16_t level; | ||
128 | }; | ||
129 | |||
130 | extern void xfs_da3_node_hdr_from_disk(struct xfs_da3_icnode_hdr *to, | ||
131 | struct xfs_da_intnode *from); | ||
132 | extern void xfs_da3_node_hdr_to_disk(struct xfs_da_intnode *to, | ||
133 | struct xfs_da3_icnode_hdr *from); | ||
134 | |||
135 | static inline int | ||
136 | __xfs_da3_node_hdr_size(bool v3) | ||
137 | { | ||
138 | if (v3) | ||
139 | return sizeof(struct xfs_da3_node_hdr); | ||
140 | return sizeof(struct xfs_da_node_hdr); | ||
141 | } | ||
142 | static inline int | ||
143 | xfs_da3_node_hdr_size(struct xfs_da_intnode *dap) | ||
144 | { | ||
145 | bool v3 = dap->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC); | ||
146 | |||
147 | return __xfs_da3_node_hdr_size(v3); | ||
148 | } | ||
149 | |||
150 | static inline struct xfs_da_node_entry * | ||
151 | xfs_da3_node_tree_p(struct xfs_da_intnode *dap) | ||
152 | { | ||
153 | if (dap->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC)) { | ||
154 | struct xfs_da3_intnode *dap3 = (struct xfs_da3_intnode *)dap; | ||
155 | return dap3->__btree; | ||
156 | } | ||
157 | return dap->__btree; | ||
158 | } | ||
159 | |||
160 | extern void xfs_da3_intnode_from_disk(struct xfs_da3_icnode_hdr *to, | ||
161 | struct xfs_da_intnode *from); | ||
162 | extern void xfs_da3_intnode_to_disk(struct xfs_da_intnode *to, | ||
163 | struct xfs_da3_icnode_hdr *from); | ||
164 | |||
165 | #define XFS_LBSIZE(mp) (mp)->m_sb.sb_blocksize | ||
166 | |||
167 | /*======================================================================== | ||
168 | * Btree searching and modification structure definitions. | 28 | * Btree searching and modification structure definitions. |
169 | *========================================================================*/ | 29 | *========================================================================*/ |
170 | 30 | ||
diff --git a/fs/xfs/xfs_dir2_format.h b/fs/xfs/xfs_da_format.h index 9cf67381adf6..89a1a219c8ff 100644 --- a/fs/xfs/xfs_dir2_format.h +++ b/fs/xfs/xfs_da_format.h | |||
@@ -16,8 +16,148 @@ | |||
16 | * along with this program; if not, write the Free Software Foundation, | 16 | * along with this program; if not, write the Free Software Foundation, |
17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | */ | 18 | */ |
19 | #ifndef __XFS_DIR2_FORMAT_H__ | 19 | #ifndef __XFS_DA_FORMAT_H__ |
20 | #define __XFS_DIR2_FORMAT_H__ | 20 | #define __XFS_DA_FORMAT_H__ |
21 | |||
22 | /*======================================================================== | ||
23 | * Directory Structure when greater than XFS_LBSIZE(mp) bytes. | ||
24 | *========================================================================*/ | ||
25 | |||
26 | /* | ||
27 | * This structure is common to both leaf nodes and non-leaf nodes in the Btree. | ||
28 | * | ||
29 | * It is used to manage a doubly linked list of all blocks at the same | ||
30 | * level in the Btree, and to identify which type of block this is. | ||
31 | */ | ||
32 | #define XFS_DA_NODE_MAGIC 0xfebe /* magic number: non-leaf blocks */ | ||
33 | #define XFS_ATTR_LEAF_MAGIC 0xfbee /* magic number: attribute leaf blks */ | ||
34 | #define XFS_DIR2_LEAF1_MAGIC 0xd2f1 /* magic number: v2 dirlf single blks */ | ||
35 | #define XFS_DIR2_LEAFN_MAGIC 0xd2ff /* magic number: v2 dirlf multi blks */ | ||
36 | |||
37 | typedef struct xfs_da_blkinfo { | ||
38 | __be32 forw; /* previous block in list */ | ||
39 | __be32 back; /* following block in list */ | ||
40 | __be16 magic; /* validity check on block */ | ||
41 | __be16 pad; /* unused */ | ||
42 | } xfs_da_blkinfo_t; | ||
43 | |||
44 | /* | ||
45 | * CRC enabled directory structure types | ||
46 | * | ||
47 | * The headers change size for the additional verification information, but | ||
48 | * otherwise the tree layouts and contents are unchanged. Hence the da btree | ||
49 | * code can use the struct xfs_da_blkinfo for manipulating the tree links and | ||
50 | * magic numbers without modification for both v2 and v3 nodes. | ||
51 | */ | ||
52 | #define XFS_DA3_NODE_MAGIC 0x3ebe /* magic number: non-leaf blocks */ | ||
53 | #define XFS_ATTR3_LEAF_MAGIC 0x3bee /* magic number: attribute leaf blks */ | ||
54 | #define XFS_DIR3_LEAF1_MAGIC 0x3df1 /* magic number: v2 dirlf single blks */ | ||
55 | #define XFS_DIR3_LEAFN_MAGIC 0x3dff /* magic number: v2 dirlf multi blks */ | ||
56 | |||
57 | struct xfs_da3_blkinfo { | ||
58 | /* | ||
59 | * the node link manipulation code relies on the fact that the first | ||
60 | * element of this structure is the struct xfs_da_blkinfo so it can | ||
61 | * ignore the differences in the rest of the structures. | ||
62 | */ | ||
63 | struct xfs_da_blkinfo hdr; | ||
64 | __be32 crc; /* CRC of block */ | ||
65 | __be64 blkno; /* first block of the buffer */ | ||
66 | __be64 lsn; /* sequence number of last write */ | ||
67 | uuid_t uuid; /* filesystem we belong to */ | ||
68 | __be64 owner; /* inode that owns the block */ | ||
69 | }; | ||
70 | |||
71 | /* | ||
72 | * This is the structure of the root and intermediate nodes in the Btree. | ||
73 | * The leaf nodes are defined above. | ||
74 | * | ||
75 | * Entries are not packed. | ||
76 | * | ||
77 | * Since we have duplicate keys, use a binary search but always follow | ||
78 | * all match in the block, not just the first match found. | ||
79 | */ | ||
80 | #define XFS_DA_NODE_MAXDEPTH 5 /* max depth of Btree */ | ||
81 | |||
82 | typedef struct xfs_da_node_hdr { | ||
83 | struct xfs_da_blkinfo info; /* block type, links, etc. */ | ||
84 | __be16 __count; /* count of active entries */ | ||
85 | __be16 __level; /* level above leaves (leaf == 0) */ | ||
86 | } xfs_da_node_hdr_t; | ||
87 | |||
88 | struct xfs_da3_node_hdr { | ||
89 | struct xfs_da3_blkinfo info; /* block type, links, etc. */ | ||
90 | __be16 __count; /* count of active entries */ | ||
91 | __be16 __level; /* level above leaves (leaf == 0) */ | ||
92 | __be32 __pad32; | ||
93 | }; | ||
94 | |||
95 | #define XFS_DA3_NODE_CRC_OFF (offsetof(struct xfs_da3_node_hdr, info.crc)) | ||
96 | |||
97 | typedef struct xfs_da_node_entry { | ||
98 | __be32 hashval; /* hash value for this descendant */ | ||
99 | __be32 before; /* Btree block before this key */ | ||
100 | } xfs_da_node_entry_t; | ||
101 | |||
102 | typedef struct xfs_da_intnode { | ||
103 | struct xfs_da_node_hdr hdr; | ||
104 | struct xfs_da_node_entry __btree[]; | ||
105 | } xfs_da_intnode_t; | ||
106 | |||
107 | struct xfs_da3_intnode { | ||
108 | struct xfs_da3_node_hdr hdr; | ||
109 | struct xfs_da_node_entry __btree[]; | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * In-core version of the node header to abstract the differences in the v2 and | ||
114 | * v3 disk format of the headers. Callers need to convert to/from disk format as | ||
115 | * appropriate. | ||
116 | */ | ||
117 | struct xfs_da3_icnode_hdr { | ||
118 | __uint32_t forw; | ||
119 | __uint32_t back; | ||
120 | __uint16_t magic; | ||
121 | __uint16_t count; | ||
122 | __uint16_t level; | ||
123 | }; | ||
124 | |||
125 | extern void xfs_da3_node_hdr_from_disk(struct xfs_da3_icnode_hdr *to, | ||
126 | struct xfs_da_intnode *from); | ||
127 | extern void xfs_da3_node_hdr_to_disk(struct xfs_da_intnode *to, | ||
128 | struct xfs_da3_icnode_hdr *from); | ||
129 | |||
130 | static inline int | ||
131 | __xfs_da3_node_hdr_size(bool v3) | ||
132 | { | ||
133 | if (v3) | ||
134 | return sizeof(struct xfs_da3_node_hdr); | ||
135 | return sizeof(struct xfs_da_node_hdr); | ||
136 | } | ||
137 | static inline int | ||
138 | xfs_da3_node_hdr_size(struct xfs_da_intnode *dap) | ||
139 | { | ||
140 | bool v3 = dap->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC); | ||
141 | |||
142 | return __xfs_da3_node_hdr_size(v3); | ||
143 | } | ||
144 | |||
145 | static inline struct xfs_da_node_entry * | ||
146 | xfs_da3_node_tree_p(struct xfs_da_intnode *dap) | ||
147 | { | ||
148 | if (dap->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC)) { | ||
149 | struct xfs_da3_intnode *dap3 = (struct xfs_da3_intnode *)dap; | ||
150 | return dap3->__btree; | ||
151 | } | ||
152 | return dap->__btree; | ||
153 | } | ||
154 | |||
155 | extern void xfs_da3_intnode_from_disk(struct xfs_da3_icnode_hdr *to, | ||
156 | struct xfs_da_intnode *from); | ||
157 | extern void xfs_da3_intnode_to_disk(struct xfs_da_intnode *to, | ||
158 | struct xfs_da3_icnode_hdr *from); | ||
159 | |||
160 | #define XFS_LBSIZE(mp) (mp)->m_sb.sb_blocksize | ||
21 | 161 | ||
22 | /* | 162 | /* |
23 | * Directory version 2. | 163 | * Directory version 2. |
@@ -961,4 +1101,262 @@ xfs_dir2_block_leaf_p(struct xfs_dir2_block_tail *btp) | |||
961 | return ((struct xfs_dir2_leaf_entry *)btp) - be32_to_cpu(btp->count); | 1101 | return ((struct xfs_dir2_leaf_entry *)btp) - be32_to_cpu(btp->count); |
962 | } | 1102 | } |
963 | 1103 | ||
964 | #endif /* __XFS_DIR2_FORMAT_H__ */ | 1104 | |
1105 | /* | ||
1106 | * Attribute storage layout | ||
1107 | * | ||
1108 | * Attribute lists are structured around Btrees where all the data | ||
1109 | * elements are in the leaf nodes. Attribute names are hashed into an int, | ||
1110 | * then that int is used as the index into the Btree. Since the hashval | ||
1111 | * of an attribute name may not be unique, we may have duplicate keys. The | ||
1112 | * internal links in the Btree are logical block offsets into the file. | ||
1113 | * | ||
1114 | *======================================================================== | ||
1115 | * Attribute structure when equal to XFS_LBSIZE(mp) bytes. | ||
1116 | *======================================================================== | ||
1117 | * | ||
1118 | * Struct leaf_entry's are packed from the top. Name/values grow from the | ||
1119 | * bottom but are not packed. The freemap contains run-length-encoded entries | ||
1120 | * for the free bytes after the leaf_entry's, but only the N largest such, | ||
1121 | * smaller runs are dropped. When the freemap doesn't show enough space | ||
1122 | * for an allocation, we compact the name/value area and try again. If we | ||
1123 | * still don't have enough space, then we have to split the block. The | ||
1124 | * name/value structs (both local and remote versions) must be 32bit aligned. | ||
1125 | * | ||
1126 | * Since we have duplicate hash keys, for each key that matches, compare | ||
1127 | * the actual name string. The root and intermediate node search always | ||
1128 | * takes the first-in-the-block key match found, so we should only have | ||
1129 | * to work "forw"ard. If none matches, continue with the "forw"ard leaf | ||
1130 | * nodes until the hash key changes or the attribute name is found. | ||
1131 | * | ||
1132 | * We store the fact that an attribute is a ROOT/USER/SECURE attribute in | ||
1133 | * the leaf_entry. The namespaces are independent only because we also look | ||
1134 | * at the namespace bit when we are looking for a matching attribute name. | ||
1135 | * | ||
1136 | * We also store an "incomplete" bit in the leaf_entry. It shows that an | ||
1137 | * attribute is in the middle of being created and should not be shown to | ||
1138 | * the user if we crash during the time that the bit is set. We clear the | ||
1139 | * bit when we have finished setting up the attribute. We do this because | ||
1140 | * we cannot create some large attributes inside a single transaction, and we | ||
1141 | * need some indication that we weren't finished if we crash in the middle. | ||
1142 | */ | ||
1143 | #define XFS_ATTR_LEAF_MAPSIZE 3 /* how many freespace slots */ | ||
1144 | |||
1145 | typedef struct xfs_attr_leaf_map { /* RLE map of free bytes */ | ||
1146 | __be16 base; /* base of free region */ | ||
1147 | __be16 size; /* length of free region */ | ||
1148 | } xfs_attr_leaf_map_t; | ||
1149 | |||
1150 | typedef struct xfs_attr_leaf_hdr { /* constant-structure header block */ | ||
1151 | xfs_da_blkinfo_t info; /* block type, links, etc. */ | ||
1152 | __be16 count; /* count of active leaf_entry's */ | ||
1153 | __be16 usedbytes; /* num bytes of names/values stored */ | ||
1154 | __be16 firstused; /* first used byte in name area */ | ||
1155 | __u8 holes; /* != 0 if blk needs compaction */ | ||
1156 | __u8 pad1; | ||
1157 | xfs_attr_leaf_map_t freemap[XFS_ATTR_LEAF_MAPSIZE]; | ||
1158 | /* N largest free regions */ | ||
1159 | } xfs_attr_leaf_hdr_t; | ||
1160 | |||
1161 | typedef struct xfs_attr_leaf_entry { /* sorted on key, not name */ | ||
1162 | __be32 hashval; /* hash value of name */ | ||
1163 | __be16 nameidx; /* index into buffer of name/value */ | ||
1164 | __u8 flags; /* LOCAL/ROOT/SECURE/INCOMPLETE flag */ | ||
1165 | __u8 pad2; /* unused pad byte */ | ||
1166 | } xfs_attr_leaf_entry_t; | ||
1167 | |||
1168 | typedef struct xfs_attr_leaf_name_local { | ||
1169 | __be16 valuelen; /* number of bytes in value */ | ||
1170 | __u8 namelen; /* length of name bytes */ | ||
1171 | __u8 nameval[1]; /* name/value bytes */ | ||
1172 | } xfs_attr_leaf_name_local_t; | ||
1173 | |||
1174 | typedef struct xfs_attr_leaf_name_remote { | ||
1175 | __be32 valueblk; /* block number of value bytes */ | ||
1176 | __be32 valuelen; /* number of bytes in value */ | ||
1177 | __u8 namelen; /* length of name bytes */ | ||
1178 | __u8 name[1]; /* name bytes */ | ||
1179 | } xfs_attr_leaf_name_remote_t; | ||
1180 | |||
1181 | typedef struct xfs_attr_leafblock { | ||
1182 | xfs_attr_leaf_hdr_t hdr; /* constant-structure header block */ | ||
1183 | xfs_attr_leaf_entry_t entries[1]; /* sorted on key, not name */ | ||
1184 | xfs_attr_leaf_name_local_t namelist; /* grows from bottom of buf */ | ||
1185 | xfs_attr_leaf_name_remote_t valuelist; /* grows from bottom of buf */ | ||
1186 | } xfs_attr_leafblock_t; | ||
1187 | |||
1188 | /* | ||
1189 | * CRC enabled leaf structures. Called "version 3" structures to match the | ||
1190 | * version number of the directory and dablk structures for this feature, and | ||
1191 | * attr2 is already taken by the variable inode attribute fork size feature. | ||
1192 | */ | ||
1193 | struct xfs_attr3_leaf_hdr { | ||
1194 | struct xfs_da3_blkinfo info; | ||
1195 | __be16 count; | ||
1196 | __be16 usedbytes; | ||
1197 | __be16 firstused; | ||
1198 | __u8 holes; | ||
1199 | __u8 pad1; | ||
1200 | struct xfs_attr_leaf_map freemap[XFS_ATTR_LEAF_MAPSIZE]; | ||
1201 | __be32 pad2; /* 64 bit alignment */ | ||
1202 | }; | ||
1203 | |||
1204 | #define XFS_ATTR3_LEAF_CRC_OFF (offsetof(struct xfs_attr3_leaf_hdr, info.crc)) | ||
1205 | |||
1206 | struct xfs_attr3_leafblock { | ||
1207 | struct xfs_attr3_leaf_hdr hdr; | ||
1208 | struct xfs_attr_leaf_entry entries[1]; | ||
1209 | |||
1210 | /* | ||
1211 | * The rest of the block contains the following structures after the | ||
1212 | * leaf entries, growing from the bottom up. The variables are never | ||
1213 | * referenced, the locations accessed purely from helper functions. | ||
1214 | * | ||
1215 | * struct xfs_attr_leaf_name_local | ||
1216 | * struct xfs_attr_leaf_name_remote | ||
1217 | */ | ||
1218 | }; | ||
1219 | |||
1220 | /* | ||
1221 | * incore, neutral version of the attribute leaf header | ||
1222 | */ | ||
1223 | struct xfs_attr3_icleaf_hdr { | ||
1224 | __uint32_t forw; | ||
1225 | __uint32_t back; | ||
1226 | __uint16_t magic; | ||
1227 | __uint16_t count; | ||
1228 | __uint16_t usedbytes; | ||
1229 | __uint16_t firstused; | ||
1230 | __u8 holes; | ||
1231 | struct { | ||
1232 | __uint16_t base; | ||
1233 | __uint16_t size; | ||
1234 | } freemap[XFS_ATTR_LEAF_MAPSIZE]; | ||
1235 | }; | ||
1236 | |||
1237 | /* | ||
1238 | * Flags used in the leaf_entry[i].flags field. | ||
1239 | * NOTE: the INCOMPLETE bit must not collide with the flags bits specified | ||
1240 | * on the system call, they are "or"ed together for various operations. | ||
1241 | */ | ||
1242 | #define XFS_ATTR_LOCAL_BIT 0 /* attr is stored locally */ | ||
1243 | #define XFS_ATTR_ROOT_BIT 1 /* limit access to trusted attrs */ | ||
1244 | #define XFS_ATTR_SECURE_BIT 2 /* limit access to secure attrs */ | ||
1245 | #define XFS_ATTR_INCOMPLETE_BIT 7 /* attr in middle of create/delete */ | ||
1246 | #define XFS_ATTR_LOCAL (1 << XFS_ATTR_LOCAL_BIT) | ||
1247 | #define XFS_ATTR_ROOT (1 << XFS_ATTR_ROOT_BIT) | ||
1248 | #define XFS_ATTR_SECURE (1 << XFS_ATTR_SECURE_BIT) | ||
1249 | #define XFS_ATTR_INCOMPLETE (1 << XFS_ATTR_INCOMPLETE_BIT) | ||
1250 | |||
1251 | /* | ||
1252 | * Conversion macros for converting namespace bits from argument flags | ||
1253 | * to ondisk flags. | ||
1254 | */ | ||
1255 | #define XFS_ATTR_NSP_ARGS_MASK (ATTR_ROOT | ATTR_SECURE) | ||
1256 | #define XFS_ATTR_NSP_ONDISK_MASK (XFS_ATTR_ROOT | XFS_ATTR_SECURE) | ||
1257 | #define XFS_ATTR_NSP_ONDISK(flags) ((flags) & XFS_ATTR_NSP_ONDISK_MASK) | ||
1258 | #define XFS_ATTR_NSP_ARGS(flags) ((flags) & XFS_ATTR_NSP_ARGS_MASK) | ||
1259 | #define XFS_ATTR_NSP_ARGS_TO_ONDISK(x) (((x) & ATTR_ROOT ? XFS_ATTR_ROOT : 0) |\ | ||
1260 | ((x) & ATTR_SECURE ? XFS_ATTR_SECURE : 0)) | ||
1261 | #define XFS_ATTR_NSP_ONDISK_TO_ARGS(x) (((x) & XFS_ATTR_ROOT ? ATTR_ROOT : 0) |\ | ||
1262 | ((x) & XFS_ATTR_SECURE ? ATTR_SECURE : 0)) | ||
1263 | |||
1264 | /* | ||
1265 | * Alignment for namelist and valuelist entries (since they are mixed | ||
1266 | * there can be only one alignment value) | ||
1267 | */ | ||
1268 | #define XFS_ATTR_LEAF_NAME_ALIGN ((uint)sizeof(xfs_dablk_t)) | ||
1269 | |||
1270 | static inline int | ||
1271 | xfs_attr3_leaf_hdr_size(struct xfs_attr_leafblock *leafp) | ||
1272 | { | ||
1273 | if (leafp->hdr.info.magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) | ||
1274 | return sizeof(struct xfs_attr3_leaf_hdr); | ||
1275 | return sizeof(struct xfs_attr_leaf_hdr); | ||
1276 | } | ||
1277 | |||
1278 | static inline struct xfs_attr_leaf_entry * | ||
1279 | xfs_attr3_leaf_entryp(xfs_attr_leafblock_t *leafp) | ||
1280 | { | ||
1281 | if (leafp->hdr.info.magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) | ||
1282 | return &((struct xfs_attr3_leafblock *)leafp)->entries[0]; | ||
1283 | return &leafp->entries[0]; | ||
1284 | } | ||
1285 | |||
1286 | /* | ||
1287 | * Cast typed pointers for "local" and "remote" name/value structs. | ||
1288 | */ | ||
1289 | static inline char * | ||
1290 | xfs_attr3_leaf_name(xfs_attr_leafblock_t *leafp, int idx) | ||
1291 | { | ||
1292 | struct xfs_attr_leaf_entry *entries = xfs_attr3_leaf_entryp(leafp); | ||
1293 | |||
1294 | return &((char *)leafp)[be16_to_cpu(entries[idx].nameidx)]; | ||
1295 | } | ||
1296 | |||
1297 | static inline xfs_attr_leaf_name_remote_t * | ||
1298 | xfs_attr3_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) | ||
1299 | { | ||
1300 | return (xfs_attr_leaf_name_remote_t *)xfs_attr3_leaf_name(leafp, idx); | ||
1301 | } | ||
1302 | |||
1303 | static inline xfs_attr_leaf_name_local_t * | ||
1304 | xfs_attr3_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) | ||
1305 | { | ||
1306 | return (xfs_attr_leaf_name_local_t *)xfs_attr3_leaf_name(leafp, idx); | ||
1307 | } | ||
1308 | |||
1309 | /* | ||
1310 | * Calculate total bytes used (including trailing pad for alignment) for | ||
1311 | * a "local" name/value structure, a "remote" name/value structure, and | ||
1312 | * a pointer which might be either. | ||
1313 | */ | ||
1314 | static inline int xfs_attr_leaf_entsize_remote(int nlen) | ||
1315 | { | ||
1316 | return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \ | ||
1317 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | ||
1318 | } | ||
1319 | |||
1320 | static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen) | ||
1321 | { | ||
1322 | return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) + | ||
1323 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | ||
1324 | } | ||
1325 | |||
1326 | static inline int xfs_attr_leaf_entsize_local_max(int bsize) | ||
1327 | { | ||
1328 | return (((bsize) >> 1) + ((bsize) >> 2)); | ||
1329 | } | ||
1330 | |||
1331 | |||
1332 | |||
1333 | /* | ||
1334 | * Remote attribute block format definition | ||
1335 | * | ||
1336 | * There is one of these headers per filesystem block in a remote attribute. | ||
1337 | * This is done to ensure there is a 1:1 mapping between the attribute value | ||
1338 | * length and the number of blocks needed to store the attribute. This makes the | ||
1339 | * verification of a buffer a little more complex, but greatly simplifies the | ||
1340 | * allocation, reading and writing of these attributes as we don't have to guess | ||
1341 | * the number of blocks needed to store the attribute data. | ||
1342 | */ | ||
1343 | #define XFS_ATTR3_RMT_MAGIC 0x5841524d /* XARM */ | ||
1344 | |||
1345 | struct xfs_attr3_rmt_hdr { | ||
1346 | __be32 rm_magic; | ||
1347 | __be32 rm_offset; | ||
1348 | __be32 rm_bytes; | ||
1349 | __be32 rm_crc; | ||
1350 | uuid_t rm_uuid; | ||
1351 | __be64 rm_owner; | ||
1352 | __be64 rm_blkno; | ||
1353 | __be64 rm_lsn; | ||
1354 | }; | ||
1355 | |||
1356 | #define XFS_ATTR3_RMT_CRC_OFF offsetof(struct xfs_attr3_rmt_hdr, rm_crc) | ||
1357 | |||
1358 | #define XFS_ATTR3_RMT_BUF_SPACE(mp, bufsize) \ | ||
1359 | ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \ | ||
1360 | sizeof(struct xfs_attr3_rmt_hdr) : 0)) | ||
1361 | |||
1362 | #endif /* __XFS_DA_FORMAT_H__ */ | ||
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c index edf203ab50af..f46777fa3077 100644 --- a/fs/xfs/xfs_dir2.c +++ b/fs/xfs/xfs_dir2.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
26 | #include "xfs_mount.h" | 26 | #include "xfs_mount.h" |
27 | #include "xfs_da_format.h" | ||
27 | #include "xfs_da_btree.h" | 28 | #include "xfs_da_btree.h" |
28 | #include "xfs_bmap_btree.h" | 29 | #include "xfs_bmap_btree.h" |
29 | #include "xfs_alloc_btree.h" | 30 | #include "xfs_alloc_btree.h" |
@@ -31,7 +32,6 @@ | |||
31 | #include "xfs_inode.h" | 32 | #include "xfs_inode.h" |
32 | #include "xfs_inode_item.h" | 33 | #include "xfs_inode_item.h" |
33 | #include "xfs_bmap.h" | 34 | #include "xfs_bmap.h" |
34 | #include "xfs_dir2_format.h" | ||
35 | #include "xfs_dir2.h" | 35 | #include "xfs_dir2.h" |
36 | #include "xfs_dir2_priv.h" | 36 | #include "xfs_dir2_priv.h" |
37 | #include "xfs_error.h" | 37 | #include "xfs_error.h" |
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index 12dad188939d..5f172730bfa3 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
26 | #include "xfs_mount.h" | 26 | #include "xfs_mount.h" |
27 | #include "xfs_da_format.h" | ||
27 | #include "xfs_da_btree.h" | 28 | #include "xfs_da_btree.h" |
28 | #include "xfs_bmap_btree.h" | 29 | #include "xfs_bmap_btree.h" |
29 | #include "xfs_dinode.h" | 30 | #include "xfs_dinode.h" |
@@ -31,7 +32,6 @@ | |||
31 | #include "xfs_inode_item.h" | 32 | #include "xfs_inode_item.h" |
32 | #include "xfs_bmap.h" | 33 | #include "xfs_bmap.h" |
33 | #include "xfs_buf_item.h" | 34 | #include "xfs_buf_item.h" |
34 | #include "xfs_dir2_format.h" | ||
35 | #include "xfs_dir2.h" | 35 | #include "xfs_dir2.h" |
36 | #include "xfs_dir2_priv.h" | 36 | #include "xfs_dir2_priv.h" |
37 | #include "xfs_error.h" | 37 | #include "xfs_error.h" |
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c index 47e1326c169a..8cf8034ebab1 100644 --- a/fs/xfs/xfs_dir2_data.c +++ b/fs/xfs/xfs_dir2_data.c | |||
@@ -24,11 +24,11 @@ | |||
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
26 | #include "xfs_mount.h" | 26 | #include "xfs_mount.h" |
27 | #include "xfs_da_format.h" | ||
27 | #include "xfs_da_btree.h" | 28 | #include "xfs_da_btree.h" |
28 | #include "xfs_bmap_btree.h" | 29 | #include "xfs_bmap_btree.h" |
29 | #include "xfs_dinode.h" | 30 | #include "xfs_dinode.h" |
30 | #include "xfs_inode.h" | 31 | #include "xfs_inode.h" |
31 | #include "xfs_dir2_format.h" | ||
32 | #include "xfs_dir2.h" | 32 | #include "xfs_dir2.h" |
33 | #include "xfs_dir2_priv.h" | 33 | #include "xfs_dir2_priv.h" |
34 | #include "xfs_error.h" | 34 | #include "xfs_error.h" |
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index 1021c8356d08..d5937dab8f56 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
@@ -25,12 +25,12 @@ | |||
25 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
26 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
27 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
28 | #include "xfs_da_format.h" | ||
28 | #include "xfs_da_btree.h" | 29 | #include "xfs_da_btree.h" |
29 | #include "xfs_bmap_btree.h" | 30 | #include "xfs_bmap_btree.h" |
30 | #include "xfs_dinode.h" | 31 | #include "xfs_dinode.h" |
31 | #include "xfs_inode.h" | 32 | #include "xfs_inode.h" |
32 | #include "xfs_bmap.h" | 33 | #include "xfs_bmap.h" |
33 | #include "xfs_dir2_format.h" | ||
34 | #include "xfs_dir2.h" | 34 | #include "xfs_dir2.h" |
35 | #include "xfs_dir2_priv.h" | 35 | #include "xfs_dir2_priv.h" |
36 | #include "xfs_error.h" | 36 | #include "xfs_error.h" |
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c index 34df052683eb..85ff354db4ae 100644 --- a/fs/xfs/xfs_dir2_node.c +++ b/fs/xfs/xfs_dir2_node.c | |||
@@ -24,12 +24,12 @@ | |||
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
26 | #include "xfs_mount.h" | 26 | #include "xfs_mount.h" |
27 | #include "xfs_da_format.h" | ||
27 | #include "xfs_da_btree.h" | 28 | #include "xfs_da_btree.h" |
28 | #include "xfs_bmap_btree.h" | 29 | #include "xfs_bmap_btree.h" |
29 | #include "xfs_dinode.h" | 30 | #include "xfs_dinode.h" |
30 | #include "xfs_inode.h" | 31 | #include "xfs_inode.h" |
31 | #include "xfs_bmap.h" | 32 | #include "xfs_bmap.h" |
32 | #include "xfs_dir2_format.h" | ||
33 | #include "xfs_dir2.h" | 33 | #include "xfs_dir2.h" |
34 | #include "xfs_dir2_priv.h" | 34 | #include "xfs_dir2_priv.h" |
35 | #include "xfs_error.h" | 35 | #include "xfs_error.h" |
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c index 8f84153e98a8..6b1ffb37654a 100644 --- a/fs/xfs/xfs_dir2_readdir.c +++ b/fs/xfs/xfs_dir2_readdir.c | |||
@@ -25,11 +25,11 @@ | |||
25 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
26 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
27 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
28 | #include "xfs_da_format.h" | ||
28 | #include "xfs_da_btree.h" | 29 | #include "xfs_da_btree.h" |
29 | #include "xfs_bmap_btree.h" | 30 | #include "xfs_bmap_btree.h" |
30 | #include "xfs_dinode.h" | 31 | #include "xfs_dinode.h" |
31 | #include "xfs_inode.h" | 32 | #include "xfs_inode.h" |
32 | #include "xfs_dir2_format.h" | ||
33 | #include "xfs_dir2.h" | 33 | #include "xfs_dir2.h" |
34 | #include "xfs_dir2_priv.h" | 34 | #include "xfs_dir2_priv.h" |
35 | #include "xfs_error.h" | 35 | #include "xfs_error.h" |
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index 3ef6d402084c..8d925963a1f2 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -23,13 +23,13 @@ | |||
23 | #include "xfs_sb.h" | 23 | #include "xfs_sb.h" |
24 | #include "xfs_ag.h" | 24 | #include "xfs_ag.h" |
25 | #include "xfs_mount.h" | 25 | #include "xfs_mount.h" |
26 | #include "xfs_da_format.h" | ||
26 | #include "xfs_da_btree.h" | 27 | #include "xfs_da_btree.h" |
27 | #include "xfs_bmap_btree.h" | 28 | #include "xfs_bmap_btree.h" |
28 | #include "xfs_dinode.h" | 29 | #include "xfs_dinode.h" |
29 | #include "xfs_inode.h" | 30 | #include "xfs_inode.h" |
30 | #include "xfs_inode_item.h" | 31 | #include "xfs_inode_item.h" |
31 | #include "xfs_error.h" | 32 | #include "xfs_error.h" |
32 | #include "xfs_dir2_format.h" | ||
33 | #include "xfs_dir2.h" | 33 | #include "xfs_dir2.h" |
34 | #include "xfs_dir2_priv.h" | 34 | #include "xfs_dir2_priv.h" |
35 | #include "xfs_trace.h" | 35 | #include "xfs_trace.h" |
diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c index 066df425c14f..96be1d63da9b 100644 --- a/fs/xfs/xfs_export.c +++ b/fs/xfs/xfs_export.c | |||
@@ -22,8 +22,7 @@ | |||
22 | #include "xfs_sb.h" | 22 | #include "xfs_sb.h" |
23 | #include "xfs_ag.h" | 23 | #include "xfs_ag.h" |
24 | #include "xfs_mount.h" | 24 | #include "xfs_mount.h" |
25 | #include "xfs_da_btree.h" | 25 | #include "xfs_da_format.h" |
26 | #include "xfs_dir2_format.h" | ||
27 | #include "xfs_dir2.h" | 26 | #include "xfs_dir2.h" |
28 | #include "xfs_export.h" | 27 | #include "xfs_export.h" |
29 | #include "xfs_bmap_btree.h" | 28 | #include "xfs_bmap_btree.h" |
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 57d95b2f8692..cc22aa1b7b3b 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include "xfs_ag.h" | 23 | #include "xfs_ag.h" |
24 | #include "xfs_trans.h" | 24 | #include "xfs_trans.h" |
25 | #include "xfs_mount.h" | 25 | #include "xfs_mount.h" |
26 | #include "xfs_da_format.h" | ||
27 | #include "xfs_da_btree.h" | ||
26 | #include "xfs_bmap_btree.h" | 28 | #include "xfs_bmap_btree.h" |
27 | #include "xfs_alloc.h" | 29 | #include "xfs_alloc.h" |
28 | #include "xfs_dinode.h" | 30 | #include "xfs_dinode.h" |
@@ -31,8 +33,6 @@ | |||
31 | #include "xfs_bmap.h" | 33 | #include "xfs_bmap.h" |
32 | #include "xfs_bmap_util.h" | 34 | #include "xfs_bmap_util.h" |
33 | #include "xfs_error.h" | 35 | #include "xfs_error.h" |
34 | #include "xfs_da_btree.h" | ||
35 | #include "xfs_dir2_format.h" | ||
36 | #include "xfs_dir2.h" | 36 | #include "xfs_dir2.h" |
37 | #include "xfs_dir2_priv.h" | 37 | #include "xfs_dir2_priv.h" |
38 | #include "xfs_ioctl.h" | 38 | #include "xfs_ioctl.h" |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 1aaef689794d..23d78885c743 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -29,8 +29,8 @@ | |||
29 | #include "xfs_sb.h" | 29 | #include "xfs_sb.h" |
30 | #include "xfs_ag.h" | 30 | #include "xfs_ag.h" |
31 | #include "xfs_mount.h" | 31 | #include "xfs_mount.h" |
32 | #include "xfs_da_format.h" | ||
32 | #include "xfs_da_btree.h" | 33 | #include "xfs_da_btree.h" |
33 | #include "xfs_dir2_format.h" | ||
34 | #include "xfs_dir2.h" | 34 | #include "xfs_dir2.h" |
35 | #include "xfs_bmap_btree.h" | 35 | #include "xfs_bmap_btree.h" |
36 | #include "xfs_alloc_btree.h" | 36 | #include "xfs_alloc_btree.h" |
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 24fe333b8c41..d046dc8c1925 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "xfs_alloc.h" | 27 | #include "xfs_alloc.h" |
28 | #include "xfs_quota.h" | 28 | #include "xfs_quota.h" |
29 | #include "xfs_mount.h" | 29 | #include "xfs_mount.h" |
30 | #include "xfs_da_format.h" | ||
30 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_dinode.h" | 32 | #include "xfs_dinode.h" |
32 | #include "xfs_inode.h" | 33 | #include "xfs_inode.h" |
@@ -42,7 +43,6 @@ | |||
42 | #include "xfs_icache.h" | 43 | #include "xfs_icache.h" |
43 | #include "xfs_symlink.h" | 44 | #include "xfs_symlink.h" |
44 | #include "xfs_da_btree.h" | 45 | #include "xfs_da_btree.h" |
45 | #include "xfs_dir2_format.h" | ||
46 | #include "xfs_dir2_priv.h" | 46 | #include "xfs_dir2_priv.h" |
47 | 47 | ||
48 | #include <linux/capability.h> | 48 | #include <linux/capability.h> |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index cbefc1235083..4d4f4a0bb5e4 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_error.h" | 30 | #include "xfs_error.h" |
30 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_alloc_btree.h" | 32 | #include "xfs_alloc_btree.h" |
@@ -50,7 +51,6 @@ | |||
50 | /* Need all the magic numbers and buffer ops structures from these headers */ | 51 | /* Need all the magic numbers and buffer ops structures from these headers */ |
51 | #include "xfs_symlink.h" | 52 | #include "xfs_symlink.h" |
52 | #include "xfs_da_btree.h" | 53 | #include "xfs_da_btree.h" |
53 | #include "xfs_dir2_format.h" | ||
54 | #include "xfs_dir2.h" | 54 | #include "xfs_dir2.h" |
55 | #include "xfs_attr_leaf.h" | 55 | #include "xfs_attr_leaf.h" |
56 | #include "xfs_attr_remote.h" | 56 | #include "xfs_attr_remote.h" |
diff --git a/fs/xfs/xfs_log_rlimit.c b/fs/xfs/xfs_log_rlimit.c index 0961310abe46..e598bb547dee 100644 --- a/fs/xfs/xfs_log_rlimit.c +++ b/fs/xfs/xfs_log_rlimit.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "xfs_ag.h" | 23 | #include "xfs_ag.h" |
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_mount.h" | 25 | #include "xfs_mount.h" |
26 | #include "xfs_da_format.h" | ||
26 | #include "xfs_trans_space.h" | 27 | #include "xfs_trans_space.h" |
27 | #include "xfs_bmap_btree.h" | 28 | #include "xfs_bmap_btree.h" |
28 | #include "xfs_inode.h" | 29 | #include "xfs_inode.h" |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 9515f96b4ab7..170e7294b7b0 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -27,8 +27,7 @@ | |||
27 | #include "xfs_sb.h" | 27 | #include "xfs_sb.h" |
28 | #include "xfs_ag.h" | 28 | #include "xfs_ag.h" |
29 | #include "xfs_mount.h" | 29 | #include "xfs_mount.h" |
30 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_format.h" |
31 | #include "xfs_dir2_format.h" | ||
32 | #include "xfs_dir2.h" | 31 | #include "xfs_dir2.h" |
33 | #include "xfs_bmap_btree.h" | 32 | #include "xfs_bmap_btree.h" |
34 | #include "xfs_alloc_btree.h" | 33 | #include "xfs_alloc_btree.h" |
diff --git a/fs/xfs/xfs_sb.c b/fs/xfs/xfs_sb.c index b4762279bb78..73b24e15cef7 100644 --- a/fs/xfs/xfs_sb.c +++ b/fs/xfs/xfs_sb.c | |||
@@ -26,8 +26,8 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_da_btree.h" | 30 | #include "xfs_da_btree.h" |
30 | #include "xfs_dir2_format.h" | ||
31 | #include "xfs_dir2.h" | 31 | #include "xfs_dir2.h" |
32 | #include "xfs_bmap_btree.h" | 32 | #include "xfs_bmap_btree.h" |
33 | #include "xfs_alloc_btree.h" | 33 | #include "xfs_alloc_btree.h" |
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 4886b35b1ef1..a28eca47aa4c 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "xfs_alloc.h" | 27 | #include "xfs_alloc.h" |
28 | #include "xfs_quota.h" | 28 | #include "xfs_quota.h" |
29 | #include "xfs_mount.h" | 29 | #include "xfs_mount.h" |
30 | #include "xfs_da_format.h" | ||
30 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_alloc_btree.h" | 32 | #include "xfs_alloc_btree.h" |
32 | #include "xfs_ialloc_btree.h" | 33 | #include "xfs_ialloc_btree.h" |
@@ -45,7 +46,6 @@ | |||
45 | #include "xfs_trans_priv.h" | 46 | #include "xfs_trans_priv.h" |
46 | #include "xfs_filestream.h" | 47 | #include "xfs_filestream.h" |
47 | #include "xfs_da_btree.h" | 48 | #include "xfs_da_btree.h" |
48 | #include "xfs_dir2_format.h" | ||
49 | #include "xfs_dir2.h" | 49 | #include "xfs_dir2.h" |
50 | #include "xfs_extfree_item.h" | 50 | #include "xfs_extfree_item.h" |
51 | #include "xfs_mru_cache.h" | 51 | #include "xfs_mru_cache.h" |
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index cba781edb192..db32c504372c 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c | |||
@@ -26,8 +26,7 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_btree.h" | 29 | #include "xfs_da_format.h" |
30 | #include "xfs_dir2_format.h" | ||
31 | #include "xfs_dir2.h" | 30 | #include "xfs_dir2.h" |
32 | #include "xfs_bmap_btree.h" | 31 | #include "xfs_bmap_btree.h" |
33 | #include "xfs_ialloc_btree.h" | 32 | #include "xfs_ialloc_btree.h" |
diff --git a/fs/xfs/xfs_trace.c b/fs/xfs/xfs_trace.c index 29705391c896..6ca992020326 100644 --- a/fs/xfs/xfs_trace.c +++ b/fs/xfs/xfs_trace.c | |||
@@ -23,13 +23,14 @@ | |||
23 | #include "xfs_trans.h" | 23 | #include "xfs_trans.h" |
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
26 | #include "xfs_mount.h" | ||
27 | #include "xfs_da_format.h" | ||
26 | #include "xfs_bmap_btree.h" | 28 | #include "xfs_bmap_btree.h" |
27 | #include "xfs_alloc_btree.h" | 29 | #include "xfs_alloc_btree.h" |
28 | #include "xfs_ialloc_btree.h" | 30 | #include "xfs_ialloc_btree.h" |
29 | #include "xfs_dinode.h" | 31 | #include "xfs_dinode.h" |
30 | #include "xfs_inode.h" | 32 | #include "xfs_inode.h" |
31 | #include "xfs_btree.h" | 33 | #include "xfs_btree.h" |
32 | #include "xfs_mount.h" | ||
33 | #include "xfs_da_btree.h" | 34 | #include "xfs_da_btree.h" |
34 | #include "xfs_ialloc.h" | 35 | #include "xfs_ialloc.h" |
35 | #include "xfs_itable.h" | 36 | #include "xfs_itable.h" |
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 3693ce279143..06000a9647d5 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
27 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
28 | #include "xfs_error.h" | 28 | #include "xfs_error.h" |
29 | #include "xfs_da_btree.h" | 29 | #include "xfs_da_format.h" |
30 | #include "xfs_bmap_btree.h" | 30 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_alloc_btree.h" | 31 | #include "xfs_alloc_btree.h" |
32 | #include "xfs_ialloc_btree.h" | 32 | #include "xfs_ialloc_btree.h" |
diff --git a/fs/xfs/xfs_trans_resv.c b/fs/xfs/xfs_trans_resv.c index b5d952dbe6a4..cc8361255c8e 100644 --- a/fs/xfs/xfs_trans_resv.c +++ b/fs/xfs/xfs_trans_resv.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "xfs_sb.h" | 26 | #include "xfs_sb.h" |
27 | #include "xfs_ag.h" | 27 | #include "xfs_ag.h" |
28 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
29 | #include "xfs_da_format.h" | ||
29 | #include "xfs_error.h" | 30 | #include "xfs_error.h" |
30 | #include "xfs_da_btree.h" | 31 | #include "xfs_da_btree.h" |
31 | #include "xfs_bmap_btree.h" | 32 | #include "xfs_bmap_btree.h" |
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index e01f35ea76ba..08047502683d 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c | |||
@@ -18,7 +18,12 @@ | |||
18 | 18 | ||
19 | #include "xfs.h" | 19 | #include "xfs.h" |
20 | #include "xfs_log_format.h" | 20 | #include "xfs_log_format.h" |
21 | #include "xfs_da_btree.h" | 21 | #include "xfs_log.h" |
22 | #include "xfs_trans.h" | ||
23 | #include "xfs_sb.h" | ||
24 | #include "xfs_ag.h" | ||
25 | #include "xfs_mount.h" | ||
26 | #include "xfs_da_format.h" | ||
22 | #include "xfs_bmap_btree.h" | 27 | #include "xfs_bmap_btree.h" |
23 | #include "xfs_inode.h" | 28 | #include "xfs_inode.h" |
24 | #include "xfs_attr.h" | 29 | #include "xfs_attr.h" |