[XFS] Fix up a 32/64 local flags variable issue when enabling attr2 mode.
SGI-PV: 941645 SGI-Modid: xfs-linux:xfs-kern:23925a Signed-off-by: Nathan Scott <nathans@sgi.com>
This commit is contained in:
parent
0116d9356b
commit
da087bad81
2 changed files with 12 additions and 11 deletions
|
@ -117,12 +117,6 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
|
||||||
int maxforkoff; /* upper limit on valid forkoff locations */
|
int maxforkoff; /* upper limit on valid forkoff locations */
|
||||||
xfs_mount_t *mp = dp->i_mount;
|
xfs_mount_t *mp = dp->i_mount;
|
||||||
|
|
||||||
if (unlikely(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) {
|
|
||||||
if (bytes <= XFS_IFORK_ASIZE(dp))
|
|
||||||
return mp->m_attroffset >> 3;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
offset = (XFS_LITINO(mp) - bytes) >> 3; /* rounded down */
|
offset = (XFS_LITINO(mp) - bytes) >> 3; /* rounded down */
|
||||||
|
|
||||||
switch (dp->i_d.di_format) {
|
switch (dp->i_d.di_format) {
|
||||||
|
@ -134,6 +128,12 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
|
||||||
return (offset >= minforkoff) ? minforkoff : 0;
|
return (offset >= minforkoff) ? minforkoff : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unlikely(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) {
|
||||||
|
if (bytes <= XFS_IFORK_ASIZE(dp))
|
||||||
|
return mp->m_attroffset >> 3;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* data fork btree root can have at least this many key/ptr pairs */
|
/* data fork btree root can have at least this many key/ptr pairs */
|
||||||
minforkoff = MAX(dp->i_df.if_bytes, XFS_BMDR_SPACE_CALC(MINDBTPTRS));
|
minforkoff = MAX(dp->i_df.if_bytes, XFS_BMDR_SPACE_CALC(MINDBTPTRS));
|
||||||
minforkoff = roundup(minforkoff, 8) >> 3;
|
minforkoff = roundup(minforkoff, 8) >> 3;
|
||||||
|
|
|
@ -3909,19 +3909,20 @@ xfs_bmap_add_attrfork(
|
||||||
goto error2;
|
goto error2;
|
||||||
if (!XFS_SB_VERSION_HASATTR(&mp->m_sb) ||
|
if (!XFS_SB_VERSION_HASATTR(&mp->m_sb) ||
|
||||||
(!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2)) {
|
(!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2)) {
|
||||||
logflags = 0;
|
__int64_t sbfields = 0;
|
||||||
|
|
||||||
s = XFS_SB_LOCK(mp);
|
s = XFS_SB_LOCK(mp);
|
||||||
if (!XFS_SB_VERSION_HASATTR(&mp->m_sb)) {
|
if (!XFS_SB_VERSION_HASATTR(&mp->m_sb)) {
|
||||||
XFS_SB_VERSION_ADDATTR(&mp->m_sb);
|
XFS_SB_VERSION_ADDATTR(&mp->m_sb);
|
||||||
logflags |= XFS_SB_VERSIONNUM;
|
sbfields |= XFS_SB_VERSIONNUM;
|
||||||
}
|
}
|
||||||
if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2) {
|
if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2) {
|
||||||
XFS_SB_VERSION_ADDATTR2(&mp->m_sb);
|
XFS_SB_VERSION_ADDATTR2(&mp->m_sb);
|
||||||
logflags |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);
|
sbfields |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);
|
||||||
}
|
}
|
||||||
if (logflags) {
|
if (sbfields) {
|
||||||
XFS_SB_UNLOCK(mp, s);
|
XFS_SB_UNLOCK(mp, s);
|
||||||
xfs_mod_sb(tp, logflags);
|
xfs_mod_sb(tp, sbfields);
|
||||||
} else
|
} else
|
||||||
XFS_SB_UNLOCK(mp, s);
|
XFS_SB_UNLOCK(mp, s);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue