mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 09:43:59 +08:00
xfs: use xfs_da_geometry for block size in attr code
Rather than using the superblock value obtained through the xfs_mount. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
bc85178a76
commit
33a6039007
@ -175,11 +175,11 @@ xfs_attr_calc_size(
|
||||
* "local" or "remote" (note: local != inline).
|
||||
*/
|
||||
size = xfs_attr_leaf_newentsize(args->namelen, args->valuelen,
|
||||
mp->m_sb.sb_blocksize, local);
|
||||
args->geo->blksize, local);
|
||||
|
||||
nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK);
|
||||
if (*local) {
|
||||
if (size > (mp->m_sb.sb_blocksize >> 1)) {
|
||||
if (size > (args->geo->blksize / 2)) {
|
||||
/* Double split possible */
|
||||
nblks *= 2;
|
||||
}
|
||||
@ -898,7 +898,7 @@ restart:
|
||||
state = xfs_da_state_alloc();
|
||||
state->args = args;
|
||||
state->mp = mp;
|
||||
state->blocksize = state->mp->m_sb.sb_blocksize;
|
||||
state->blocksize = args->geo->blksize;
|
||||
state->node_ents = args->geo->node_ents;
|
||||
|
||||
/*
|
||||
@ -1077,7 +1077,7 @@ restart:
|
||||
state = xfs_da_state_alloc();
|
||||
state->args = args;
|
||||
state->mp = mp;
|
||||
state->blocksize = state->mp->m_sb.sb_blocksize;
|
||||
state->blocksize = args->geo->blksize;
|
||||
state->node_ents = args->geo->node_ents;
|
||||
state->inleaf = 0;
|
||||
error = xfs_da3_node_lookup_int(state, &retval);
|
||||
@ -1169,7 +1169,7 @@ xfs_attr_node_removename(xfs_da_args_t *args)
|
||||
state = xfs_da_state_alloc();
|
||||
state->args = args;
|
||||
state->mp = dp->i_mount;
|
||||
state->blocksize = state->mp->m_sb.sb_blocksize;
|
||||
state->blocksize = args->geo->blksize;
|
||||
state->node_ents = args->geo->node_ents;
|
||||
|
||||
/*
|
||||
@ -1432,7 +1432,7 @@ xfs_attr_node_get(xfs_da_args_t *args)
|
||||
state = xfs_da_state_alloc();
|
||||
state->args = args;
|
||||
state->mp = args->dp->i_mount;
|
||||
state->blocksize = state->mp->m_sb.sb_blocksize;
|
||||
state->blocksize = args->geo->blksize;
|
||||
state->node_ents = args->geo->node_ents;
|
||||
|
||||
/*
|
||||
|
@ -1077,7 +1077,7 @@ xfs_attr3_leaf_add(
|
||||
xfs_attr3_leaf_hdr_from_disk(&ichdr, leaf);
|
||||
ASSERT(args->index >= 0 && args->index <= ichdr.count);
|
||||
entsize = xfs_attr_leaf_newentsize(args->namelen, args->valuelen,
|
||||
args->trans->t_mountp->m_sb.sb_blocksize, NULL);
|
||||
args->geo->blksize, NULL);
|
||||
|
||||
/*
|
||||
* Search through freemap for first-fit on new name length.
|
||||
@ -1180,13 +1180,13 @@ xfs_attr3_leaf_add_work(
|
||||
ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0);
|
||||
ASSERT(ichdr->freemap[mapindex].size >=
|
||||
xfs_attr_leaf_newentsize(args->namelen, args->valuelen,
|
||||
mp->m_sb.sb_blocksize, NULL));
|
||||
args->geo->blksize, NULL));
|
||||
ASSERT(ichdr->freemap[mapindex].size < XFS_LBSIZE(mp));
|
||||
ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0);
|
||||
|
||||
ichdr->freemap[mapindex].size -=
|
||||
xfs_attr_leaf_newentsize(args->namelen, args->valuelen,
|
||||
mp->m_sb.sb_blocksize, &tmp);
|
||||
args->geo->blksize, &tmp);
|
||||
|
||||
entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base +
|
||||
ichdr->freemap[mapindex].size);
|
||||
|
@ -42,7 +42,7 @@ xfs_log_calc_max_attrsetm_res(
|
||||
int size;
|
||||
int nblks;
|
||||
|
||||
size = xfs_attr_leaf_entsize_local_max(mp->m_sb.sb_blocksize) -
|
||||
size = xfs_attr_leaf_entsize_local_max(mp->m_attr_geo->blksize) -
|
||||
MAXNAMELEN - 1;
|
||||
nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK);
|
||||
nblks += XFS_B_TO_FSB(mp, size);
|
||||
|
Loading…
Reference in New Issue
Block a user