diff options
author | Nathan Scott <nathans@sgi.com> | 2005-11-01 23:00:20 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-01 23:00:20 -0500 |
commit | da087bad810b48dd889a504e6af0a582ba18df0d (patch) | |
tree | 2b94f17722bc632dde1ca2ab9805e0f51b57054e /fs | |
parent | 0116d9356bfa8607a6e2efb5263100a6c72eabb0 (diff) |
[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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_attr_leaf.c | 12 | ||||
-rw-r--r-- | fs/xfs/xfs_bmap.c | 11 |
2 files changed, 12 insertions, 11 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 52a847e6abf7..35e557b00db2 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -117,12 +117,6 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes) | |||
117 | int maxforkoff; /* upper limit on valid forkoff locations */ | 117 | int maxforkoff; /* upper limit on valid forkoff locations */ |
118 | xfs_mount_t *mp = dp->i_mount; | 118 | xfs_mount_t *mp = dp->i_mount; |
119 | 119 | ||
120 | if (unlikely(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { | ||
121 | if (bytes <= XFS_IFORK_ASIZE(dp)) | ||
122 | return mp->m_attroffset >> 3; | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | offset = (XFS_LITINO(mp) - bytes) >> 3; /* rounded down */ | 120 | offset = (XFS_LITINO(mp) - bytes) >> 3; /* rounded down */ |
127 | 121 | ||
128 | switch (dp->i_d.di_format) { | 122 | switch (dp->i_d.di_format) { |
@@ -134,6 +128,12 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes) | |||
134 | return (offset >= minforkoff) ? minforkoff : 0; | 128 | return (offset >= minforkoff) ? minforkoff : 0; |
135 | } | 129 | } |
136 | 130 | ||
131 | if (unlikely(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { | ||
132 | if (bytes <= XFS_IFORK_ASIZE(dp)) | ||
133 | return mp->m_attroffset >> 3; | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | /* data fork btree root can have at least this many key/ptr pairs */ | 137 | /* data fork btree root can have at least this many key/ptr pairs */ |
138 | minforkoff = MAX(dp->i_df.if_bytes, XFS_BMDR_SPACE_CALC(MINDBTPTRS)); | 138 | minforkoff = MAX(dp->i_df.if_bytes, XFS_BMDR_SPACE_CALC(MINDBTPTRS)); |
139 | minforkoff = roundup(minforkoff, 8) >> 3; | 139 | minforkoff = roundup(minforkoff, 8) >> 3; |
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 82496d901d23..fbd48f9b797e 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -3909,19 +3909,20 @@ xfs_bmap_add_attrfork( | |||
3909 | goto error2; | 3909 | goto error2; |
3910 | if (!XFS_SB_VERSION_HASATTR(&mp->m_sb) || | 3910 | if (!XFS_SB_VERSION_HASATTR(&mp->m_sb) || |
3911 | (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2)) { | 3911 | (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2)) { |
3912 | logflags = 0; | 3912 | __int64_t sbfields = 0; |
3913 | |||
3913 | s = XFS_SB_LOCK(mp); | 3914 | s = XFS_SB_LOCK(mp); |
3914 | if (!XFS_SB_VERSION_HASATTR(&mp->m_sb)) { | 3915 | if (!XFS_SB_VERSION_HASATTR(&mp->m_sb)) { |
3915 | XFS_SB_VERSION_ADDATTR(&mp->m_sb); | 3916 | XFS_SB_VERSION_ADDATTR(&mp->m_sb); |
3916 | logflags |= XFS_SB_VERSIONNUM; | 3917 | sbfields |= XFS_SB_VERSIONNUM; |
3917 | } | 3918 | } |
3918 | if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2) { | 3919 | if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2) { |
3919 | XFS_SB_VERSION_ADDATTR2(&mp->m_sb); | 3920 | XFS_SB_VERSION_ADDATTR2(&mp->m_sb); |
3920 | logflags |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2); | 3921 | sbfields |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2); |
3921 | } | 3922 | } |
3922 | if (logflags) { | 3923 | if (sbfields) { |
3923 | XFS_SB_UNLOCK(mp, s); | 3924 | XFS_SB_UNLOCK(mp, s); |
3924 | xfs_mod_sb(tp, logflags); | 3925 | xfs_mod_sb(tp, sbfields); |
3925 | } else | 3926 | } else |
3926 | XFS_SB_UNLOCK(mp, s); | 3927 | XFS_SB_UNLOCK(mp, s); |
3927 | } | 3928 | } |