Skip to contentSkip to conversation

nilfs2: move definition of struct nilfs_btree_node

PATCH Superseded Jiro SEKIBA 2 participants 3 messages Nov 8, 2009 2 messages not in the archive NILFS2 filesystem

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nilfs2: move definition of struct nilfs_btree_node

Hi,

This is a trivial patch to expose struct nilfs_fs_btree_node. The struct sould be exposed outside of kernel, for it is disk format.

---
 fs/nilfs2/btree.h         |   22 ----------------------
 include/linux/nilfs2_fs.h |   23 +++++++++++++++++++++++
 2 files changed, 23 insertions(+), 22 deletions(-)
fs/nilfs2/btree.h +0 -22
index 0e72bbb..4b82d84 100644
@@ -34,28 +34,6 @@ struct nilfs_btree;
 struct nilfs_btree_path;
 
 /**
- * struct nilfs_btree_node - B-tree node
- * @bn_flags: flags
- * @bn_level: level
- * @bn_nchildren: number of children
- * @bn_pad: padding
- */
-struct nilfs_btree_node {
-	__u8 bn_flags;
-	__u8 bn_level;
-	__le16 bn_nchildren;
-	__le32 bn_pad;
-};
-
-/* flags */
-#define NILFS_BTREE_NODE_ROOT	0x01
-
-/* level */
-#define NILFS_BTREE_LEVEL_DATA		0
-#define NILFS_BTREE_LEVEL_NODE_MIN	(NILFS_BTREE_LEVEL_DATA + 1)
-#define NILFS_BTREE_LEVEL_MAX		14
-
-/**
  * struct nilfs_btree - B-tree structure
  * @bt_bmap: bmap base structure
  */
include/linux/nilfs2_fs.h +23 -0
index 79fec6a..5e326de 100644
@@ -773,6 +773,29 @@ struct nilfs_bdesc {
 	__u32 bd_pad;
 };
 
+/**
+ * struct nilfs_btree_node - B-tree node
+ * @bn_flags: flags
+ * @bn_level: level
+ * @bn_nchildren: number of children
+ * @bn_pad: padding
+ */
+struct nilfs_btree_node {
+	__u8 bn_flags;
+	__u8 bn_level;
+	__le16 bn_nchildren;
+	__le32 bn_pad;
+};
+
+/* flags */
+#define NILFS_BTREE_NODE_ROOT   0x01
+
+/* level */
+#define NILFS_BTREE_LEVEL_DATA          0
+#define NILFS_BTREE_LEVEL_NODE_MIN      (NILFS_BTREE_LEVEL_DATA + 1)
+#define NILFS_BTREE_LEVEL_MAX           14
+
+
 #define NILFS_IOCTL_IDENT		'n'
 
 #define NILFS_IOCTL_CHANGE_CPMODE  \
Signature · 1 line
1.5.6.5

A message that is not in the archive (sent off-list or not yet received): 87zl6xv194.wl%[email protected]

#2 lore raw

Hi,
2009/11/8 Jiro SEKIBA <[email protected]>:

Quoted 6 lines

Hi,

This is a trivial patch to expose struct nilfs_fs_btree_node. The struct sould be exposed outside of kernel, for it is disk format.

Thank you for this patch.

Quoted 73 lines

---
 fs/nilfs2/btree.h         |   22 ---------------------- include/linux/nilfs2_fs.h |   23 +++++++++++++++++++++++

 2 files changed, 23 insertions(+), 22 deletions(-)
fs/nilfs2/btree.h +0 -22
index 0e72bbb..4b82d84 100644
@@ -34,28 +34,6 @@ struct nilfs_btree;
  struct nilfs_btree_path;
 
  /**
- * struct nilfs_btree_node - B-tree node
- * @bn_flags: flags
- * @bn_level: level
- * @bn_nchildren: number of children
- * @bn_pad: padding
- */
-struct nilfs_btree_node {
-       __u8 bn_flags;
-       __u8 bn_level;
-       __le16 bn_nchildren;
-       __le32 bn_pad;
-};
-
-/* flags */
-#define NILFS_BTREE_NODE_ROOT  0x01
-
-/* level */
-#define NILFS_BTREE_LEVEL_DATA         0
-#define NILFS_BTREE_LEVEL_NODE_MIN     (NILFS_BTREE_LEVEL_DATA + 1)
-#define NILFS_BTREE_LEVEL_MAX          14
-
-/**
  * struct nilfs_btree - B-tree structure
  * @bt_bmap: bmap base structure
  */
include/linux/nilfs2_fs.h +23 -1
index 79fec6a..5e326de 100644
@@ -773,6 +773,29 @@ struct nilfs_bdesc {
        __u32 bd_pad;
  };
 
+/**
+ * struct nilfs_btree_node - B-tree node
+ * @bn_flags: flags
+ * @bn_level: level
+ * @bn_nchildren: number of children
+ * @bn_pad: padding
+ */
+struct nilfs_btree_node {
+       __u8 bn_flags;
+       __u8 bn_level;
+       __le16 bn_nchildren;
+       __le32 bn_pad;
+};
+
+/* flags */
+#define NILFS_BTREE_NODE_ROOT   0x01
+
+/* level */
+#define NILFS_BTREE_LEVEL_DATA          0
+#define NILFS_BTREE_LEVEL_NODE_MIN      (NILFS_BTREE_LEVEL_DATA + 1)
+#define NILFS_BTREE_LEVEL_MAX           14
+
+
  #define NILFS_IOCTL_IDENT              'n'
 
  #define NILFS_IOCTL_CHANGE_CPMODE  \
--
Quoted 1 line

1.5.6.5

Seems that the nilfs_btree_node struct was moved into the middle of ioctl related declarations.

I think it should come before the definition of nilfs_palloc_group_desc struct or so.

Thanks,
Ryusuke Konishi

A message that is not in the archive (sent off-list or not yet received): c4a7c9420911080226q57dcd7aexdde32dd55d108b1a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

Hi,

At Sun, 8 Nov 2009 19:26:16 +0900,

Quoted 90 lines · Ryusuke Konishi

Hi,
2009/11/8 Jiro SEKIBA <[email protected]>:

Quoted 6 lines

Hi,

This is a trivial patch to expose struct nilfs_fs_btree_node. The struct sould be exposed outside of kernel, for it is disk format.

Thank you for this patch.

Quoted 73 lines

---
 fs/nilfs2/btree.h         |   22 ---------------------- include/linux/nilfs2_fs.h |   23 +++++++++++++++++++++++

 2 files changed, 23 insertions(+), 22 deletions(-)
fs/nilfs2/btree.h +0 -22
index 0e72bbb..4b82d84 100644
@@ -34,28 +34,6 @@ struct nilfs_btree;
  struct nilfs_btree_path;
 
  /**
- * struct nilfs_btree_node - B-tree node
- * @bn_flags: flags
- * @bn_level: level
- * @bn_nchildren: number of children
- * @bn_pad: padding
- */
-struct nilfs_btree_node {
-       __u8 bn_flags;
-       __u8 bn_level;
-       __le16 bn_nchildren;
-       __le32 bn_pad;
-};
-
-/* flags */
-#define NILFS_BTREE_NODE_ROOT  0x01
-
-/* level */
-#define NILFS_BTREE_LEVEL_DATA         0
-#define NILFS_BTREE_LEVEL_NODE_MIN     (NILFS_BTREE_LEVEL_DATA + 1)
-#define NILFS_BTREE_LEVEL_MAX          14
-
-/**
  * struct nilfs_btree - B-tree structure
  * @bt_bmap: bmap base structure
  */
include/linux/nilfs2_fs.h +23 -1
index 79fec6a..5e326de 100644
@@ -773,6 +773,29 @@ struct nilfs_bdesc {
        __u32 bd_pad;
  };
 
+/**
+ * struct nilfs_btree_node - B-tree node
+ * @bn_flags: flags
+ * @bn_level: level
+ * @bn_nchildren: number of children
+ * @bn_pad: padding
+ */
+struct nilfs_btree_node {
+       __u8 bn_flags;
+       __u8 bn_level;
+       __le16 bn_nchildren;
+       __le32 bn_pad;
+};
+
+/* flags */
+#define NILFS_BTREE_NODE_ROOT   0x01
+
+/* level */
+#define NILFS_BTREE_LEVEL_DATA          0
+#define NILFS_BTREE_LEVEL_NODE_MIN      (NILFS_BTREE_LEVEL_DATA + 1)
+#define NILFS_BTREE_LEVEL_MAX           14
+
+
  #define NILFS_IOCTL_IDENT              'n'
 
  #define NILFS_IOCTL_CHANGE_CPMODE  \
--
Quoted 1 line

1.5.6.5

Seems that the nilfs_btree_node struct was moved into the middle of ioctl related declarations.

Quoted 2 lines

I think it should come before the definition of nilfs_palloc_group_desc struct or so.

Grr, I'll revise and resend the patch.

Thank you for the review.

Quoted 9 lines

Thanks,
Ryusuke Konishi
_______________________________________________
users mailing list
[email protected]
https://www.nilfs.org/mailman/listinfo/users

Signature · 1 line
Jiro SEKIBA <[email protected]>