diff options
| author | Christoph Hellwig <hch@lst.de> | 2014-11-27 22:24:37 -0500 |
|---|---|---|
| committer | Dave Chinner <david@fromorbit.com> | 2014-11-27 22:24:37 -0500 |
| commit | 5beda58bf269febe67eca91d5d5dc7c7d392232a (patch) | |
| tree | 59706664dbd90908f8c2342bdb42f9ad446279cf | |
| parent | 6d3ebaae7c20128bfa6965a8d5cee0d1deea8486 (diff) | |
xfs: move acl structures to xfs_format.h
Move the on-disk ACL format to xfs_format.h, so that repair can
use the common defintion.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
| -rw-r--r-- | fs/xfs/libxfs/xfs_format.h | 36 | ||||
| -rw-r--r-- | fs/xfs/xfs_acl.h | 36 |
2 files changed, 36 insertions, 36 deletions
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index 3be17eee8f30..e99d3290152a 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h | |||
| @@ -627,4 +627,40 @@ struct xfs_btree_block { | |||
| 627 | #define XFS_BTREE_LBLOCK_CRC_OFF \ | 627 | #define XFS_BTREE_LBLOCK_CRC_OFF \ |
| 628 | offsetof(struct xfs_btree_block, bb_u.l.bb_crc) | 628 | offsetof(struct xfs_btree_block, bb_u.l.bb_crc) |
| 629 | 629 | ||
| 630 | /* | ||
| 631 | * On-disk XFS access control list structure. | ||
| 632 | */ | ||
| 633 | struct xfs_acl_entry { | ||
| 634 | __be32 ae_tag; | ||
| 635 | __be32 ae_id; | ||
| 636 | __be16 ae_perm; | ||
| 637 | __be16 ae_pad; /* fill the implicit hole in the structure */ | ||
| 638 | }; | ||
| 639 | |||
| 640 | struct xfs_acl { | ||
| 641 | __be32 acl_cnt; | ||
| 642 | struct xfs_acl_entry acl_entry[0]; | ||
| 643 | }; | ||
| 644 | |||
| 645 | /* | ||
| 646 | * The number of ACL entries allowed is defined by the on-disk format. | ||
| 647 | * For v4 superblocks, that is limited to 25 entries. For v5 superblocks, it is | ||
| 648 | * limited only by the maximum size of the xattr that stores the information. | ||
| 649 | */ | ||
| 650 | #define XFS_ACL_MAX_ENTRIES(mp) \ | ||
| 651 | (xfs_sb_version_hascrc(&mp->m_sb) \ | ||
| 652 | ? (XATTR_SIZE_MAX - sizeof(struct xfs_acl)) / \ | ||
| 653 | sizeof(struct xfs_acl_entry) \ | ||
| 654 | : 25) | ||
| 655 | |||
| 656 | #define XFS_ACL_MAX_SIZE(mp) \ | ||
| 657 | (sizeof(struct xfs_acl) + \ | ||
| 658 | sizeof(struct xfs_acl_entry) * XFS_ACL_MAX_ENTRIES((mp))) | ||
| 659 | |||
| 660 | /* On-disk XFS extended attribute names */ | ||
| 661 | #define SGI_ACL_FILE (unsigned char *)"SGI_ACL_FILE" | ||
| 662 | #define SGI_ACL_DEFAULT (unsigned char *)"SGI_ACL_DEFAULT" | ||
| 663 | #define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) | ||
| 664 | #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) | ||
| 665 | |||
| 630 | #endif /* __XFS_FORMAT_H__ */ | 666 | #endif /* __XFS_FORMAT_H__ */ |
diff --git a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h index 5dc163744511..3841b07f27bf 100644 --- a/fs/xfs/xfs_acl.h +++ b/fs/xfs/xfs_acl.h | |||
| @@ -22,42 +22,6 @@ struct inode; | |||
| 22 | struct posix_acl; | 22 | struct posix_acl; |
| 23 | struct xfs_inode; | 23 | struct xfs_inode; |
| 24 | 24 | ||
| 25 | #define XFS_ACL_NOT_PRESENT (-1) | ||
| 26 | |||
| 27 | /* On-disk XFS access control list structure */ | ||
| 28 | struct xfs_acl_entry { | ||
| 29 | __be32 ae_tag; | ||
| 30 | __be32 ae_id; | ||
| 31 | __be16 ae_perm; | ||
| 32 | __be16 ae_pad; /* fill the implicit hole in the structure */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct xfs_acl { | ||
| 36 | __be32 acl_cnt; | ||
| 37 | struct xfs_acl_entry acl_entry[0]; | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * The number of ACL entries allowed is defined by the on-disk format. | ||
| 42 | * For v4 superblocks, that is limited to 25 entries. For v5 superblocks, it is | ||
| 43 | * limited only by the maximum size of the xattr that stores the information. | ||
| 44 | */ | ||
| 45 | #define XFS_ACL_MAX_ENTRIES(mp) \ | ||
| 46 | (xfs_sb_version_hascrc(&mp->m_sb) \ | ||
| 47 | ? (XATTR_SIZE_MAX - sizeof(struct xfs_acl)) / \ | ||
| 48 | sizeof(struct xfs_acl_entry) \ | ||
| 49 | : 25) | ||
| 50 | |||
| 51 | #define XFS_ACL_MAX_SIZE(mp) \ | ||
| 52 | (sizeof(struct xfs_acl) + \ | ||
| 53 | sizeof(struct xfs_acl_entry) * XFS_ACL_MAX_ENTRIES((mp))) | ||
| 54 | |||
| 55 | /* On-disk XFS extended attribute names */ | ||
| 56 | #define SGI_ACL_FILE (unsigned char *)"SGI_ACL_FILE" | ||
| 57 | #define SGI_ACL_DEFAULT (unsigned char *)"SGI_ACL_DEFAULT" | ||
| 58 | #define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) | ||
| 59 | #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) | ||
| 60 | |||
| 61 | #ifdef CONFIG_XFS_POSIX_ACL | 25 | #ifdef CONFIG_XFS_POSIX_ACL |
| 62 | extern struct posix_acl *xfs_get_acl(struct inode *inode, int type); | 26 | extern struct posix_acl *xfs_get_acl(struct inode *inode, int type); |
| 63 | extern int xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type); | 27 | extern int xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type); |
