diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-06-06 01:21:10 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-06 01:21:10 -0400 |
commit | 33a6039007af112509f48910e62640dadd064322 (patch) | |
tree | cb0b687f696d4959fb2372702bca94f13b4a5864 | |
parent | bc85178a7668db835666c6a5bd53436eebfc94b1 (diff) |
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>
-rw-r--r-- | fs/xfs/xfs_attr.c | 12 | ||||
-rw-r--r-- | fs/xfs/xfs_attr_leaf.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_log_rlimit.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 8bb9ae606593..ccfc2c9700fa 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -175,11 +175,11 @@ xfs_attr_calc_size( | |||
175 | * "local" or "remote" (note: local != inline). | 175 | * "local" or "remote" (note: local != inline). |
176 | */ | 176 | */ |
177 | size = xfs_attr_leaf_newentsize(args->namelen, args->valuelen, | 177 | size = xfs_attr_leaf_newentsize(args->namelen, args->valuelen, |
178 | mp->m_sb.sb_blocksize, local); | 178 | args->geo->blksize, local); |
179 | 179 | ||
180 | nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); | 180 | nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); |
181 | if (*local) { | 181 | if (*local) { |
182 | if (size > (mp->m_sb.sb_blocksize >> 1)) { | 182 | if (size > (args->geo->blksize / 2)) { |
183 | /* Double split possible */ | 183 | /* Double split possible */ |
184 | nblks *= 2; | 184 | nblks *= 2; |
185 | } | 185 | } |
@@ -898,7 +898,7 @@ restart: | |||
898 | state = xfs_da_state_alloc(); | 898 | state = xfs_da_state_alloc(); |
899 | state->args = args; | 899 | state->args = args; |
900 | state->mp = mp; | 900 | state->mp = mp; |
901 | state->blocksize = state->mp->m_sb.sb_blocksize; | 901 | state->blocksize = args->geo->blksize; |
902 | state->node_ents = args->geo->node_ents; | 902 | state->node_ents = args->geo->node_ents; |
903 | 903 | ||
904 | /* | 904 | /* |
@@ -1077,7 +1077,7 @@ restart: | |||
1077 | state = xfs_da_state_alloc(); | 1077 | state = xfs_da_state_alloc(); |
1078 | state->args = args; | 1078 | state->args = args; |
1079 | state->mp = mp; | 1079 | state->mp = mp; |
1080 | state->blocksize = state->mp->m_sb.sb_blocksize; | 1080 | state->blocksize = args->geo->blksize; |
1081 | state->node_ents = args->geo->node_ents; | 1081 | state->node_ents = args->geo->node_ents; |
1082 | state->inleaf = 0; | 1082 | state->inleaf = 0; |
1083 | error = xfs_da3_node_lookup_int(state, &retval); | 1083 | error = xfs_da3_node_lookup_int(state, &retval); |
@@ -1169,7 +1169,7 @@ xfs_attr_node_removename(xfs_da_args_t *args) | |||
1169 | state = xfs_da_state_alloc(); | 1169 | state = xfs_da_state_alloc(); |
1170 | state->args = args; | 1170 | state->args = args; |
1171 | state->mp = dp->i_mount; | 1171 | state->mp = dp->i_mount; |
1172 | state->blocksize = state->mp->m_sb.sb_blocksize; | 1172 | state->blocksize = args->geo->blksize; |
1173 | state->node_ents = args->geo->node_ents; | 1173 | state->node_ents = args->geo->node_ents; |
1174 | 1174 | ||
1175 | /* | 1175 | /* |
@@ -1432,7 +1432,7 @@ xfs_attr_node_get(xfs_da_args_t *args) | |||
1432 | state = xfs_da_state_alloc(); | 1432 | state = xfs_da_state_alloc(); |
1433 | state->args = args; | 1433 | state->args = args; |
1434 | state->mp = args->dp->i_mount; | 1434 | state->mp = args->dp->i_mount; |
1435 | state->blocksize = state->mp->m_sb.sb_blocksize; | 1435 | state->blocksize = args->geo->blksize; |
1436 | state->node_ents = args->geo->node_ents; | 1436 | state->node_ents = args->geo->node_ents; |
1437 | 1437 | ||
1438 | /* | 1438 | /* |
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 5be77b3a9bc4..88cd84a31f82 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -1077,7 +1077,7 @@ xfs_attr3_leaf_add( | |||
1077 | xfs_attr3_leaf_hdr_from_disk(&ichdr, leaf); | 1077 | xfs_attr3_leaf_hdr_from_disk(&ichdr, leaf); |
1078 | ASSERT(args->index >= 0 && args->index <= ichdr.count); | 1078 | ASSERT(args->index >= 0 && args->index <= ichdr.count); |
1079 | entsize = xfs_attr_leaf_newentsize(args->namelen, args->valuelen, | 1079 | entsize = xfs_attr_leaf_newentsize(args->namelen, args->valuelen, |
1080 | args->trans->t_mountp->m_sb.sb_blocksize, NULL); | 1080 | args->geo->blksize, NULL); |
1081 | 1081 | ||
1082 | /* | 1082 | /* |
1083 | * Search through freemap for first-fit on new name length. | 1083 | * Search through freemap for first-fit on new name length. |
@@ -1180,13 +1180,13 @@ xfs_attr3_leaf_add_work( | |||
1180 | ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0); | 1180 | ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0); |
1181 | ASSERT(ichdr->freemap[mapindex].size >= | 1181 | ASSERT(ichdr->freemap[mapindex].size >= |
1182 | xfs_attr_leaf_newentsize(args->namelen, args->valuelen, | 1182 | xfs_attr_leaf_newentsize(args->namelen, args->valuelen, |
1183 | mp->m_sb.sb_blocksize, NULL)); | 1183 | args->geo->blksize, NULL)); |
1184 | ASSERT(ichdr->freemap[mapindex].size < XFS_LBSIZE(mp)); | 1184 | ASSERT(ichdr->freemap[mapindex].size < XFS_LBSIZE(mp)); |
1185 | ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0); | 1185 | ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0); |
1186 | 1186 | ||
1187 | ichdr->freemap[mapindex].size -= | 1187 | ichdr->freemap[mapindex].size -= |
1188 | xfs_attr_leaf_newentsize(args->namelen, args->valuelen, | 1188 | xfs_attr_leaf_newentsize(args->namelen, args->valuelen, |
1189 | mp->m_sb.sb_blocksize, &tmp); | 1189 | args->geo->blksize, &tmp); |
1190 | 1190 | ||
1191 | entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base + | 1191 | entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base + |
1192 | ichdr->freemap[mapindex].size); | 1192 | ichdr->freemap[mapindex].size); |
diff --git a/fs/xfs/xfs_log_rlimit.c b/fs/xfs/xfs_log_rlimit.c index 2af1a0a4d0f1..ee7e0e80246b 100644 --- a/fs/xfs/xfs_log_rlimit.c +++ b/fs/xfs/xfs_log_rlimit.c | |||
@@ -42,7 +42,7 @@ xfs_log_calc_max_attrsetm_res( | |||
42 | int size; | 42 | int size; |
43 | int nblks; | 43 | int nblks; |
44 | 44 | ||
45 | size = xfs_attr_leaf_entsize_local_max(mp->m_sb.sb_blocksize) - | 45 | size = xfs_attr_leaf_entsize_local_max(mp->m_attr_geo->blksize) - |
46 | MAXNAMELEN - 1; | 46 | MAXNAMELEN - 1; |
47 | nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); | 47 | nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); |
48 | nblks += XFS_B_TO_FSB(mp, size); | 48 | nblks += XFS_B_TO_FSB(mp, size); |