linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 3/5] hfsplus: add all neccessary declarations for ACLs support
@ 2013-05-09 16:38 Vyacheslav Dubeyko
  0 siblings, 0 replies; only message in thread
From: Vyacheslav Dubeyko @ 2013-05-09 16:38 UTC (permalink / raw)
  To: Linux FS devel list, Linux NFS list
  Cc: Trond Myklebust, J. Bruce Fields, Al Viro, Christoph Hellwig,
	Hin-Tak Leung, Andrew Morton

From: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH v4 3/5] hfsplus: add all neccessary declarations for ACLs support

This patch adds declaration of all necessary structures that are necessary for ACLs support, special ACL-related flag for debug output and dprint_hexdump() macro.

Signed-off-by: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
CC: Trond Myklebust <Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
CC: "J. Bruce Fields" <bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
CC: Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
CC: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
CC: Hin-Tak Leung <htl10-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
 fs/hfsplus/hfsplus_fs.h  |    8 ++++++++
 fs/hfsplus/hfsplus_raw.h |   26 ++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index 60b0a33..3b3896a 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -30,6 +30,7 @@
 #define DBG_EXTENT	0x00000020
 #define DBG_BITMAP	0x00000040
 #define DBG_ATTR_MOD	0x00000080
+#define DBG_ACL_MOD	0x00000100
 
 #if 0
 #define DBG_MASK	(DBG_EXTENT|DBG_INODE|DBG_BNODE_MOD)
@@ -50,6 +51,13 @@ do {								\
 		pr_cont(fmt, ##__VA_ARGS__);			\
 } while (0)
 
+#define hfs_dbg_hexdump(flg, prefix, ptr, size)			\
+do {								\
+	if (DBG_##flg & DBG_MASK)				\
+		print_hex_dump_bytes(prefix,			\
+				DUMP_PREFIX_NONE, ptr, size);	\
+} while (0)
+
 /* Runtime config options */
 #define HFSPLUS_DEF_CR_TYPE    0x3F3F3F3F  /* '????' */
 
diff --git a/fs/hfsplus/hfsplus_raw.h b/fs/hfsplus/hfsplus_raw.h
index 452ede0..758b7ad 100644
--- a/fs/hfsplus/hfsplus_raw.h
+++ b/fs/hfsplus/hfsplus_raw.h
@@ -382,6 +382,32 @@ struct hfsplus_attr_inline_data {
 	u8 raw_bytes[HFSPLUS_MAX_INLINE_DATA_SIZE];
 } __packed;
 
+#define HFSPLUS_GUID_SIZE 16 /* 128-bit */
+
+/* Access Control List Entry (ACE) */
+struct hfsplus_acl_entry {
+	u8 ace_applicable[HFSPLUS_GUID_SIZE]; /* Apple-style identifier */
+	__be32 ace_flags;
+	__be32 ace_rights;
+} __packed;
+
+/* Access Control List */
+struct hfsplus_acl_record {
+	__be32 acl_entrycount;
+	__be32 acl_flags;
+	struct hfsplus_acl_entry acl_ace[0];
+} __packed;
+
+#define HFSPLUS_FILESEC_MAGIC 0x012cc16d
+
+/* HFS+ File Security information */
+struct hfsplus_filesec {
+	__be32 fsec_magic;
+	u8 fsec_owner[HFSPLUS_GUID_SIZE];
+	u8 fsec_group[HFSPLUS_GUID_SIZE];
+	struct hfsplus_acl_record fsec_acl;
+} __packed;
+
 /* A data record in the attributes tree */
 typedef union {
 	__be32 record_type;
-- 
1.7.9.5



--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-05-09 16:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 16:38 [PATCH v4 3/5] hfsplus: add all neccessary declarations for ACLs support Vyacheslav Dubeyko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).