Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hfsplus: add necessary declarations for POSIX ACLs support

This patchset implements POSIX ACLs support in hfsplus driver.

Mac OS X beginning with version 10.4 ("Tiger") support NFSv4 ACLs, which
are part of the NFSv4 standard. HFS+ stores ACLs in the form of
specially named extended attributes (com.apple.system.Security).

But this patchset doesn't use "com.apple.system.Security" extended
attributes. It implements support of POSIX ACLs in the form of extended
attributes with names "system.posix_acl_access" and
"system.posix_acl_default". These xattrs are treated only under Linux.
POSIX ACLs doesn't mean something under Mac OS X. Thereby, this patch
set provides opportunity to use POSIX ACLs under Linux on HFS+
filesystem.

This patch:

Add CONFIG_HFSPLUS_FS_POSIX_ACL kernel configuration option, DBG_ACL_MOD
debugging flag and acl.h file with declaration of essential functions
for support POSIX ACLs in hfsplus driver.

Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Vyacheslav Dubeyko and committed by
Linus Torvalds
2c92057e 7c1d69ee

+49
+18
fs/hfsplus/Kconfig
··· 11 11 MacOS 8. It includes all Mac specific filesystem data such as 12 12 data forks and creator codes, but it also has several UNIX 13 13 style features such as file ownership and permissions. 14 + 15 + config HFSPLUS_FS_POSIX_ACL 16 + bool "HFS+ POSIX Access Control Lists" 17 + depends on HFSPLUS_FS 18 + select FS_POSIX_ACL 19 + help 20 + POSIX Access Control Lists (ACLs) support permissions for users and 21 + groups beyond the owner/group/world scheme. 22 + 23 + To learn more about Access Control Lists, visit the POSIX ACLs for 24 + Linux website <http://acl.bestbits.at/>. 25 + 26 + It needs to understand that POSIX ACLs are treated only under 27 + Linux. POSIX ACLs doesn't mean something under Mac OS X. 28 + Mac OS X beginning with version 10.4 ("Tiger") support NFSv4 ACLs, 29 + which are part of the NFSv4 standard. 30 + 31 + If you don't know what Access Control Lists are, say N
+30
fs/hfsplus/acl.h
··· 1 + /* 2 + * linux/fs/hfsplus/acl.h 3 + * 4 + * Vyacheslav Dubeyko <slava@dubeyko.com> 5 + * 6 + * Handler for Posix Access Control Lists (ACLs) support. 7 + */ 8 + 9 + #include <linux/posix_acl_xattr.h> 10 + 11 + #ifdef CONFIG_HFSPLUS_FS_POSIX_ACL 12 + 13 + /* posix_acl.c */ 14 + struct posix_acl *hfsplus_get_posix_acl(struct inode *inode, int type); 15 + extern int hfsplus_posix_acl_chmod(struct inode *); 16 + extern int hfsplus_init_posix_acl(struct inode *, struct inode *); 17 + 18 + #else /* CONFIG_HFSPLUS_FS_POSIX_ACL */ 19 + #define hfsplus_get_posix_acl NULL 20 + 21 + static inline int hfsplus_posix_acl_chmod(struct inode *inode) 22 + { 23 + return 0; 24 + } 25 + 26 + static inline int hfsplus_init_posix_acl(struct inode *inode, struct inode *dir) 27 + { 28 + return 0; 29 + } 30 + #endif /* CONFIG_HFSPLUS_FS_POSIX_ACL */
+1
fs/hfsplus/hfsplus_fs.h
··· 30 30 #define DBG_EXTENT 0x00000020 31 31 #define DBG_BITMAP 0x00000040 32 32 #define DBG_ATTR_MOD 0x00000080 33 + #define DBG_ACL_MOD 0x00000100 33 34 34 35 #if 0 35 36 #define DBG_MASK (DBG_EXTENT|DBG_INODE|DBG_BNODE_MOD)