From: Andreas Rohner Subject: [PATCH v2 1/9] nilfs2: copy file system feature flags to the nilfs object Date: Sun, 3 May 2015 12:05:14 +0200 Message-ID: <1430647522-14304-2-git-send-email-andreas.rohner@gmx.net> References: <1430647522-14304-1-git-send-email-andreas.rohner@gmx.net> Return-path: In-Reply-To: <1430647522-14304-1-git-send-email-andreas.rohner-hi6Y0CQ0nG0@public.gmane.org> Sender: linux-nilfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org This patch adds three new attributes to the nilfs object, which contain a copy of the feature flags from the super block. This can be used, to efficiently test whether file system feature flags are set or not. Signed-off-by: Andreas Rohner --- fs/nilfs2/the_nilfs.c | 4 ++++ fs/nilfs2/the_nilfs.h | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 69bd801..606fdfc 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c @@ -630,6 +630,10 @@ int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data) get_random_bytes(&nilfs->ns_next_generation, sizeof(nilfs->ns_next_generation)); + nilfs->ns_feature_compat = le64_to_cpu(sbp->s_feature_compat); + nilfs->ns_feature_compat_ro = le64_to_cpu(sbp->s_feature_compat_ro); + nilfs->ns_feature_incompat = le64_to_cpu(sbp->s_feature_incompat); + err = nilfs_store_disk_layout(nilfs, sbp); if (err) goto failed_sbh; diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h index 23778d3..12cd91d 100644 --- a/fs/nilfs2/the_nilfs.h +++ b/fs/nilfs2/the_nilfs.h @@ -101,6 +101,9 @@ enum { * @ns_dev_kobj: /sys/fs// * @ns_dev_kobj_unregister: completion state * @ns_dev_subgroups: subgroups pointer + * @ns_feature_compat: Compatible feature set + * @ns_feature_compat_ro: Read-only compatible feature set + * @ns_feature_incompat: Incompatible feature set */ struct the_nilfs { unsigned long ns_flags; @@ -201,6 +204,11 @@ struct the_nilfs { struct kobject ns_dev_kobj; struct completion ns_dev_kobj_unregister; struct nilfs_sysfs_dev_subgroups *ns_dev_subgroups; + + /* Features */ + __u64 ns_feature_compat; + __u64 ns_feature_compat_ro; + __u64 ns_feature_incompat; }; #define THE_NILFS_FNS(bit, name) \ -- 2.3.7 -- To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html