diff options
author | Christoph Hellwig <hch@lst.de> | 2014-05-13 02:40:19 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-05-13 02:40:19 -0400 |
commit | 6c888af0b4ca66565b2aa73147ebc1d139c3bd1b (patch) | |
tree | e0ecaf22b4e8858d0b7b207b30de0cdaa940e119 | |
parent | 67fd718f30108db320ffc4bef205137b69e60d3a (diff) |
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>
-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( | |||
162 | */ | 162 | */ |
163 | STATIC int | 163 | STATIC int |
164 | xfs_attr_calc_size( | 164 | xfs_attr_calc_size( |
165 | struct xfs_inode *ip, | 165 | struct xfs_da_args *args, |
166 | int namelen, | ||
167 | int valuelen, | ||
168 | int *local) | 166 | int *local) |
169 | { | 167 | { |
170 | struct xfs_mount *mp = ip->i_mount; | 168 | struct xfs_mount *mp = args->dp->i_mount; |
171 | int size; | 169 | int size; |
172 | int nblks; | 170 | int nblks; |
173 | 171 | ||
@@ -175,7 +173,7 @@ xfs_attr_calc_size( | |||
175 | * Determine space new attribute will use, and if it would be | 173 | * Determine space new attribute will use, and if it would be |
176 | * "local" or "remote" (note: local != inline). | 174 | * "local" or "remote" (note: local != inline). |
177 | */ | 175 | */ |
178 | size = xfs_attr_leaf_newentsize(namelen, valuelen, | 176 | size = xfs_attr_leaf_newentsize(args->namelen, args->valuelen, |
179 | mp->m_sb.sb_blocksize, local); | 177 | mp->m_sb.sb_blocksize, local); |
180 | 178 | ||
181 | nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); | 179 | nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); |
@@ -189,7 +187,7 @@ xfs_attr_calc_size( | |||
189 | * Out of line attribute, cannot double split, but | 187 | * Out of line attribute, cannot double split, but |
190 | * make room for the attribute value itself. | 188 | * make room for the attribute value itself. |
191 | */ | 189 | */ |
192 | uint dblocks = XFS_B_TO_FSB(mp, valuelen); | 190 | uint dblocks = XFS_B_TO_FSB(mp, args->valuelen); |
193 | nblks += dblocks; | 191 | nblks += dblocks; |
194 | nblks += XFS_NEXTENTADD_SPACE_RES(mp, dblocks, XFS_ATTR_FORK); | 192 | nblks += XFS_NEXTENTADD_SPACE_RES(mp, dblocks, XFS_ATTR_FORK); |
195 | } | 193 | } |
@@ -227,9 +225,7 @@ xfs_attr_set( | |||
227 | args.firstblock = &firstblock; | 225 | args.firstblock = &firstblock; |
228 | args.flist = &flist; | 226 | args.flist = &flist; |
229 | args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT; | 227 | args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT; |
230 | 228 | args.total = xfs_attr_calc_size(&args, &local); | |
231 | /* Size is now blocks for attribute data */ | ||
232 | args.total = xfs_attr_calc_size(dp, args.namelen, valuelen, &local); | ||
233 | 229 | ||
234 | error = xfs_qm_dqattach(dp, 0); | 230 | error = xfs_qm_dqattach(dp, 0); |
235 | if (error) | 231 | if (error) |