diff options
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index b2d7b2cd7851..a8d6f5e251aa 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -341,17 +341,42 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) | |||
341 | /* | 341 | /* |
342 | * Fork handling. | 342 | * Fork handling. |
343 | */ | 343 | */ |
344 | #define XFS_IFORK_PTR(ip,w) \ | ||
345 | ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp) | ||
346 | #define XFS_IFORK_Q(ip) XFS_CFORK_Q(&(ip)->i_d) | ||
347 | #define XFS_IFORK_DSIZE(ip) XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount) | ||
348 | #define XFS_IFORK_ASIZE(ip) XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount) | ||
349 | #define XFS_IFORK_SIZE(ip,w) XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w) | ||
350 | #define XFS_IFORK_FORMAT(ip,w) XFS_CFORK_FORMAT(&ip->i_d, w) | ||
351 | #define XFS_IFORK_FMT_SET(ip,w,n) XFS_CFORK_FMT_SET(&ip->i_d, w, n) | ||
352 | #define XFS_IFORK_NEXTENTS(ip,w) XFS_CFORK_NEXTENTS(&ip->i_d, w) | ||
353 | #define XFS_IFORK_NEXT_SET(ip,w,n) XFS_CFORK_NEXT_SET(&ip->i_d, w, n) | ||
354 | 344 | ||
345 | #define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) | ||
346 | #define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) | ||
347 | |||
348 | #define XFS_IFORK_PTR(ip,w) \ | ||
349 | ((w) == XFS_DATA_FORK ? \ | ||
350 | &(ip)->i_df : \ | ||
351 | (ip)->i_afp) | ||
352 | #define XFS_IFORK_DSIZE(ip) \ | ||
353 | (XFS_IFORK_Q(ip) ? \ | ||
354 | XFS_IFORK_BOFF(ip) : \ | ||
355 | XFS_LITINO((ip)->i_mount)) | ||
356 | #define XFS_IFORK_ASIZE(ip) \ | ||
357 | (XFS_IFORK_Q(ip) ? \ | ||
358 | XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \ | ||
359 | 0) | ||
360 | #define XFS_IFORK_SIZE(ip,w) \ | ||
361 | ((w) == XFS_DATA_FORK ? \ | ||
362 | XFS_IFORK_DSIZE(ip) : \ | ||
363 | XFS_IFORK_ASIZE(ip)) | ||
364 | #define XFS_IFORK_FORMAT(ip,w) \ | ||
365 | ((w) == XFS_DATA_FORK ? \ | ||
366 | (ip)->i_d.di_format : \ | ||
367 | (ip)->i_d.di_aformat) | ||
368 | #define XFS_IFORK_FMT_SET(ip,w,n) \ | ||
369 | ((w) == XFS_DATA_FORK ? \ | ||
370 | ((ip)->i_d.di_format = (n)) : \ | ||
371 | ((ip)->i_d.di_aformat = (n))) | ||
372 | #define XFS_IFORK_NEXTENTS(ip,w) \ | ||
373 | ((w) == XFS_DATA_FORK ? \ | ||
374 | (ip)->i_d.di_nextents : \ | ||
375 | (ip)->i_d.di_anextents) | ||
376 | #define XFS_IFORK_NEXT_SET(ip,w,n) \ | ||
377 | ((w) == XFS_DATA_FORK ? \ | ||
378 | ((ip)->i_d.di_nextents = (n)) : \ | ||
379 | ((ip)->i_d.di_anextents = (n))) | ||
355 | 380 | ||
356 | #ifdef __KERNEL__ | 381 | #ifdef __KERNEL__ |
357 | 382 | ||
@@ -503,7 +528,7 @@ void xfs_dinode_to_disk(struct xfs_dinode_core *, | |||
503 | struct xfs_icdinode *); | 528 | struct xfs_icdinode *); |
504 | 529 | ||
505 | uint xfs_ip2xflags(struct xfs_inode *); | 530 | uint xfs_ip2xflags(struct xfs_inode *); |
506 | uint xfs_dic2xflags(struct xfs_dinode_core *); | 531 | uint xfs_dic2xflags(struct xfs_dinode *); |
507 | int xfs_ifree(struct xfs_trans *, xfs_inode_t *, | 532 | int xfs_ifree(struct xfs_trans *, xfs_inode_t *, |
508 | struct xfs_bmap_free *); | 533 | struct xfs_bmap_free *); |
509 | int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t); | 534 | int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t); |