aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h75
1 files changed, 10 insertions, 65 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 6ec8a0dd84a8..11be922698af 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -33,6 +33,12 @@
33#define __XFS_INODE_H__ 33#define __XFS_INODE_H__
34 34
35/* 35/*
36 * Fork identifiers.
37 */
38#define XFS_DATA_FORK 0
39#define XFS_ATTR_FORK 1
40
41/*
36 * File incore extent information, present for each of data & attr forks. 42 * File incore extent information, present for each of data & attr forks.
37 */ 43 */
38#define XFS_INLINE_EXTS 2 44#define XFS_INLINE_EXTS 2
@@ -311,60 +317,16 @@ typedef struct xfs_inode {
311/* 317/*
312 * Fork handling. 318 * Fork handling.
313 */ 319 */
314#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_PTR) 320#define XFS_IFORK_PTR(ip,w) \
315xfs_ifork_t *xfs_ifork_ptr(xfs_inode_t *ip, int w); 321 ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp)
316#define XFS_IFORK_PTR(ip,w) xfs_ifork_ptr(ip,w)
317#else
318#define XFS_IFORK_PTR(ip,w) ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp)
319#endif
320#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_Q)
321int xfs_ifork_q(xfs_inode_t *ip);
322#define XFS_IFORK_Q(ip) xfs_ifork_q(ip)
323#else
324#define XFS_IFORK_Q(ip) XFS_CFORK_Q(&(ip)->i_d) 322#define XFS_IFORK_Q(ip) XFS_CFORK_Q(&(ip)->i_d)
325#endif
326#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_DSIZE)
327int xfs_ifork_dsize(xfs_inode_t *ip);
328#define XFS_IFORK_DSIZE(ip) xfs_ifork_dsize(ip)
329#else
330#define XFS_IFORK_DSIZE(ip) XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount) 323#define XFS_IFORK_DSIZE(ip) XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount)
331#endif
332#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_ASIZE)
333int xfs_ifork_asize(xfs_inode_t *ip);
334#define XFS_IFORK_ASIZE(ip) xfs_ifork_asize(ip)
335#else
336#define XFS_IFORK_ASIZE(ip) XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount) 324#define XFS_IFORK_ASIZE(ip) XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount)
337#endif
338#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_SIZE)
339int xfs_ifork_size(xfs_inode_t *ip, int w);
340#define XFS_IFORK_SIZE(ip,w) xfs_ifork_size(ip,w)
341#else
342#define XFS_IFORK_SIZE(ip,w) XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w) 325#define XFS_IFORK_SIZE(ip,w) XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w)
343#endif
344#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FORMAT)
345int xfs_ifork_format(xfs_inode_t *ip, int w);
346#define XFS_IFORK_FORMAT(ip,w) xfs_ifork_format(ip,w)
347#else
348#define XFS_IFORK_FORMAT(ip,w) XFS_CFORK_FORMAT(&ip->i_d, w) 326#define XFS_IFORK_FORMAT(ip,w) XFS_CFORK_FORMAT(&ip->i_d, w)
349#endif
350#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FMT_SET)
351void xfs_ifork_fmt_set(xfs_inode_t *ip, int w, int n);
352#define XFS_IFORK_FMT_SET(ip,w,n) xfs_ifork_fmt_set(ip,w,n)
353#else
354#define XFS_IFORK_FMT_SET(ip,w,n) XFS_CFORK_FMT_SET(&ip->i_d, w, n) 327#define XFS_IFORK_FMT_SET(ip,w,n) XFS_CFORK_FMT_SET(&ip->i_d, w, n)
355#endif
356#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXTENTS)
357int xfs_ifork_nextents(xfs_inode_t *ip, int w);
358#define XFS_IFORK_NEXTENTS(ip,w) xfs_ifork_nextents(ip,w)
359#else
360#define XFS_IFORK_NEXTENTS(ip,w) XFS_CFORK_NEXTENTS(&ip->i_d, w) 328#define XFS_IFORK_NEXTENTS(ip,w) XFS_CFORK_NEXTENTS(&ip->i_d, w)
361#endif
362#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXT_SET)
363void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
364#define XFS_IFORK_NEXT_SET(ip,w,n) xfs_ifork_next_set(ip,w,n)
365#else
366#define XFS_IFORK_NEXT_SET(ip,w,n) XFS_CFORK_NEXT_SET(&ip->i_d, w, n) 329#define XFS_IFORK_NEXT_SET(ip,w,n) XFS_CFORK_NEXT_SET(&ip->i_d, w, n)
367#endif
368 330
369 331
370#ifdef __KERNEL__ 332#ifdef __KERNEL__
@@ -418,28 +380,11 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
418#define XFS_ITRUNC_DEFINITE 0x1 380#define XFS_ITRUNC_DEFINITE 0x1
419#define XFS_ITRUNC_MAYBE 0x2 381#define XFS_ITRUNC_MAYBE 0x2
420 382
421#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOV)
422struct vnode *xfs_itov(xfs_inode_t *ip);
423#define XFS_ITOV(ip) xfs_itov(ip)
424#else
425#define XFS_ITOV(ip) BHV_TO_VNODE(XFS_ITOBHV(ip)) 383#define XFS_ITOV(ip) BHV_TO_VNODE(XFS_ITOBHV(ip))
426#endif
427#define XFS_ITOV_NULL(ip) BHV_TO_VNODE_NULL(XFS_ITOBHV(ip)) 384#define XFS_ITOV_NULL(ip) BHV_TO_VNODE_NULL(XFS_ITOBHV(ip))
428#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOBHV)
429struct bhv_desc *xfs_itobhv(xfs_inode_t *ip);
430#define XFS_ITOBHV(ip) xfs_itobhv(ip)
431#else
432#define XFS_ITOBHV(ip) ((struct bhv_desc *)(&((ip)->i_bhv_desc))) 385#define XFS_ITOBHV(ip) ((struct bhv_desc *)(&((ip)->i_bhv_desc)))
433#endif 386#define XFS_BHVTOI(bhvp) ((xfs_inode_t *)((char *)(bhvp) - \
434#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOI) 387 (char *)&(((xfs_inode_t *)0)->i_bhv_desc)))
435xfs_inode_t *xfs_bhvtoi(struct bhv_desc *bhvp);
436#define XFS_BHVTOI(bhvp) xfs_bhvtoi(bhvp)
437#else
438#define XFS_BHVTOI(bhvp) \
439 ((xfs_inode_t *)((char *)(bhvp) - \
440 (char *)&(((xfs_inode_t *)0)->i_bhv_desc)))
441#endif
442
443#define BHV_IS_XFS(bdp) (BHV_OPS(bdp) == &xfs_vnodeops) 388#define BHV_IS_XFS(bdp) (BHV_OPS(bdp) == &xfs_vnodeops)
444 389
445/* 390/*