diff options
Diffstat (limited to 'fs/xfs/xfs_dir2_sf.c')
-rw-r--r-- | fs/xfs/xfs_dir2_sf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index 515efa5d29ca..b47a99c8f244 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -226,7 +226,7 @@ xfs_dir2_block_to_sf( | |||
226 | int size, /* shortform directory size */ | 226 | int size, /* shortform directory size */ |
227 | xfs_dir2_sf_hdr_t *sfhp) /* shortform directory hdr */ | 227 | xfs_dir2_sf_hdr_t *sfhp) /* shortform directory hdr */ |
228 | { | 228 | { |
229 | xfs_dir2_block_t *block; /* block structure */ | 229 | xfs_dir2_data_hdr_t *hdr; /* block header */ |
230 | xfs_dir2_block_tail_t *btp; /* block tail pointer */ | 230 | xfs_dir2_block_tail_t *btp; /* block tail pointer */ |
231 | xfs_dir2_data_entry_t *dep; /* data entry pointer */ | 231 | xfs_dir2_data_entry_t *dep; /* data entry pointer */ |
232 | xfs_inode_t *dp; /* incore directory inode */ | 232 | xfs_inode_t *dp; /* incore directory inode */ |
@@ -248,8 +248,8 @@ xfs_dir2_block_to_sf( | |||
248 | * Make a copy of the block data, so we can shrink the inode | 248 | * Make a copy of the block data, so we can shrink the inode |
249 | * and add local data. | 249 | * and add local data. |
250 | */ | 250 | */ |
251 | block = kmem_alloc(mp->m_dirblksize, KM_SLEEP); | 251 | hdr = kmem_alloc(mp->m_dirblksize, KM_SLEEP); |
252 | memcpy(block, bp->data, mp->m_dirblksize); | 252 | memcpy(hdr, bp->data, mp->m_dirblksize); |
253 | logflags = XFS_ILOG_CORE; | 253 | logflags = XFS_ILOG_CORE; |
254 | if ((error = xfs_dir2_shrink_inode(args, mp->m_dirdatablk, bp))) { | 254 | if ((error = xfs_dir2_shrink_inode(args, mp->m_dirdatablk, bp))) { |
255 | ASSERT(error != ENOSPC); | 255 | ASSERT(error != ENOSPC); |
@@ -277,8 +277,8 @@ xfs_dir2_block_to_sf( | |||
277 | /* | 277 | /* |
278 | * Set up to loop over the block's entries. | 278 | * Set up to loop over the block's entries. |
279 | */ | 279 | */ |
280 | btp = xfs_dir2_block_tail_p(mp, &block->hdr); | 280 | btp = xfs_dir2_block_tail_p(mp, hdr); |
281 | ptr = (char *)block->u; | 281 | ptr = (char *)(hdr + 1); |
282 | endptr = (char *)xfs_dir2_block_leaf_p(btp); | 282 | endptr = (char *)xfs_dir2_block_leaf_p(btp); |
283 | sfep = xfs_dir2_sf_firstentry(sfp); | 283 | sfep = xfs_dir2_sf_firstentry(sfp); |
284 | /* | 284 | /* |
@@ -314,7 +314,7 @@ xfs_dir2_block_to_sf( | |||
314 | sfep->namelen = dep->namelen; | 314 | sfep->namelen = dep->namelen; |
315 | xfs_dir2_sf_put_offset(sfep, | 315 | xfs_dir2_sf_put_offset(sfep, |
316 | (xfs_dir2_data_aoff_t) | 316 | (xfs_dir2_data_aoff_t) |
317 | ((char *)dep - (char *)block)); | 317 | ((char *)dep - (char *)hdr)); |
318 | memcpy(sfep->name, dep->name, dep->namelen); | 318 | memcpy(sfep->name, dep->name, dep->namelen); |
319 | xfs_dir2_sfe_put_ino(sfp, sfep, | 319 | xfs_dir2_sfe_put_ino(sfp, sfep, |
320 | be64_to_cpu(dep->inumber)); | 320 | be64_to_cpu(dep->inumber)); |
@@ -327,7 +327,7 @@ xfs_dir2_block_to_sf( | |||
327 | xfs_dir2_sf_check(args); | 327 | xfs_dir2_sf_check(args); |
328 | out: | 328 | out: |
329 | xfs_trans_log_inode(args->trans, dp, logflags); | 329 | xfs_trans_log_inode(args->trans, dp, logflags); |
330 | kmem_free(block); | 330 | kmem_free(hdr); |
331 | return error; | 331 | return error; |
332 | } | 332 | } |
333 | 333 | ||