public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Adrian Hunter <ext-adrian.hunter@nokia.com>
Subject: Re: [PATCH] UBIFS: fill f_fsid
Date: Wed, 03 Sep 2008 12:44:33 +0300	[thread overview]
Message-ID: <1220435073.4036.41.camel@sauron> (raw)
In-Reply-To: <1220262187.2982.58.camel@pmac.infradead.org>

On Mon, 2008-09-01 at 10:43 +0100, David Woodhouse wrote:
> For btrfs I xor the first 64 bits with the second 64 bits, and put
> _that_ into f_fsid. You're just putting the first 64 bits in and
> ignoring the second 64 bits. Neither is really _better_ than the other;
> you just alter the circumstances in which you get collisions. But I
> suppose we might as well be consistent about how we do it?
Like this?

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Date: Wed, 3 Sep 2008 14:16:42 +0300
Subject: [PATCH] UBIFS: amend f_fsid

David Woodhouse suggested to be consistent with other FSes
and xor the beginning and the end of the UUID.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 fs/ubifs/super.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index ab9b5cb..83fe0a5 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -370,6 +370,7 @@ static int ubifs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
 	struct ubifs_info *c = dentry->d_sb->s_fs_info;
 	unsigned long long free;
+	__le32 *uuid = (__le32 *)c->uuid;
 
 	free = ubifs_get_free_space(c);
 	dbg_gen("free space %lld bytes (%lld blocks)",
@@ -386,8 +387,8 @@ static int ubifs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	buf->f_files = 0;
 	buf->f_ffree = 0;
 	buf->f_namelen = UBIFS_MAX_NLEN;
-	memcpy(&buf->f_fsid, c->uuid, sizeof(__kernel_fsid_t));
-
+	buf->f_fsid.val[0] = le32_to_cpu(uuid[0]) ^ le32_to_cpu(uuid[2]);
+	buf->f_fsid.val[1] = le32_to_cpu(uuid[1]) ^ le32_to_cpu(uuid[3]);
 	return 0;
 }
 
-- 
1.5.4.1



  parent reply	other threads:[~2008-09-03  9:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-31 14:52 UBIFS updates for 2.6.27 Artem Bityutskiy
2008-08-31 14:32 ` Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: fix zero-length truncations Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: always read hashed-key nodes under TNC mutex Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: allow for racing between GC and TNC Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: do not update min_idx_lebs in stafs Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: push empty flash hack down Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: remove incorrect index space check Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: improve statfs reporting Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: fix assertion Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: add forgotten gc_idx_lebs component Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: introduce LEB overhead Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: improve statfs reporting even more Artem Bityutskiy
2008-08-31 14:52 ` [PATCH] UBIFS: fill f_fsid Artem Bityutskiy
2008-09-01  9:43   ` David Woodhouse
2008-09-01 11:16     ` Artem Bityutskiy
2008-09-01 11:28       ` David Woodhouse
2008-09-01 11:43         ` Artem Bityutskiy
2008-09-01 11:50           ` David Woodhouse
2008-09-01 11:56             ` Artem Bityutskiy
2008-09-01 15:01     ` Christoph Hellwig
2008-09-02  7:03       ` Artem Bityutskiy
2008-09-02 17:09         ` Andreas Dilger
2008-09-02 17:29           ` David Woodhouse
2008-09-02 19:13             ` Andreas Dilger
2008-09-02 19:32               ` David Woodhouse
2008-09-02 21:02           ` Christoph Hellwig
2008-09-02 21:26             ` David Woodhouse
2008-09-02 21:48               ` Christoph Hellwig
2008-09-02 22:12                 ` David Woodhouse
2008-09-03  6:20               ` Artem Bityutskiy
2008-09-02 22:32             ` David Woodhouse
2008-09-03  9:44     ` Artem Bityutskiy [this message]
2008-09-03 10:14       ` David Woodhouse

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=1220435073.4036.41.camel@sauron \
    --to=dedekind@infradead.org \
    --cc=dwmw2@infradead.org \
    --cc=ext-adrian.hunter@nokia.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox