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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Done.

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.

Barry.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux