xfs: split out inode log item format definition
[deliverable/linux.git] / fs / xfs / xfs_inode.h
1 /*
2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 #ifndef __XFS_INODE_H__
19 #define __XFS_INODE_H__
20
21 struct posix_acl;
22 struct xfs_dinode;
23 struct xfs_inode;
24
25 /*
26 * The following xfs_ext_irec_t struct introduces a second (top) level
27 * to the in-core extent allocation scheme. These structs are allocated
28 * in a contiguous block, creating an indirection array where each entry
29 * (irec) contains a pointer to a buffer of in-core extent records which
30 * it manages. Each extent buffer is 4k in size, since 4k is the system
31 * page size on Linux i386 and systems with larger page sizes don't seem
32 * to gain much, if anything, by using their native page size as the
33 * extent buffer size. Also, using 4k extent buffers everywhere provides
34 * a consistent interface for CXFS across different platforms.
35 *
36 * There is currently no limit on the number of irec's (extent lists)
37 * allowed, so heavily fragmented files may require an indirection array
38 * which spans multiple system pages of memory. The number of extents
39 * which would require this amount of contiguous memory is very large
40 * and should not cause problems in the foreseeable future. However,
41 * if the memory needed for the contiguous array ever becomes a problem,
42 * it is possible that a third level of indirection may be required.
43 */
44 typedef struct xfs_ext_irec {
45 xfs_bmbt_rec_host_t *er_extbuf; /* block of extent records */
46 xfs_extnum_t er_extoff; /* extent offset in file */
47 xfs_extnum_t er_extcount; /* number of extents in page/block */
48 } xfs_ext_irec_t;
49
50 /*
51 * File incore extent information, present for each of data & attr forks.
52 */
53 #define XFS_IEXT_BUFSZ 4096
54 #define XFS_LINEAR_EXTS (XFS_IEXT_BUFSZ / (uint)sizeof(xfs_bmbt_rec_t))
55 #define XFS_INLINE_EXTS 2
56 #define XFS_INLINE_DATA 32
57 typedef struct xfs_ifork {
58 int if_bytes; /* bytes in if_u1 */
59 int if_real_bytes; /* bytes allocated in if_u1 */
60 struct xfs_btree_block *if_broot; /* file's incore btree root */
61 short if_broot_bytes; /* bytes allocated for root */
62 unsigned char if_flags; /* per-fork flags */
63 union {
64 xfs_bmbt_rec_host_t *if_extents;/* linear map file exts */
65 xfs_ext_irec_t *if_ext_irec; /* irec map file exts */
66 char *if_data; /* inline file data */
67 } if_u1;
68 union {
69 xfs_bmbt_rec_host_t if_inline_ext[XFS_INLINE_EXTS];
70 /* very small file extents */
71 char if_inline_data[XFS_INLINE_DATA];
72 /* very small file data */
73 xfs_dev_t if_rdev; /* dev number if special */
74 uuid_t if_uuid; /* mount point value */
75 } if_u2;
76 } xfs_ifork_t;
77
78 /*
79 * Inode location information. Stored in the inode and passed to
80 * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
81 */
82 struct xfs_imap {
83 xfs_daddr_t im_blkno; /* starting BB of inode chunk */
84 ushort im_len; /* length in BBs of inode chunk */
85 ushort im_boffset; /* inode offset in block in bytes */
86 };
87
88 /*
89 * This is the xfs in-core inode structure.
90 * Most of the on-disk inode is embedded in the i_d field.
91 *
92 * The extent pointers/inline file space, however, are managed
93 * separately. The memory for this information is pointed to by
94 * the if_u1 unions depending on the type of the data.
95 * This is used to linearize the array of extents for fast in-core
96 * access. This is used until the file's number of extents
97 * surpasses XFS_MAX_INCORE_EXTENTS, at which point all extent pointers
98 * are accessed through the buffer cache.
99 *
100 * Other state kept in the in-core inode is used for identification,
101 * locking, transactional updating, etc of the inode.
102 *
103 * Generally, we do not want to hold the i_rlock while holding the
104 * i_ilock. Hierarchy is i_iolock followed by i_rlock.
105 *
106 * xfs_iptr_t contains all the inode fields up to and including the
107 * i_mnext and i_mprev fields, it is used as a marker in the inode
108 * chain off the mount structure by xfs_sync calls.
109 */
110
111 /*
112 * Flags for xfs_ichgtime().
113 */
114 #define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */
115 #define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */
116 #define XFS_ICHGTIME_CREATE 0x4 /* inode create timestamp */
117
118 /*
119 * Per-fork incore inode flags.
120 */
121 #define XFS_IFINLINE 0x01 /* Inline data is read in */
122 #define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */
123 #define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */
124 #define XFS_IFEXTIREC 0x08 /* Indirection array of extent blocks */
125
126 /*
127 * Fork handling.
128 */
129
130 #define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0)
131 #define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3))
132
133 #define XFS_IFORK_PTR(ip,w) \
134 ((w) == XFS_DATA_FORK ? \
135 &(ip)->i_df : \
136 (ip)->i_afp)
137 #define XFS_IFORK_DSIZE(ip) \
138 (XFS_IFORK_Q(ip) ? \
139 XFS_IFORK_BOFF(ip) : \
140 XFS_LITINO((ip)->i_mount, (ip)->i_d.di_version))
141 #define XFS_IFORK_ASIZE(ip) \
142 (XFS_IFORK_Q(ip) ? \
143 XFS_LITINO((ip)->i_mount, (ip)->i_d.di_version) - \
144 XFS_IFORK_BOFF(ip) : \
145 0)
146 #define XFS_IFORK_SIZE(ip,w) \
147 ((w) == XFS_DATA_FORK ? \
148 XFS_IFORK_DSIZE(ip) : \
149 XFS_IFORK_ASIZE(ip))
150 #define XFS_IFORK_FORMAT(ip,w) \
151 ((w) == XFS_DATA_FORK ? \
152 (ip)->i_d.di_format : \
153 (ip)->i_d.di_aformat)
154 #define XFS_IFORK_FMT_SET(ip,w,n) \
155 ((w) == XFS_DATA_FORK ? \
156 ((ip)->i_d.di_format = (n)) : \
157 ((ip)->i_d.di_aformat = (n)))
158 #define XFS_IFORK_NEXTENTS(ip,w) \
159 ((w) == XFS_DATA_FORK ? \
160 (ip)->i_d.di_nextents : \
161 (ip)->i_d.di_anextents)
162 #define XFS_IFORK_NEXT_SET(ip,w,n) \
163 ((w) == XFS_DATA_FORK ? \
164 ((ip)->i_d.di_nextents = (n)) : \
165 ((ip)->i_d.di_anextents = (n)))
166 #define XFS_IFORK_MAXEXT(ip, w) \
167 (XFS_IFORK_SIZE(ip, w) / sizeof(xfs_bmbt_rec_t))
168
169
170 #ifdef __KERNEL__
171
172 struct xfs_buf;
173 struct xfs_bmap_free;
174 struct xfs_bmbt_irec;
175 struct xfs_inode_log_item;
176 struct xfs_mount;
177 struct xfs_trans;
178 struct xfs_dquot;
179
180 typedef struct xfs_inode {
181 /* Inode linking and identification information. */
182 struct xfs_mount *i_mount; /* fs mount struct ptr */
183 struct xfs_dquot *i_udquot; /* user dquot */
184 struct xfs_dquot *i_gdquot; /* group dquot */
185 struct xfs_dquot *i_pdquot; /* project dquot */
186
187 /* Inode location stuff */
188 xfs_ino_t i_ino; /* inode number (agno/agino)*/
189 struct xfs_imap i_imap; /* location for xfs_imap() */
190
191 /* Extent information. */
192 xfs_ifork_t *i_afp; /* attribute fork pointer */
193 xfs_ifork_t i_df; /* data fork */
194
195 /* Transaction and locking information. */
196 struct xfs_inode_log_item *i_itemp; /* logging information */
197 mrlock_t i_lock; /* inode lock */
198 mrlock_t i_iolock; /* inode IO lock */
199 atomic_t i_pincount; /* inode pin count */
200 spinlock_t i_flags_lock; /* inode i_flags lock */
201 /* Miscellaneous state. */
202 unsigned long i_flags; /* see defined flags below */
203 unsigned int i_delayed_blks; /* count of delay alloc blks */
204
205 xfs_icdinode_t i_d; /* most of ondisk inode */
206
207 /* VFS inode */
208 struct inode i_vnode; /* embedded VFS inode */
209 } xfs_inode_t;
210
211 /* Convert from vfs inode to xfs inode */
212 static inline struct xfs_inode *XFS_I(struct inode *inode)
213 {
214 return container_of(inode, struct xfs_inode, i_vnode);
215 }
216
217 /* convert from xfs inode to vfs inode */
218 static inline struct inode *VFS_I(struct xfs_inode *ip)
219 {
220 return &ip->i_vnode;
221 }
222
223 /*
224 * For regular files we only update the on-disk filesize when actually
225 * writing data back to disk. Until then only the copy in the VFS inode
226 * is uptodate.
227 */
228 static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip)
229 {
230 if (S_ISREG(ip->i_d.di_mode))
231 return i_size_read(VFS_I(ip));
232 return ip->i_d.di_size;
233 }
234
235 /*
236 * If this I/O goes past the on-disk inode size update it unless it would
237 * be past the current in-core inode size.
238 */
239 static inline xfs_fsize_t
240 xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size)
241 {
242 xfs_fsize_t i_size = i_size_read(VFS_I(ip));
243
244 if (new_size > i_size)
245 new_size = i_size;
246 return new_size > ip->i_d.di_size ? new_size : 0;
247 }
248
249 /*
250 * i_flags helper functions
251 */
252 static inline void
253 __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
254 {
255 ip->i_flags |= flags;
256 }
257
258 static inline void
259 xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
260 {
261 spin_lock(&ip->i_flags_lock);
262 __xfs_iflags_set(ip, flags);
263 spin_unlock(&ip->i_flags_lock);
264 }
265
266 static inline void
267 xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags)
268 {
269 spin_lock(&ip->i_flags_lock);
270 ip->i_flags &= ~flags;
271 spin_unlock(&ip->i_flags_lock);
272 }
273
274 static inline int
275 __xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
276 {
277 return (ip->i_flags & flags);
278 }
279
280 static inline int
281 xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
282 {
283 int ret;
284 spin_lock(&ip->i_flags_lock);
285 ret = __xfs_iflags_test(ip, flags);
286 spin_unlock(&ip->i_flags_lock);
287 return ret;
288 }
289
290 static inline int
291 xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
292 {
293 int ret;
294
295 spin_lock(&ip->i_flags_lock);
296 ret = ip->i_flags & flags;
297 if (ret)
298 ip->i_flags &= ~flags;
299 spin_unlock(&ip->i_flags_lock);
300 return ret;
301 }
302
303 static inline int
304 xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags)
305 {
306 int ret;
307
308 spin_lock(&ip->i_flags_lock);
309 ret = ip->i_flags & flags;
310 if (!ret)
311 ip->i_flags |= flags;
312 spin_unlock(&ip->i_flags_lock);
313 return ret;
314 }
315
316 /*
317 * Project quota id helpers (previously projid was 16bit only
318 * and using two 16bit values to hold new 32bit projid was chosen
319 * to retain compatibility with "old" filesystems).
320 */
321 static inline prid_t
322 xfs_get_projid(struct xfs_inode *ip)
323 {
324 return (prid_t)ip->i_d.di_projid_hi << 16 | ip->i_d.di_projid_lo;
325 }
326
327 static inline void
328 xfs_set_projid(struct xfs_inode *ip,
329 prid_t projid)
330 {
331 ip->i_d.di_projid_hi = (__uint16_t) (projid >> 16);
332 ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff);
333 }
334
335 /*
336 * In-core inode flags.
337 */
338 #define XFS_IRECLAIM (1 << 0) /* started reclaiming this inode */
339 #define XFS_ISTALE (1 << 1) /* inode has been staled */
340 #define XFS_IRECLAIMABLE (1 << 2) /* inode can be reclaimed */
341 #define XFS_INEW (1 << 3) /* inode has just been allocated */
342 #define XFS_IFILESTREAM (1 << 4) /* inode is in a filestream dir. */
343 #define XFS_ITRUNCATED (1 << 5) /* truncated down so flush-on-close */
344 #define XFS_IDIRTY_RELEASE (1 << 6) /* dirty release already seen */
345 #define __XFS_IFLOCK_BIT 7 /* inode is being flushed right now */
346 #define XFS_IFLOCK (1 << __XFS_IFLOCK_BIT)
347 #define __XFS_IPINNED_BIT 8 /* wakeup key for zero pin count */
348 #define XFS_IPINNED (1 << __XFS_IPINNED_BIT)
349 #define XFS_IDONTCACHE (1 << 9) /* don't cache the inode long term */
350
351 /*
352 * Per-lifetime flags need to be reset when re-using a reclaimable inode during
353 * inode lookup. This prevents unintended behaviour on the new inode from
354 * ocurring.
355 */
356 #define XFS_IRECLAIM_RESET_FLAGS \
357 (XFS_IRECLAIMABLE | XFS_IRECLAIM | \
358 XFS_IDIRTY_RELEASE | XFS_ITRUNCATED | \
359 XFS_IFILESTREAM);
360
361 /*
362 * Synchronize processes attempting to flush the in-core inode back to disk.
363 */
364
365 extern void __xfs_iflock(struct xfs_inode *ip);
366
367 static inline int xfs_iflock_nowait(struct xfs_inode *ip)
368 {
369 return !xfs_iflags_test_and_set(ip, XFS_IFLOCK);
370 }
371
372 static inline void xfs_iflock(struct xfs_inode *ip)
373 {
374 if (!xfs_iflock_nowait(ip))
375 __xfs_iflock(ip);
376 }
377
378 static inline void xfs_ifunlock(struct xfs_inode *ip)
379 {
380 xfs_iflags_clear(ip, XFS_IFLOCK);
381 smp_mb();
382 wake_up_bit(&ip->i_flags, __XFS_IFLOCK_BIT);
383 }
384
385 static inline int xfs_isiflocked(struct xfs_inode *ip)
386 {
387 return xfs_iflags_test(ip, XFS_IFLOCK);
388 }
389
390 /*
391 * Flags for inode locking.
392 * Bit ranges: 1<<1 - 1<<16-1 -- iolock/ilock modes (bitfield)
393 * 1<<16 - 1<<32-1 -- lockdep annotation (integers)
394 */
395 #define XFS_IOLOCK_EXCL (1<<0)
396 #define XFS_IOLOCK_SHARED (1<<1)
397 #define XFS_ILOCK_EXCL (1<<2)
398 #define XFS_ILOCK_SHARED (1<<3)
399
400 #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \
401 | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED)
402
403 #define XFS_LOCK_FLAGS \
404 { XFS_IOLOCK_EXCL, "IOLOCK_EXCL" }, \
405 { XFS_IOLOCK_SHARED, "IOLOCK_SHARED" }, \
406 { XFS_ILOCK_EXCL, "ILOCK_EXCL" }, \
407 { XFS_ILOCK_SHARED, "ILOCK_SHARED" }
408
409
410 /*
411 * Flags for lockdep annotations.
412 *
413 * XFS_LOCK_PARENT - for directory operations that require locking a
414 * parent directory inode and a child entry inode. The parent gets locked
415 * with this flag so it gets a lockdep subclass of 1 and the child entry
416 * lock will have a lockdep subclass of 0.
417 *
418 * XFS_LOCK_RTBITMAP/XFS_LOCK_RTSUM - the realtime device bitmap and summary
419 * inodes do not participate in the normal lock order, and thus have their
420 * own subclasses.
421 *
422 * XFS_LOCK_INUMORDER - for locking several inodes at the some time
423 * with xfs_lock_inodes(). This flag is used as the starting subclass
424 * and each subsequent lock acquired will increment the subclass by one.
425 * So the first lock acquired will have a lockdep subclass of 4, the
426 * second lock will have a lockdep subclass of 5, and so on. It is
427 * the responsibility of the class builder to shift this to the correct
428 * portion of the lock_mode lockdep mask.
429 */
430 #define XFS_LOCK_PARENT 1
431 #define XFS_LOCK_RTBITMAP 2
432 #define XFS_LOCK_RTSUM 3
433 #define XFS_LOCK_INUMORDER 4
434
435 #define XFS_IOLOCK_SHIFT 16
436 #define XFS_IOLOCK_PARENT (XFS_LOCK_PARENT << XFS_IOLOCK_SHIFT)
437
438 #define XFS_ILOCK_SHIFT 24
439 #define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT)
440 #define XFS_ILOCK_RTBITMAP (XFS_LOCK_RTBITMAP << XFS_ILOCK_SHIFT)
441 #define XFS_ILOCK_RTSUM (XFS_LOCK_RTSUM << XFS_ILOCK_SHIFT)
442
443 #define XFS_IOLOCK_DEP_MASK 0x00ff0000
444 #define XFS_ILOCK_DEP_MASK 0xff000000
445 #define XFS_LOCK_DEP_MASK (XFS_IOLOCK_DEP_MASK | XFS_ILOCK_DEP_MASK)
446
447 #define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) >> XFS_IOLOCK_SHIFT)
448 #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK_SHIFT)
449
450 /*
451 * For multiple groups support: if S_ISGID bit is set in the parent
452 * directory, group of new file is set to that of the parent, and
453 * new subdirectory gets S_ISGID bit from parent.
454 */
455 #define XFS_INHERIT_GID(pip) \
456 (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \
457 ((pip)->i_d.di_mode & S_ISGID))
458
459
460 /*
461 * xfs_inode.c prototypes.
462 */
463 void xfs_ilock(xfs_inode_t *, uint);
464 int xfs_ilock_nowait(xfs_inode_t *, uint);
465 void xfs_iunlock(xfs_inode_t *, uint);
466 void xfs_ilock_demote(xfs_inode_t *, uint);
467 int xfs_isilocked(xfs_inode_t *, uint);
468 uint xfs_ilock_map_shared(xfs_inode_t *);
469 void xfs_iunlock_map_shared(xfs_inode_t *, uint);
470 int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t,
471 xfs_nlink_t, xfs_dev_t, prid_t, int,
472 struct xfs_buf **, xfs_inode_t **);
473
474 uint xfs_ip2xflags(struct xfs_inode *);
475 uint xfs_dic2xflags(struct xfs_dinode *);
476 int xfs_ifree(struct xfs_trans *, xfs_inode_t *,
477 struct xfs_bmap_free *);
478 int xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *,
479 int, xfs_fsize_t);
480 int xfs_iunlink(struct xfs_trans *, xfs_inode_t *);
481
482 void xfs_iext_realloc(xfs_inode_t *, int, int);
483 void xfs_iunpin_wait(xfs_inode_t *);
484 int xfs_iflush(struct xfs_inode *, struct xfs_buf **);
485 void xfs_lock_inodes(xfs_inode_t **, int, uint);
486 void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
487
488 xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
489
490 #define IHOLD(ip) \
491 do { \
492 ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
493 ihold(VFS_I(ip)); \
494 trace_xfs_ihold(ip, _THIS_IP_); \
495 } while (0)
496
497 #define IRELE(ip) \
498 do { \
499 trace_xfs_irele(ip, _THIS_IP_); \
500 iput(VFS_I(ip)); \
501 } while (0)
502
503 #endif /* __KERNEL__ */
504
505 /*
506 * Flags for xfs_iget()
507 */
508 #define XFS_IGET_CREATE 0x1
509 #define XFS_IGET_UNTRUSTED 0x2
510 #define XFS_IGET_DONTCACHE 0x4
511
512 int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *,
513 struct xfs_imap *, struct xfs_dinode **,
514 struct xfs_buf **, uint, uint);
515 int xfs_iread(struct xfs_mount *, struct xfs_trans *,
516 struct xfs_inode *, uint);
517 void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
518 void xfs_dinode_to_disk(struct xfs_dinode *,
519 struct xfs_icdinode *);
520 void xfs_idestroy_fork(struct xfs_inode *, int);
521 void xfs_idata_realloc(struct xfs_inode *, int, int);
522 void xfs_iroot_realloc(struct xfs_inode *, int, int);
523 int xfs_iread_extents(struct xfs_trans *, struct xfs_inode *, int);
524 int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int);
525
526 xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t);
527 void xfs_iext_insert(xfs_inode_t *, xfs_extnum_t, xfs_extnum_t,
528 xfs_bmbt_irec_t *, int);
529 void xfs_iext_add(xfs_ifork_t *, xfs_extnum_t, int);
530 void xfs_iext_add_indirect_multi(xfs_ifork_t *, int, xfs_extnum_t, int);
531 void xfs_iext_remove(xfs_inode_t *, xfs_extnum_t, int, int);
532 void xfs_iext_remove_inline(xfs_ifork_t *, xfs_extnum_t, int);
533 void xfs_iext_remove_direct(xfs_ifork_t *, xfs_extnum_t, int);
534 void xfs_iext_remove_indirect(xfs_ifork_t *, xfs_extnum_t, int);
535 void xfs_iext_realloc_direct(xfs_ifork_t *, int);
536 void xfs_iext_direct_to_inline(xfs_ifork_t *, xfs_extnum_t);
537 void xfs_iext_inline_to_direct(xfs_ifork_t *, int);
538 void xfs_iext_destroy(xfs_ifork_t *);
539 xfs_bmbt_rec_host_t *xfs_iext_bno_to_ext(xfs_ifork_t *, xfs_fileoff_t, int *);
540 xfs_ext_irec_t *xfs_iext_bno_to_irec(xfs_ifork_t *, xfs_fileoff_t, int *);
541 xfs_ext_irec_t *xfs_iext_idx_to_irec(xfs_ifork_t *, xfs_extnum_t *, int *, int);
542 void xfs_iext_irec_init(xfs_ifork_t *);
543 xfs_ext_irec_t *xfs_iext_irec_new(xfs_ifork_t *, int);
544 void xfs_iext_irec_remove(xfs_ifork_t *, int);
545 void xfs_iext_irec_compact(xfs_ifork_t *);
546 void xfs_iext_irec_compact_pages(xfs_ifork_t *);
547 void xfs_iext_irec_compact_full(xfs_ifork_t *);
548 void xfs_iext_irec_update_extoffs(xfs_ifork_t *, int, int);
549 bool xfs_can_free_eofblocks(struct xfs_inode *, bool);
550
551 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount))
552
553 #if defined(DEBUG)
554 void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
555 #else
556 #define xfs_inobp_check(mp, bp)
557 #endif /* DEBUG */
558
559 extern struct kmem_zone *xfs_ifork_zone;
560 extern struct kmem_zone *xfs_inode_zone;
561 extern const struct xfs_buf_ops xfs_inode_buf_ops;
562
563 #endif /* __XFS_INODE_H__ */
This page took 0.043546 seconds and 5 git commands to generate.