[Top] [All Lists]

Re: [PATCH 3/4] XFS: Return case-insensitive match for dentry cache

To: "Christoph Hellwig" <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 3/4] XFS: Return case-insensitive match for dentry cache
From: "Barry Naujok" <bnaujok@xxxxxxx>
Date: Wed, 14 May 2008 16:15:01 +1000
Cc: xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx
In-reply-to: <20080513085724.GC21919@infradead.org>
Organization: SGI
References: <20080513075749.477238845@chook.melbourne.sgi.com> <20080513080152.911303131@chook.melbourne.sgi.com> <20080513085724.GC21919@infradead.org>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Opera Mail/9.24 (Win32)
On Tue, 13 May 2008 18:57:24 +1000, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

On Tue, May 13, 2008 at 05:57:52PM +1000, Barry Naujok wrote:

+       if (ci_sfep)
+               return XFS_ERROR(xfs_dir_cilookup_result(args,
+                                       ci_sfep->name, ci_sfep->namelen));

Putting a function call inside XFS_ERROR is quite unreadable. Should be easy to fix as there's already an error variable in scope.

Done (even though there was no "error" variable in this function).

@@ -1646,15 +1653,18 @@ xfs_lookup(
                return XFS_ERROR(EIO);

        lock_mode = xfs_ilock_map_shared(dp);
-       error = xfs_dir_lookup(NULL, dp, name, &inum);
+       error = xfs_dir_lookup(NULL, dp, name, &inum, ci_match);
        xfs_iunlock_map_shared(dp, lock_mode);

        if (error)
                goto out;

        error = xfs_iget(dp->i_mount, NULL, inum, 0, 0, ipp, 0);
-       if (error)
+       if (error) {
+               if (ci_match && *ci_match)
+                       kmem_free(name->name, name->len);
                goto out;

normal style would be to add a out_free_name label for this one to move the error handling code into one place at the end of the function.


I've also changed "int *ci_match" to "struct xfs_name *ci_name" to make
it's use clearer and not overload the use of the "name" parameter.


<Prev in Thread] Current Thread [Next in Thread>