aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-01-10 23:32:01 -0500
committerNathan Scott <nathans@sgi.com>2006-01-10 23:32:01 -0500
commit13059ff04c5071c3f6f8a4bd9e51631849f63fa4 (patch)
tree5a038d985cefde848e52c7bc232a71df454f3e0e
parente13a73f02595c564e423bda5742fb8df4ebca455 (diff)
[XFS] Reverse the sense of COMPAT_ATTR and ATTR2, keeps it simple and
consistent. SGI-PV: 941645 SGI-Modid: xfs-linux-melb:xfs-kern:202961a Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r--fs/xfs/xfs_attr_leaf.c12
-rw-r--r--fs/xfs/xfs_bmap.c12
-rw-r--r--fs/xfs/xfs_clnt.h2
-rw-r--r--fs/xfs/xfs_dir.c2
-rw-r--r--fs/xfs/xfs_mount.h2
-rw-r--r--fs/xfs/xfs_vfsops.c19
6 files changed, 23 insertions, 26 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index 1c7421840c18..fe91eac4e2a7 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -128,7 +128,7 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
128 return (offset >= minforkoff) ? minforkoff : 0; 128 return (offset >= minforkoff) ? minforkoff : 0;
129 } 129 }
130 130
131 if (unlikely(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { 131 if (!(mp->m_flags & XFS_MOUNT_ATTR2)) {
132 if (bytes <= XFS_IFORK_ASIZE(dp)) 132 if (bytes <= XFS_IFORK_ASIZE(dp))
133 return mp->m_attroffset >> 3; 133 return mp->m_attroffset >> 3;
134 return 0; 134 return 0;
@@ -157,7 +157,7 @@ xfs_sbversion_add_attr2(xfs_mount_t *mp, xfs_trans_t *tp)
157{ 157{
158 unsigned long s; 158 unsigned long s;
159 159
160 if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR) && 160 if ((mp->m_flags & XFS_MOUNT_ATTR2) &&
161 !(XFS_SB_VERSION_HASATTR2(&mp->m_sb))) { 161 !(XFS_SB_VERSION_HASATTR2(&mp->m_sb))) {
162 s = XFS_SB_LOCK(mp); 162 s = XFS_SB_LOCK(mp);
163 if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb)) { 163 if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb)) {
@@ -311,7 +311,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
311 */ 311 */
312 totsize -= size; 312 totsize -= size;
313 if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname && 313 if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname &&
314 !(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { 314 (mp->m_flags & XFS_MOUNT_ATTR2)) {
315 /* 315 /*
316 * Last attribute now removed, revert to original 316 * Last attribute now removed, revert to original
317 * inode format making all literal area available 317 * inode format making all literal area available
@@ -330,7 +330,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
330 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); 330 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);
331 ASSERT(dp->i_d.di_forkoff); 331 ASSERT(dp->i_d.di_forkoff);
332 ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname || 332 ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname ||
333 (mp->m_flags & XFS_MOUNT_COMPAT_ATTR)); 333 !(mp->m_flags & XFS_MOUNT_ATTR2));
334 dp->i_afp->if_ext_max = 334 dp->i_afp->if_ext_max =
335 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); 335 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t);
336 dp->i_df.if_ext_max = 336 dp->i_df.if_ext_max =
@@ -739,7 +739,7 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp)
739 + name_loc->namelen 739 + name_loc->namelen
740 + INT_GET(name_loc->valuelen, ARCH_CONVERT); 740 + INT_GET(name_loc->valuelen, ARCH_CONVERT);
741 } 741 }
742 if (!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR) && 742 if ((dp->i_mount->m_flags & XFS_MOUNT_ATTR2) &&
743 (bytes == sizeof(struct xfs_attr_sf_hdr))) 743 (bytes == sizeof(struct xfs_attr_sf_hdr)))
744 return(-1); 744 return(-1);
745 return(xfs_attr_shortform_bytesfit(dp, bytes)); 745 return(xfs_attr_shortform_bytesfit(dp, bytes));
@@ -778,7 +778,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff)
778 goto out; 778 goto out;
779 779
780 if (forkoff == -1) { 780 if (forkoff == -1) {
781 ASSERT(!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR)); 781 ASSERT(dp->i_mount->m_flags & XFS_MOUNT_ATTR2);
782 782
783 /* 783 /*
784 * Last attribute was removed, revert to original 784 * Last attribute was removed, revert to original
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 8a32d65211b0..8ac170b828f5 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -3948,7 +3948,7 @@ xfs_bmap_add_attrfork(
3948 ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size); 3948 ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size);
3949 if (!ip->i_d.di_forkoff) 3949 if (!ip->i_d.di_forkoff)
3950 ip->i_d.di_forkoff = mp->m_attroffset >> 3; 3950 ip->i_d.di_forkoff = mp->m_attroffset >> 3;
3951 else if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) 3951 else if (mp->m_flags & XFS_MOUNT_ATTR2)
3952 version = 2; 3952 version = 2;
3953 break; 3953 break;
3954 default: 3954 default:
@@ -4096,13 +4096,13 @@ xfs_bmap_compute_maxlevels(
4096 */ 4096 */
4097 if (whichfork == XFS_DATA_FORK) { 4097 if (whichfork == XFS_DATA_FORK) {
4098 maxleafents = MAXEXTNUM; 4098 maxleafents = MAXEXTNUM;
4099 sz = (mp->m_flags & XFS_MOUNT_COMPAT_ATTR) ? 4099 sz = (mp->m_flags & XFS_MOUNT_ATTR2) ?
4100 mp->m_attroffset : XFS_BMDR_SPACE_CALC(MINDBTPTRS); 4100 XFS_BMDR_SPACE_CALC(MINDBTPTRS) : mp->m_attroffset;
4101 } else { 4101 } else {
4102 maxleafents = MAXAEXTNUM; 4102 maxleafents = MAXAEXTNUM;
4103 sz = (mp->m_flags & XFS_MOUNT_COMPAT_ATTR) ? 4103 sz = (mp->m_flags & XFS_MOUNT_ATTR2) ?
4104 mp->m_sb.sb_inodesize - mp->m_attroffset : 4104 XFS_BMDR_SPACE_CALC(MINABTPTRS) :
4105 XFS_BMDR_SPACE_CALC(MINABTPTRS); 4105 mp->m_sb.sb_inodesize - mp->m_attroffset;
4106 } 4106 }
4107 maxrootrecs = (int)XFS_BTREE_BLOCK_MAXRECS(sz, xfs_bmdr, 0); 4107 maxrootrecs = (int)XFS_BTREE_BLOCK_MAXRECS(sz, xfs_bmdr, 0);
4108 minleafrecs = mp->m_bmap_dmnr[0]; 4108 minleafrecs = mp->m_bmap_dmnr[0];
diff --git a/fs/xfs/xfs_clnt.h b/fs/xfs/xfs_clnt.h
index 328a528b926d..f57cc9ac875e 100644
--- a/fs/xfs/xfs_clnt.h
+++ b/fs/xfs/xfs_clnt.h
@@ -57,7 +57,7 @@ struct xfs_mount_args {
57/* 57/*
58 * XFS mount option flags -- args->flags1 58 * XFS mount option flags -- args->flags1
59 */ 59 */
60#define XFSMNT_COMPAT_ATTR 0x00000001 /* do not use ATTR2 format */ 60#define XFSMNT_ATTR2 0x00000001 /* allow ATTR2 EA format */
61#define XFSMNT_WSYNC 0x00000002 /* safe mode nfs mount 61#define XFSMNT_WSYNC 0x00000002 /* safe mode nfs mount
62 * compatible */ 62 * compatible */
63#define XFSMNT_INO64 0x00000004 /* move inode numbers up 63#define XFSMNT_INO64 0x00000004 /* move inode numbers up
diff --git a/fs/xfs/xfs_dir.c b/fs/xfs/xfs_dir.c
index 3dd30391f551..bb87d2a700a9 100644
--- a/fs/xfs/xfs_dir.c
+++ b/fs/xfs/xfs_dir.c
@@ -176,7 +176,7 @@ xfs_dir_mount(xfs_mount_t *mp)
176 uint shortcount, leafcount, count; 176 uint shortcount, leafcount, count;
177 177
178 mp->m_dirversion = 1; 178 mp->m_dirversion = 1;
179 if (mp->m_flags & XFS_MOUNT_COMPAT_ATTR) { 179 if (!(mp->m_flags & XFS_MOUNT_ATTR2)) {
180 shortcount = (mp->m_attroffset - 180 shortcount = (mp->m_attroffset -
181 (uint)sizeof(xfs_dir_sf_hdr_t)) / 181 (uint)sizeof(xfs_dir_sf_hdr_t)) /
182 (uint)sizeof(xfs_dir_sf_entry_t); 182 (uint)sizeof(xfs_dir_sf_entry_t);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 3432fd5a3986..fbfa240bd139 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -393,7 +393,7 @@ typedef struct xfs_mount {
393 user */ 393 user */
394#define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment 394#define XFS_MOUNT_NOALIGN (1ULL << 7) /* turn off stripe alignment
395 allocations */ 395 allocations */
396#define XFS_MOUNT_COMPAT_ATTR (1ULL << 8) /* do not use attr2 format */ 396#define XFS_MOUNT_ATTR2 (1ULL << 8) /* allow use of attr2 format */
397 /* (1ULL << 9) -- currently unused */ 397 /* (1ULL << 9) -- currently unused */
398#define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */ 398#define XFS_MOUNT_NORECOVERY (1ULL << 10) /* no recovery - dirty fs */
399#define XFS_MOUNT_SHARED (1ULL << 11) /* shared mount */ 399#define XFS_MOUNT_SHARED (1ULL << 11) /* shared mount */
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index dcdb0a8578e1..aef4ec441e0c 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -291,8 +291,8 @@ xfs_start_flags(
291 mp->m_flags |= XFS_MOUNT_IDELETE; 291 mp->m_flags |= XFS_MOUNT_IDELETE;
292 if (ap->flags & XFSMNT_DIRSYNC) 292 if (ap->flags & XFSMNT_DIRSYNC)
293 mp->m_flags |= XFS_MOUNT_DIRSYNC; 293 mp->m_flags |= XFS_MOUNT_DIRSYNC;
294 if (ap->flags & XFSMNT_COMPAT_ATTR) 294 if (ap->flags & XFSMNT_ATTR2)
295 mp->m_flags |= XFS_MOUNT_COMPAT_ATTR; 295 mp->m_flags |= XFS_MOUNT_ATTR2;
296 296
297 if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) 297 if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
298 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; 298 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
@@ -350,6 +350,10 @@ xfs_finish_flags(
350 } 350 }
351 } 351 }
352 352
353 if (XFS_SB_VERSION_HASATTR2(&mp->m_sb)) {
354 mp->m_flags |= XFS_MOUNT_ATTR2;
355 }
356
353 /* 357 /*
354 * prohibit r/w mounts of read-only filesystems 358 * prohibit r/w mounts of read-only filesystems
355 */ 359 */
@@ -385,10 +389,6 @@ xfs_finish_flags(
385 return XFS_ERROR(EINVAL); 389 return XFS_ERROR(EINVAL);
386 } 390 }
387 391
388 if (XFS_SB_VERSION_HASATTR2(&mp->m_sb)) {
389 mp->m_flags &= ~XFS_MOUNT_COMPAT_ATTR;
390 }
391
392 return 0; 392 return 0;
393} 393}
394 394
@@ -1690,7 +1690,6 @@ xfs_parseargs(
1690 int iosize; 1690 int iosize;
1691 1691
1692 args->flags2 |= XFSMNT2_COMPAT_IOSIZE; 1692 args->flags2 |= XFSMNT2_COMPAT_IOSIZE;
1693 args->flags |= XFSMNT_COMPAT_ATTR;
1694 args->flags |= XFSMNT_BARRIER; 1693 args->flags |= XFSMNT_BARRIER;
1695 1694
1696#if 0 /* XXX: off by default, until some remaining issues ironed out */ 1695#if 0 /* XXX: off by default, until some remaining issues ironed out */
@@ -1828,9 +1827,9 @@ xfs_parseargs(
1828 } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { 1827 } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) {
1829 args->flags2 |= XFSMNT2_COMPAT_IOSIZE; 1828 args->flags2 |= XFSMNT2_COMPAT_IOSIZE;
1830 } else if (!strcmp(this_char, MNTOPT_ATTR2)) { 1829 } else if (!strcmp(this_char, MNTOPT_ATTR2)) {
1831 args->flags &= ~XFSMNT_COMPAT_ATTR; 1830 args->flags |= XFSMNT_ATTR2;
1832 } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { 1831 } else if (!strcmp(this_char, MNTOPT_NOATTR2)) {
1833 args->flags |= XFSMNT_COMPAT_ATTR; 1832 args->flags &= ~XFSMNT_ATTR2;
1834 } else if (!strcmp(this_char, "osyncisdsync")) { 1833 } else if (!strcmp(this_char, "osyncisdsync")) {
1835 /* no-op, this is now the default */ 1834 /* no-op, this is now the default */
1836printk("XFS: osyncisdsync is now the default, option is deprecated.\n"); 1835printk("XFS: osyncisdsync is now the default, option is deprecated.\n");
@@ -1941,8 +1940,6 @@ xfs_showargs(
1941 seq_printf(m, "," MNTOPT_SWIDTH "=%d", 1940 seq_printf(m, "," MNTOPT_SWIDTH "=%d",
1942 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); 1941 (int)XFS_FSB_TO_BB(mp, mp->m_swidth));
1943 1942
1944 if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR))
1945 seq_printf(m, "," MNTOPT_ATTR2);
1946 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) 1943 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE))
1947 seq_printf(m, "," MNTOPT_LARGEIO); 1944 seq_printf(m, "," MNTOPT_LARGEIO);
1948 if (!(mp->m_flags & XFS_MOUNT_BARRIER)) 1945 if (!(mp->m_flags & XFS_MOUNT_BARRIER))