xfs
[Top] [All Lists]

Re: [PATCH 10/55] libxfs: sync dir2 kernel differences

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 10/55] libxfs: sync dir2 kernel differences
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 17 Sep 2013 10:14:10 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1378332359-14737-11-git-send-email-david@xxxxxxxxxxxxx>
References: <1378332359-14737-1-git-send-email-david@xxxxxxxxxxxxx> <1378332359-14737-11-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
On 9/4/13 5:05 PM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---
>  libxfs/xfs_dir2.c      | 45 +++++++++++++++++++++++++++++++++++++++++++++
>  libxfs/xfs_dir2_data.c | 20 ++++++++++----------
>  libxfs/xfs_dir2_leaf.c |  4 ++--
>  libxfs/xfs_dir2_node.c | 26 ++++++++++++--------------
>  4 files changed, 69 insertions(+), 26 deletions(-)
> 
> diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c
> index 6a4027f..830fe3e 100644
> --- a/libxfs/xfs_dir2.c
> +++ b/libxfs/xfs_dir2.c
> @@ -392,6 +392,51 @@ xfs_dir_replace(
>  }
>  
>  /*
> + * See if this entry can be added to the directory without allocating space.
> + * First checks that the caller couldn't reserve enough space (resblks = 0).
> + */
> +int
> +xfs_dir_canenter(

Retroactive, post-merge question.  :)  This function isn't used in userspace,
AFAICT.  What's the intended libxfs philosophy - keep files as identical to
kernelspace as possible, used code or not, or remove things which aren't used
in userspace?

Thanks,
-Eric

> +     xfs_trans_t     *tp,
> +     xfs_inode_t     *dp,
> +     struct xfs_name *name,          /* name of entry to add */
> +     uint            resblks)
> +{
> +     xfs_da_args_t   args;
> +     int             rval;
> +     int             v;              /* type-checking value */
> +
> +     if (resblks)
> +             return 0;
> +
> +     ASSERT(S_ISDIR(dp->i_d.di_mode));
> +
> +     memset(&args, 0, sizeof(xfs_da_args_t));
> +     args.name = name->name;
> +     args.namelen = name->len;
> +     args.hashval = dp->i_mount->m_dirnameops->hashname(name);
> +     args.dp = dp;
> +     args.whichfork = XFS_DATA_FORK;
> +     args.trans = tp;
> +     args.op_flags = XFS_DA_OP_JUSTCHECK | XFS_DA_OP_ADDNAME |
> +                                                     XFS_DA_OP_OKNOENT;
> +
> +     if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
> +             rval = xfs_dir2_sf_addname(&args);
> +     else if ((rval = xfs_dir2_isblock(tp, dp, &v)))
> +             return rval;
> +     else if (v)
> +             rval = xfs_dir2_block_addname(&args);
> +     else if ((rval = xfs_dir2_isleaf(tp, dp, &v)))
> +             return rval;
> +     else if (v)
> +             rval = xfs_dir2_leaf_addname(&args);
> +     else
> +             rval = xfs_dir2_node_addname(&args);
> +     return rval;
> +}

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