aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-11-01 23:11:45 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 23:11:45 -0500
commitc11e2c369d06576c9e4a900a975cbfab5e7e3c53 (patch)
tree9b25f3214440d38b4b97807628ce9de5fd5062c1 /fs/xfs
parent16259e7d952e26e949cc2c8c68b74f34b293935d (diff)
[XFS] Rework fid encode/decode wrt 64 bit inums interacting with NFS.
SGI-PV: 937127 SGI-Modid: xfs-linux:xfs-kern:24201a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h1
-rw-r--r--fs/xfs/xfs_fsops.c2
-rw-r--r--fs/xfs/xfs_mount.c9
-rw-r--r--fs/xfs/xfs_mount.h5
-rw-r--r--fs/xfs/xfs_vfsops.c11
6 files changed, 19 insertions, 12 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index 3e97076437be..80eb249f2fa0 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -96,9 +96,8 @@ linvfs_encode_fh(
96 int is64 = 0; 96 int is64 = 0;
97#if XFS_BIG_INUMS 97#if XFS_BIG_INUMS
98 vfs_t *vfs = LINVFS_GET_VFS(inode->i_sb); 98 vfs_t *vfs = LINVFS_GET_VFS(inode->i_sb);
99 xfs_mount_t *mp = XFS_VFSTOM(vfs);
100 99
101 if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT)) { 100 if (!(vfs->vfs_flag & VFS_32BITINODES)) {
102 /* filesystem may contain 64bit inode numbers */ 101 /* filesystem may contain 64bit inode numbers */
103 is64 = XFS_FILEID_TYPE_64FLAG; 102 is64 = XFS_FILEID_TYPE_64FLAG;
104 } 103 }
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index d5fb28f7d322..57caf9eddee0 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -81,6 +81,7 @@ typedef enum {
81#define VFS_RDONLY 0x0001 /* read-only vfs */ 81#define VFS_RDONLY 0x0001 /* read-only vfs */
82#define VFS_GRPID 0x0002 /* group-ID assigned from directory */ 82#define VFS_GRPID 0x0002 /* group-ID assigned from directory */
83#define VFS_DMI 0x0004 /* filesystem has the DMI enabled */ 83#define VFS_DMI 0x0004 /* filesystem has the DMI enabled */
84#define VFS_32BITINODES 0x0008 /* do not use inums above 32 bits */
84#define VFS_END 0x0008 /* max flag */ 85#define VFS_END 0x0008 /* max flag */
85 86
86#define SYNC_ATTR 0x0001 /* sync attributes */ 87#define SYNC_ATTR 0x0001 /* sync attributes */
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 0ca597b0ca79..7ceabd0e2d9d 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -171,7 +171,7 @@ xfs_growfs_data_private(
171 memset(&mp->m_perag[oagcount], 0, 171 memset(&mp->m_perag[oagcount], 0,
172 (nagcount - oagcount) * sizeof(xfs_perag_t)); 172 (nagcount - oagcount) * sizeof(xfs_perag_t));
173 mp->m_flags |= XFS_MOUNT_32BITINODES; 173 mp->m_flags |= XFS_MOUNT_32BITINODES;
174 nagimax = xfs_initialize_perag(mp, nagcount); 174 nagimax = xfs_initialize_perag(XFS_MTOVFS(mp), mp, nagcount);
175 up_write(&mp->m_peraglock); 175 up_write(&mp->m_peraglock);
176 } 176 }
177 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); 177 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS);
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 9e861d0d3ee6..02b1892aaf74 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -316,7 +316,10 @@ xfs_mount_validate_sb(
316} 316}
317 317
318xfs_agnumber_t 318xfs_agnumber_t
319xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount) 319xfs_initialize_perag(
320 struct vfs *vfs,
321 xfs_mount_t *mp,
322 xfs_agnumber_t agcount)
320{ 323{
321 xfs_agnumber_t index, max_metadata; 324 xfs_agnumber_t index, max_metadata;
322 xfs_perag_t *pag; 325 xfs_perag_t *pag;
@@ -332,7 +335,7 @@ xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount)
332 /* Clear the mount flag if no inode can overflow 32 bits 335 /* Clear the mount flag if no inode can overflow 32 bits
333 * on this filesystem, or if specifically requested.. 336 * on this filesystem, or if specifically requested..
334 */ 337 */
335 if ((mp->m_flags & XFS_MOUNT_32BITINOOPT) && ino > max_inum) { 338 if ((vfs->vfs_flag & VFS_32BITINODES) && ino > max_inum) {
336 mp->m_flags |= XFS_MOUNT_32BITINODES; 339 mp->m_flags |= XFS_MOUNT_32BITINODES;
337 } else { 340 } else {
338 mp->m_flags &= ~XFS_MOUNT_32BITINODES; 341 mp->m_flags &= ~XFS_MOUNT_32BITINODES;
@@ -944,7 +947,7 @@ xfs_mountfs(
944 mp->m_perag = 947 mp->m_perag =
945 kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP); 948 kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP);
946 949
947 mp->m_maxagi = xfs_initialize_perag(mp, sbp->sb_agcount); 950 mp->m_maxagi = xfs_initialize_perag(vfsp, mp, sbp->sb_agcount);
948 951
949 /* 952 /*
950 * log's mount-time initialization. Perform 1st part recovery if needed 953 * log's mount-time initialization. Perform 1st part recovery if needed
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index f724a2beead9..08b2e0a5d807 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -402,7 +402,7 @@ typedef struct xfs_mount {
402 /* osyncisdsync is now default*/ 402 /* osyncisdsync is now default*/
403#define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above 403#define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above
404 * 32 bits in size */ 404 * 32 bits in size */
405#define XFS_MOUNT_32BITINOOPT (1ULL << 15) /* saved mount option state */ 405 /* (1ULL << 15) -- currently unused */
406#define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */ 406#define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */
407#define XFS_MOUNT_BARRIER (1ULL << 17) 407#define XFS_MOUNT_BARRIER (1ULL << 17)
408#define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ 408#define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/
@@ -557,7 +557,8 @@ extern void xfs_freesb(xfs_mount_t *);
557extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); 557extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
558extern int xfs_syncsub(xfs_mount_t *, int, int, int *); 558extern int xfs_syncsub(xfs_mount_t *, int, int, int *);
559extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *); 559extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *);
560extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); 560extern xfs_agnumber_t xfs_initialize_perag(struct vfs *, xfs_mount_t *,
561 xfs_agnumber_t);
561extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); 562extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);
562 563
563extern struct xfs_dmops xfs_dmcore_stub; 564extern struct xfs_dmops xfs_dmcore_stub;
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index f4f8805e25ba..dd419e1d71ba 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -269,7 +269,7 @@ xfs_start_flags(
269 if (ap->flags & XFSMNT_OSYNCISOSYNC) 269 if (ap->flags & XFSMNT_OSYNCISOSYNC)
270 mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; 270 mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC;
271 if (ap->flags & XFSMNT_32BITINODES) 271 if (ap->flags & XFSMNT_32BITINODES)
272 mp->m_flags |= (XFS_MOUNT_32BITINODES | XFS_MOUNT_32BITINOOPT); 272 mp->m_flags |= XFS_MOUNT_32BITINODES;
273 273
274 if (ap->flags & XFSMNT_IOSIZE) { 274 if (ap->flags & XFSMNT_IOSIZE) {
275 if (ap->iosizelog > XFS_MAX_IO_LOG || 275 if (ap->iosizelog > XFS_MAX_IO_LOG ||
@@ -1868,6 +1868,9 @@ printk("XFS: irixsgid is now a sysctl(2) variable, option is deprecated.\n");
1868 args->sunit = args->swidth = 0; 1868 args->sunit = args->swidth = 0;
1869 } 1869 }
1870 1870
1871 if (args->flags & XFSMNT_32BITINODES)
1872 vfsp->vfs_flag |= VFS_32BITINODES;
1873
1871 if (args->flags2) 1874 if (args->flags2)
1872 args->flags |= XFSMNT_FLAGS2; 1875 args->flags |= XFSMNT_FLAGS2;
1873 return 0; 1876 return 0;
@@ -1929,15 +1932,15 @@ xfs_showargs(
1929 seq_printf(m, "," MNTOPT_SWIDTH "=%d", 1932 seq_printf(m, "," MNTOPT_SWIDTH "=%d",
1930 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); 1933 (int)XFS_FSB_TO_BB(mp, mp->m_swidth));
1931 1934
1932 if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT))
1933 seq_printf(m, "," MNTOPT_64BITINODE);
1934
1935 if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) 1935 if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR))
1936 seq_printf(m, "," MNTOPT_ATTR2); 1936 seq_printf(m, "," MNTOPT_ATTR2);
1937 1937
1938 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) 1938 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE))
1939 seq_printf(m, "," MNTOPT_LARGEIO); 1939 seq_printf(m, "," MNTOPT_LARGEIO);
1940 1940
1941 if (!(vfsp->vfs_flag & VFS_32BITINODES))
1942 seq_printf(m, "," MNTOPT_64BITINODE);
1943
1941 if (vfsp->vfs_flag & VFS_GRPID) 1944 if (vfsp->vfs_flag & VFS_GRPID)
1942 seq_printf(m, "," MNTOPT_GRPID); 1945 seq_printf(m, "," MNTOPT_GRPID);
1943 1946