From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Subject: [PATCH -V8 6/9] ext4: Add get_fsid callback Date: Mon, 17 May 2010 11:03:49 +0530 Message-ID: <1274074432-29695-7-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1274074432-29695-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Cc: linux-fsdevel@vger.kernel.org, sfrench@us.ibm.com, philippe.deniel@CEA.FR, linux-kernel@vger.kernel.org, "Aneesh Kumar K.V" To: hch@infradead.org, viro@zeniv.linux.org.uk, adilger@sun.com, corbet@lwn.net, serue@us.ibm.com, neilb@suse.de Return-path: Received: from e28smtp05.in.ibm.com ([122.248.162.5]:46259 "EHLO e28smtp05.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753539Ab0EQFeL (ORCPT ); Mon, 17 May 2010 01:34:11 -0400 In-Reply-To: <1274074432-29695-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Acked-by: Serge Hallyn Signed-off-by: Aneesh Kumar K.V --- fs/ext4/super.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e14d22c..fc7d464 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1049,6 +1049,19 @@ static int bdev_try_to_free_page(struct super_block *sb, struct page *page, return try_to_free_buffers(page); } +static int ext4_get_fsid(struct super_block *sb, struct uuid *fsid) +{ + struct ext4_sb_info *sbi = EXT4_SB(sb); + struct ext4_super_block *es = sbi->s_es; + + memcpy(fsid->uuid, es->s_uuid, sizeof(fsid->uuid)); + /* + * We may want to make sure we return error if the s_uuid is not + * exactly unique + */ + return 0; +} + #ifdef CONFIG_QUOTA #define QTYPE2NAME(t) ((t) == USRQUOTA ? "user" : "group") #define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) @@ -1109,6 +1122,7 @@ static const struct super_operations ext4_sops = { .quota_write = ext4_quota_write, #endif .bdev_try_to_free_page = bdev_try_to_free_page, + .get_fsid = ext4_get_fsid, }; static const struct super_operations ext4_nojournal_sops = { @@ -1128,6 +1142,7 @@ static const struct super_operations ext4_nojournal_sops = { .quota_write = ext4_quota_write, #endif .bdev_try_to_free_page = bdev_try_to_free_page, + .get_fsid = ext4_get_fsid, }; static const struct export_operations ext4_export_ops = { -- 1.7.1.78.g212f0