All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 3/3] ocfs2/xattr: Proper hash collision handle in bucket division.v2
Date: Fri, 24 Oct 2008 14:15:35 +0800	[thread overview]
Message-ID: <49016807.9000901@oracle.com> (raw)
In-Reply-To: <20081024060238.GB31082@ca-server1.us.oracle.com>



Joel Becker wrote:
> On Fri, Oct 24, 2008 at 09:28:00AM +0800, Tao Ma wrote:
>> Joel Becker wrote:
>>> 	Are you saying that you usually have only one xattr per bucket,
>>> even with many xattrs?  Because if we have n xattrs per bucket, your
>>> function will walk down from middle to 0 (half the bucket) unless n is
>>> 1.
>> No. See ocfs2_xattr_find_divide_pos.
> 
> 	I realized on the drive home that, if the common case is no
> duplicate hash values, the first loop triggers on its first step.  I
> think that's what you are saying.
> 	But boy, it's not obvious that's what it is doing.  And then you
> have that weird (middle == count - 1) check that makes no sense.  And
> then you go the other way.  I'd love to find a set of comments and code
> that makes it more understandable.
> 
>>> 	Your function would be much more understandable even if it just
>>> used my xe_cmp() function.  Then some comment about what you are trying
>>> to achieve (I guessed at that), and perhaps a mention of the common
>>> case.
>> OK, I will add some comments for it. As for xe_cmp, can I use "cmp_xe" 
>> which already exists in xattr.c?
> 
> 	I have an idea to do what you're doing, but cleaner.  I'll look
> at cmp_xe and try again in the morning.
cool, so waiting for your perfect code. ;)

Regards,
Tao

  reply	other threads:[~2008-10-24  6:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17  4:40 [Ocfs2-devel] [PATCH 0/3] ocfs2/xattr: xattr improvement Tao Ma
2008-10-17  4:44 ` [Ocfs2-devel] [PATCH 1/3] ocfs2/xattr: Remove unused restore_extent_block Tao Ma
2008-10-17  4:44 ` [Ocfs2-devel] [PATCH 2/3] ocfs2/xattr: Merge xattr set transaction Tao Ma
2008-10-23 21:40   ` Joel Becker
2008-10-24  0:44     ` Tao Ma
2008-10-24  1:09       ` Joel Becker
2008-10-24  1:17         ` Tao Ma
2008-10-24  5:59           ` Joel Becker
2008-10-17  4:44 ` [Ocfs2-devel] [PATCH 3/3] ocfs2/xattr: Proper hash collision handle in bucket division Tao Ma
2008-10-17  0:54   ` [Ocfs2-devel] [PATCH 3/3] ocfs2/xattr: Proper hash collision handle in bucket division.v2 Tao Ma
2008-10-23 23:20     ` Joel Becker
2008-10-24  0:52       ` Tao Ma
2008-10-24  1:14         ` Joel Becker
2008-10-24  1:28           ` Tao Ma
2008-10-24  6:02             ` Joel Becker
2008-10-24  6:15               ` Tao Ma [this message]
2008-10-24  7:43                 ` Joel Becker
2008-10-24  8:47                   ` Joel Becker
2008-10-24  9:02                     ` Tao Ma
2008-10-24  9:15                       ` Joel Becker
2008-10-24  9:29                         ` Tao Ma

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=49016807.9000901@oracle.com \
    --to=tao.ma@oracle.com \
    --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.