[Ocfs2-tools-devel] [PATCH 7/7] Ocfs2-tools: Add new ioctl prototype and corresponding structures to ocfs2_fs.h

Tristan Ye tristan.ye at oracle.com
Fri Nov 27 00:53:32 PST 2009


Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 include/ocfs2-kernel/ocfs2_fs.h |   70 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/include/ocfs2-kernel/ocfs2_fs.h b/include/ocfs2-kernel/ocfs2_fs.h
index 1650315..14c2d81 100644
--- a/include/ocfs2-kernel/ocfs2_fs.h
+++ b/include/ocfs2-kernel/ocfs2_fs.h
@@ -289,6 +289,76 @@ struct ocfs2_new_group_input {
 #define OCFS2_IOC_GROUP_ADD	_IOW('o', 2,struct ocfs2_new_group_input)
 #define OCFS2_IOC_GROUP_ADD64	_IOW('o', 3,struct ocfs2_new_group_input)
 
+#define OCFS2_UUID_LEN              16
+#define OCFS2_MAX_LABEL_LEN         64
+
+/*
+ * Used to query fs information for none-privileged 
+ * users by using OCFS2_IOC_INFO ioctols, a series of
+ * following requests need to be NULL-terminated.
+ *
+ * Always try to separate info request into small pieces to
+ * guarantee the backward&forward compatibility.
+ */
+struct ocfs2_info_request {
+	__u32 ir_code;  /* Info request code */
+	__u32 ir_flags; /* Request flags */
+};
+
+struct ocfs2_info_request_clustersize {
+	struct ocfs2_info_request ir_request;
+	__u32 ir_clustersize;
+};
+
+struct ocfs2_info_request_blocksize {
+	struct ocfs2_info_request ir_request;
+	__u32 ir_blocksize;
+};
+
+struct ocfs2_info_request_slotnum {
+	struct ocfs2_info_request ir_request;
+	__u16 ir_slotnum;
+};
+
+struct ocfs2_info_request_label {
+	struct ocfs2_info_request ir_request;
+	__u8    ir_label[OCFS2_MAX_LABEL_LEN];
+};
+
+struct ocfs2_info_request_uuid {
+	struct ocfs2_info_request ir_request;
+	__u8    ir_uuid[OCFS2_UUID_LEN];
+};
+
+struct ocfs2_info_request_fs_features {
+	struct ocfs2_info_request ir_quest;
+	__u32 ir_compat_features;
+	__u32 ir_incompat_features;
+	__u32 ir_ro_compat_features;
+};
+
+/* Codes for cfs2_info_request */
+
+#define OCFS2_INFO_CLUSTERSIZE  0x00000001
+#define OCFS2_INFO_BLOCKSIZE    0x00000002
+#define OCFS2_INFO_SLOTNUM      0x00000004
+#define OCFS2_INFO_LABEL        0x00000008
+#define OCFS2_INFO_UUID         0x00000010
+#define OCFS2_INFO_FS_FEATURES  0x00000020
+
+/* Flags for struct ocfs2_info_request */
+/* Filled by the caller */
+#define OCFS2_INFO_FL_NON_COHERENT  0x00000001  /* Cluster coherency not required.
+						   This is a hint.  It is up to
+						   ocfs2 whether the request can
+						   be fulfilled without locking. */
+/* Filled by ocfs2 */
+#define OCFS2_INFO_FL_FILLED        0x80000000  /* Filesystem understood this
+						   request and filled in the
+						   answer */
+
+#define OCFS2_IOC_INFO          _IOR('o', 5, struct ocfs2_info_request)
+
 /*
  * Journal Flags (ocfs2_dinode.id1.journal1.i_flags)
  */
-- 
1.5.5




More information about the Ocfs2-tools-devel mailing list