[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>
This commit is contained in:
Nathan Scott 2005-11-02 15:11:45 +11:00
parent 16259e7d95
commit c11e2c369d
6 changed files with 19 additions and 12 deletions

View file

@ -96,9 +96,8 @@ linvfs_encode_fh(
int is64 = 0; int is64 = 0;
#if XFS_BIG_INUMS #if XFS_BIG_INUMS
vfs_t *vfs = LINVFS_GET_VFS(inode->i_sb); vfs_t *vfs = LINVFS_GET_VFS(inode->i_sb);
xfs_mount_t *mp = XFS_VFSTOM(vfs);
if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT)) { if (!(vfs->vfs_flag & VFS_32BITINODES)) {
/* filesystem may contain 64bit inode numbers */ /* filesystem may contain 64bit inode numbers */
is64 = XFS_FILEID_TYPE_64FLAG; is64 = XFS_FILEID_TYPE_64FLAG;
} }

View file

@ -81,6 +81,7 @@ typedef enum {
#define VFS_RDONLY 0x0001 /* read-only vfs */ #define VFS_RDONLY 0x0001 /* read-only vfs */
#define VFS_GRPID 0x0002 /* group-ID assigned from directory */ #define VFS_GRPID 0x0002 /* group-ID assigned from directory */
#define VFS_DMI 0x0004 /* filesystem has the DMI enabled */ #define VFS_DMI 0x0004 /* filesystem has the DMI enabled */
#define VFS_32BITINODES 0x0008 /* do not use inums above 32 bits */
#define VFS_END 0x0008 /* max flag */ #define VFS_END 0x0008 /* max flag */
#define SYNC_ATTR 0x0001 /* sync attributes */ #define SYNC_ATTR 0x0001 /* sync attributes */

View file

@ -171,7 +171,7 @@ xfs_growfs_data_private(
memset(&mp->m_perag[oagcount], 0, memset(&mp->m_perag[oagcount], 0,
(nagcount - oagcount) * sizeof(xfs_perag_t)); (nagcount - oagcount) * sizeof(xfs_perag_t));
mp->m_flags |= XFS_MOUNT_32BITINODES; mp->m_flags |= XFS_MOUNT_32BITINODES;
nagimax = xfs_initialize_perag(mp, nagcount); nagimax = xfs_initialize_perag(XFS_MTOVFS(mp), mp, nagcount);
up_write(&mp->m_peraglock); up_write(&mp->m_peraglock);
} }
tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS);

View file

@ -316,7 +316,10 @@ xfs_mount_validate_sb(
} }
xfs_agnumber_t xfs_agnumber_t
xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount) xfs_initialize_perag(
struct vfs *vfs,
xfs_mount_t *mp,
xfs_agnumber_t agcount)
{ {
xfs_agnumber_t index, max_metadata; xfs_agnumber_t index, max_metadata;
xfs_perag_t *pag; xfs_perag_t *pag;
@ -332,7 +335,7 @@ xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount)
/* Clear the mount flag if no inode can overflow 32 bits /* Clear the mount flag if no inode can overflow 32 bits
* on this filesystem, or if specifically requested.. * on this filesystem, or if specifically requested..
*/ */
if ((mp->m_flags & XFS_MOUNT_32BITINOOPT) && ino > max_inum) { if ((vfs->vfs_flag & VFS_32BITINODES) && ino > max_inum) {
mp->m_flags |= XFS_MOUNT_32BITINODES; mp->m_flags |= XFS_MOUNT_32BITINODES;
} else { } else {
mp->m_flags &= ~XFS_MOUNT_32BITINODES; mp->m_flags &= ~XFS_MOUNT_32BITINODES;
@ -944,7 +947,7 @@ xfs_mountfs(
mp->m_perag = mp->m_perag =
kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP); kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP);
mp->m_maxagi = xfs_initialize_perag(mp, sbp->sb_agcount); mp->m_maxagi = xfs_initialize_perag(vfsp, mp, sbp->sb_agcount);
/* /*
* log's mount-time initialization. Perform 1st part recovery if needed * log's mount-time initialization. Perform 1st part recovery if needed

View file

@ -402,7 +402,7 @@ typedef struct xfs_mount {
/* osyncisdsync is now default*/ /* osyncisdsync is now default*/
#define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above #define XFS_MOUNT_32BITINODES (1ULL << 14) /* do not create inodes above
* 32 bits in size */ * 32 bits in size */
#define XFS_MOUNT_32BITINOOPT (1ULL << 15) /* saved mount option state */ /* (1ULL << 15) -- currently unused */
#define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */ #define XFS_MOUNT_NOUUID (1ULL << 16) /* ignore uuid during mount */
#define XFS_MOUNT_BARRIER (1ULL << 17) #define XFS_MOUNT_BARRIER (1ULL << 17)
#define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ #define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/
@ -557,7 +557,8 @@ extern void xfs_freesb(xfs_mount_t *);
extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
extern int xfs_syncsub(xfs_mount_t *, int, int, int *); extern int xfs_syncsub(xfs_mount_t *, int, int, int *);
extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *); extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *);
extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); extern xfs_agnumber_t xfs_initialize_perag(struct vfs *, xfs_mount_t *,
xfs_agnumber_t);
extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);
extern struct xfs_dmops xfs_dmcore_stub; extern struct xfs_dmops xfs_dmcore_stub;

View file

@ -269,7 +269,7 @@ xfs_start_flags(
if (ap->flags & XFSMNT_OSYNCISOSYNC) if (ap->flags & XFSMNT_OSYNCISOSYNC)
mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC;
if (ap->flags & XFSMNT_32BITINODES) if (ap->flags & XFSMNT_32BITINODES)
mp->m_flags |= (XFS_MOUNT_32BITINODES | XFS_MOUNT_32BITINOOPT); mp->m_flags |= XFS_MOUNT_32BITINODES;
if (ap->flags & XFSMNT_IOSIZE) { if (ap->flags & XFSMNT_IOSIZE) {
if (ap->iosizelog > XFS_MAX_IO_LOG || if (ap->iosizelog > XFS_MAX_IO_LOG ||
@ -1868,6 +1868,9 @@ printk("XFS: irixsgid is now a sysctl(2) variable, option is deprecated.\n");
args->sunit = args->swidth = 0; args->sunit = args->swidth = 0;
} }
if (args->flags & XFSMNT_32BITINODES)
vfsp->vfs_flag |= VFS_32BITINODES;
if (args->flags2) if (args->flags2)
args->flags |= XFSMNT_FLAGS2; args->flags |= XFSMNT_FLAGS2;
return 0; return 0;
@ -1929,15 +1932,15 @@ xfs_showargs(
seq_printf(m, "," MNTOPT_SWIDTH "=%d", seq_printf(m, "," MNTOPT_SWIDTH "=%d",
(int)XFS_FSB_TO_BB(mp, mp->m_swidth)); (int)XFS_FSB_TO_BB(mp, mp->m_swidth));
if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT))
seq_printf(m, "," MNTOPT_64BITINODE);
if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR))
seq_printf(m, "," MNTOPT_ATTR2); seq_printf(m, "," MNTOPT_ATTR2);
if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE))
seq_printf(m, "," MNTOPT_LARGEIO); seq_printf(m, "," MNTOPT_LARGEIO);
if (!(vfsp->vfs_flag & VFS_32BITINODES))
seq_printf(m, "," MNTOPT_64BITINODE);
if (vfsp->vfs_flag & VFS_GRPID) if (vfsp->vfs_flag & VFS_GRPID)
seq_printf(m, "," MNTOPT_GRPID); seq_printf(m, "," MNTOPT_GRPID);