public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Barry Naujok <bnaujok@sgi.com>
Cc: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 3/7] XFS: Refactor node format directory lookup/addname
Date: Thu, 3 Apr 2008 14:33:29 +1000	[thread overview]
Message-ID: <20080403043329.GQ103491721@sgi.com> (raw)
In-Reply-To: <20080402062708.380299192@chook.melbourne.sgi.com>

On Wed, Apr 02, 2008 at 04:25:11PM +1000, Barry Naujok wrote:
> The next step for case-insensitive support is to avoid polution of
> the dentry cache with entries pointing to the same inode, but with
> names that only differ in case.
> 
> To perform this, we will need to pass the actual filename that
> matched backup to the XFS/VFS interface and make sure the dentry
> cache only contains entries with the actual case-sensitive name.
> 
> But, before we can do this, it was found that the directory lookup
> code with multiple leaves was shared with code adding a name to
> that directory. Most of xfs_dir2_leafn_lookup_int() could be broken
> into two functions determined by if (args->addname) { } else { }.
> 
> For the following patch, only the lookup case needs to handle the
> various xfs_nameops, with case-insensitive match handling in
> addition to returning the actual name.
> 
> So, this patch separates xfs_dir2_leafn_lookup_int() into
> xfs_dir2_leafn_lookup_for_addname() and xfs_dir2_leafn_lookup_for_entry().
> 
> xfs_dir2_leafn_lookup_for_addname() iterates through the data blocks looking
> for a suitable empty space to insert the name while
> xfs_dir2_leafn_lookup_for_entry() uses the xfs_nameops to find the entry.
> 
> xfs_dir2_leafn_lookup_for_entry() path also retains the data block where
> the first case-insensitive match occured as in the next patch which will
> return the name, the name is obtained from that block.
> 
> Signed-off-by: Barry Naujok <bnaujok@sgi.com>
> 
> ---
>  fs/xfs/xfs_dir2_node.c |  373 +++++++++++++++++++++++++++++--------------------
>  1 file changed, 225 insertions(+), 148 deletions(-)
> 
> Index: kern_ci/fs/xfs/xfs_dir2_node.c
> ===================================================================
> --- kern_ci.orig/fs/xfs/xfs_dir2_node.c
> +++ kern_ci/fs/xfs/xfs_dir2_node.c
> @@ -387,12 +387,11 @@ xfs_dir2_leafn_lasthash(
>  }
>  
>  /*
> - * Look up a leaf entry in a node-format leaf block.
> - * If this is an addname then the extrablk in state is a freespace block,
> - * otherwise it's a data block.
> + * Look up a leaf entry for space to add a name in a node-format leaf block.
> + * The extrablk in state is a freespace block.
>   */
> -int
> -xfs_dir2_leafn_lookup_int(
> +static int

STATIC

(and for the other new function)

> +xfs_dir2_leafn_lookup_for_addname(
>  	xfs_dabuf_t		*bp,		/* leaf buffer */
>  	xfs_da_args_t		*args,		/* operation arguments */
>  	int			*indexp,	/* out: leaf entry index */
....

> @@ -1785,6 +1857,11 @@ xfs_dir2_node_lookup(
>  	if (error)
>  		rval = error;
>  	/*
> +	 * If case-insensitive match was found in a leaf, return EEXIST.
> +	 */
> +	else if (rval == ENOENT && args->cmpresult == XFS_CMP_CASE)
> +		rval = EEXIST;

Can you put the comment inside the if branch?

	if (error) {
		rval = error;
	} else if (rval == ENOENT && args->cmpresult == XFS_CMP_CASE) {
		/* found a case-insensitive match in a leaf */
		rval = EEXIST;
	}

I think Josef got the others...

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  parent reply	other threads:[~2008-04-03  4:33 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02  6:25 [PATCH 0/7] XFS: case-insensitive lookup and Unicode support Barry Naujok
2008-04-02  6:25 ` [PATCH 1/7] XFS: Name operation vector for hash and compare Barry Naujok
2008-04-03  0:22   ` Josef 'Jeff' Sipek
2008-04-03  4:50     ` Barry Naujok
2008-04-03  1:29   ` David Chinner
2008-04-03  1:45     ` Barry Naujok
2008-04-03 22:51     ` Christoph Hellwig
2008-04-02  6:25 ` [PATCH 2/7] XFS: ASCII case-insensitive support Barry Naujok
2008-04-03  0:35   ` Josef 'Jeff' Sipek
2008-04-03  1:53   ` David Chinner
2008-04-03 17:09     ` Christoph Hellwig
2008-04-03 22:55   ` Christoph Hellwig
2008-04-03 23:01     ` Nathan Scott
2008-04-02  6:25 ` [PATCH 3/7] XFS: Refactor node format directory lookup/addname Barry Naujok
2008-04-03  1:51   ` Josef 'Jeff' Sipek
2008-04-03  4:04     ` Barry Naujok
2008-04-03  4:10       ` Barry Naujok
2008-04-03  4:33   ` David Chinner [this message]
2008-04-02  6:25 ` [PATCH 4/7] XFS: Return case-insensitive match for dentry cache Barry Naujok
2008-04-03  2:34   ` Josef 'Jeff' Sipek
2008-04-03  5:22   ` David Chinner
2008-04-03  5:41     ` Stephen Rothwell
2008-04-03 14:56       ` Christoph Hellwig
2008-04-03 23:06   ` Christoph Hellwig
2008-04-02  6:25 ` [PATCH 5/7] XFS: Unicode case-insensitive lookup implementation Barry Naujok
2008-04-03 17:14   ` Christoph Hellwig
2008-04-03 17:24     ` Jeremy Allison
2008-04-03 18:09       ` Josef 'Jeff' Sipek
2008-04-03 18:11       ` Eric Sandeen
2008-04-03 18:22         ` Jeremy Allison
2008-04-04  0:00         ` Mark Goodwin
2008-04-03 18:43       ` Christoph Hellwig
2008-04-03 18:47         ` Jeremy Allison
2008-04-03 18:55           ` Christoph Hellwig
2008-04-03 18:57             ` Christoph Hellwig
     [not found]     ` <20080403222059.GU103491721@sgi.com>
2008-04-03 23:00       ` Jamie Lokier
     [not found]   ` <20080403083151.GS103491721@sgi.com>
2008-04-17  5:38     ` Barry Naujok
2008-04-17  8:49       ` David Chinner
2008-04-02  6:25 ` [PATCH 6/7] XFS: Native Language Support for Unicode in XFS Barry Naujok
2008-04-04  0:05   ` David Chinner
2008-04-02  6:25 ` [PATCH 7/7] XFS: NLS config option Barry Naujok
2008-04-03  1:26   ` Josef 'Jeff' Sipek
2008-04-03  1:38     ` Barry Naujok
2008-04-08 11:45 ` [PATCH 0/7] XFS: case-insensitive lookup and Unicode support Christoph Hellwig
2008-04-09  1:53   ` Barry Naujok

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=20080403043329.GQ103491721@sgi.com \
    --to=dgc@sgi.com \
    --cc=bnaujok@sgi.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox