diff options
author | Christoph Hellwig <hch@lst.de> | 2014-05-13 10:40:19 +0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-05-13 10:40:19 +0400 |
commit | 6c888af0b4ca66565b2aa73147ebc1d139c3bd1b (patch) | |
tree | e0ecaf22b4e8858d0b7b207b30de0cdaa940e119 /fs/xfs/xfs_attr.c | |
parent | 67fd718f30108db320ffc4bef205137b69e60d3a (diff) | |
download | linux-6c888af0b4ca66565b2aa73147ebc1d139c3bd1b.tar.xz |
xfs: pass struct da_args to xfs_attr_calc_size
And remove a very confused comment.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_attr.c')
-rw-r--r-- | fs/xfs/xfs_attr.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 120862139a63..86f482e5798f 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c @@ -162,12 +162,10 @@ xfs_attr_get( */ STATIC int xfs_attr_calc_size( - struct xfs_inode *ip, - int namelen, - int valuelen, + struct xfs_da_args *args, int *local) { - struct xfs_mount *mp = ip->i_mount; + struct xfs_mount *mp = args->dp->i_mount; int size; int nblks; @@ -175,7 +173,7 @@ xfs_attr_calc_size( * Determine space new attribute will use, and if it would be * "local" or "remote" (note: local != inline). */ - size = xfs_attr_leaf_newentsize(namelen, valuelen, + size = xfs_attr_leaf_newentsize(args->namelen, args->valuelen, mp->m_sb.sb_blocksize, local); nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); @@ -189,7 +187,7 @@ xfs_attr_calc_size( * Out of line attribute, cannot double split, but * make room for the attribute value itself. */ - uint dblocks = XFS_B_TO_FSB(mp, valuelen); + uint dblocks = XFS_B_TO_FSB(mp, args->valuelen); nblks += dblocks; nblks += XFS_NEXTENTADD_SPACE_RES(mp, dblocks, XFS_ATTR_FORK); } @@ -227,9 +225,7 @@ xfs_attr_set( args.firstblock = &firstblock; args.flist = &flist; args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT; - - /* Size is now blocks for attribute data */ - args.total = xfs_attr_calc_size(dp, args.namelen, valuelen, &local); + args.total = xfs_attr_calc_size(&args, &local); error = xfs_qm_dqattach(dp, 0); if (error) |