From: Coly Li <coly.li@suse.de>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4
Date: Mon, 19 Jan 2009 10:18:11 +0800 [thread overview]
Message-ID: <4973E2E3.2030106@suse.de> (raw)
In-Reply-To: <D9BD94CC-31A4-446D-A331-12CA8A5BD46D@oracle.com>
Sunil Mushran Wrote:
> f_fsid.val[1] look wrong. Just set it to zero.
>
It's OK to set it to zero. But can you please to explain a little bit why f_fsid.val[1] is wrong ?
I tested the code and the f_fsid.val looked well.
Thanks for the review.
> On Jan 16, 2009, at 12:33 AM, Coly Li <coly.li@suse.de> wrote:
>
>> Currently f_fsid of struct kstatfs returned from ocfs2_statfs() is
>> undefined (vfs layer fills 0 as
>> default). Since in some conditions, f_fsid value might be used as
>> (f_fsid, ino) pair to
>> uniquely identify a file, ocfs2 should return a unique defined f_fsid
>> value from ocfs2_statfs().
>>
>> Because uuid_str is identified no mater on big or litlle endian
>> machine, it's also endian consistent
>> to use osb->uuid_str to generate f_fsid value.
>>
>> Signed-off-by: Coly Li <coly.li@suse.de>
>> Cc: Sunil Mushran <sunil.mushran@oracle.com>
>> Cc: Mark Fasheh <mfasheh@suse.com>
>> ---
>> fs/ocfs2/super.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
>> index 43ed113..c953933 100644
>> --- a/fs/ocfs2/super.c
>> +++ b/fs/ocfs2/super.c
>> @@ -1425,6 +1425,10 @@ static int ocfs2_statfs(struct dentry *dentry,
>> struct kstatfs *buf)
>> buf->f_bavail = buf->f_bfree;
>> buf->f_files = numbits;
>> buf->f_ffree = freebits;
>> + buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
>> + & 0xFFFFFFFFUL;
>> + buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
>> + OCFS2_VOL_UUID_LEN) & 0xFFFFFFFFUL;
>>
>> brelse(bh);
>>
>> --
>> Coly Li
>> SuSE Labs
>>
>>
>>
--
Coly Li
SuSE Labs
next prev parent reply other threads:[~2009-01-19 2:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 8:33 [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4 Coly Li
2009-01-18 15:23 ` Sunil Mushran
2009-01-19 2:18 ` Coly Li [this message]
2009-01-19 4:57 ` Sunil Mushran
2009-01-19 5:48 ` Coly Li
2009-10-29 22:19 ` Joel Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4973E2E3.2030106@suse.de \
--to=coly.li@suse.de \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.