xfs
[Top] [All Lists]

Re: [PATCH 2/4] xfs: combine xfs_dir_canenter into xfs_dir_createname

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH 2/4] xfs: combine xfs_dir_canenter into xfs_dir_createname
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 28 Aug 2014 18:00:56 -0700
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <53F695C3.1020607@xxxxxxxxxxx>
References: <53F6942B.80808@xxxxxxxxxx> <53F695C3.1020607@xxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Thu, Aug 21, 2014 at 07:58:43PM -0500, Eric Sandeen wrote:
> xfs_dir_canenter and xfs_dir_createname are
> almost identical.
> 
> Fold the former into the latter, with a helpful
> wrapper for the former.  If createname is called without
> an inode number, it now only checks for space, and does
> not actually add the entry.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

The code changes looks good to me, but..

>  /*
> -  Enter a name in a directory.
> + * Enter a name in a directory.
> + * If inum is 0, only test for available space.
>   */
>  int
>  xfs_dir_createname(

Given how confusing the xfs_dir_createname function name is now this
probably needs a more detailed description mentioning the checking as
first class behavior.

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