xfs
[Top] [All Lists]

[PATCH] Add nouuid option

To: linux-xfs@xxxxxxxxxxx
Subject: [PATCH] Add nouuid option
From: Andi Kleen <ak@xxxxxxx>
Date: Fri, 22 Jun 2001 10:34:53 +0200
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
Following patch adds a nouuid mount option to XFS, which makes it not check
if the file system uuid is unique on the system. This is useful to mount
LVM snapshot volumes without having to play games with xfsdb.

-Andi

--- linux-xfs/fs/xfs/linux/xfs_super.c-NOUUID   Wed May 30 23:58:59 2001
+++ linux-xfs/fs/xfs/linux/xfs_super.c  Mon Jun 18 21:59:12 2001
@@ -78,6 +78,7 @@
 #define MNTOPT_QUOTANOENF  "qnoenforce" /* same as uqnoenforce */
 #define MNTOPT_RO       "ro"            /* read only */
 #define MNTOPT_RW       "rw"            /* read/write */
+#define MNTOPT_NOUUID   "nouuid"       /* Ignore FS uuid */
 
 STATIC int
 mountargs_xfs(
@@ -225,6 +226,8 @@
                        args->flags |= MS_RDONLY;
                } else if (!strcmp(this_char, MNTOPT_NOSUID)) {
                        args->flags |= MS_NOSUID;
+               } else if (!strcmp(this_char, MNTOPT_NOUUID)) {
+                       args->flags |= XFSMNT_NOUUID; 
                } else {
                        printk(
                        "mount: unknown mount option \"%s\".\n", this_char);
--- linux-xfs/fs/xfs/xfs_mount.h-NOUUID Fri May 18 17:47:22 2001
+++ linux-xfs/fs/xfs/xfs_mount.h        Mon Jun 18 21:59:10 2001
@@ -341,6 +341,7 @@
 #define XFS_MOUNT_SHARED       0x00000800      /* shared mount */
 #define XFS_MOUNT_DFLT_IOSIZE          0x00001000      /* set default i/o size 
*/
 #define XFS_MOUNT_OSYNCISDSYNC         0x00002000      /* treat o_sync like 
o_dsync */
+#define XFS_MOUNT_NOUUID       0x00004000      /* ignore uuid during mount */
 
 /*
  * Flags for m_cxfstype
--- linux-xfs/fs/xfs/xfs_clnt.h-NOUUID  Fri May 18 17:47:20 2001
+++ linux-xfs/fs/xfs/xfs_clnt.h Mon Jun 18 21:59:13 2001
@@ -221,5 +221,6 @@
 #define XFSMNT_GQUOTA          0x00400000      /* group quota accounting */
 #define XFSMNT_GQUOTAENF       0x00800000      /* group quota limit
                                                 * enforcement */
+#define XFSMNT_NOUUID          0x01000000      /* Ignore fs uuid */
 
 #endif /* __XFS_CLNT_H__ */
--- linux-xfs/fs/xfs/xfs_vfsops.c-NOUUID        Thu May 24 10:40:15 2001
+++ linux-xfs/fs/xfs/xfs_vfsops.c       Mon Jun 18 21:59:10 2001
@@ -424,6 +424,9 @@
                        }
                        mp->m_flags |= XFS_MOUNT_NORECOVERY;
                }
+
+               if (ap->flags & XFSMNT_NOUUID) 
+                       mp->m_flags |= XFS_MOUNT_NOUUID; 
        }
 
        /*
--- linux-xfs/fs/xfs/xfs_mount.c-NOUUID Fri May 18 17:47:22 2001
+++ linux-xfs/fs/xfs/xfs_mount.c        Mon Jun 18 21:59:09 2001
@@ -604,7 +604,7 @@
         * since a single partition filesystem is identical to a single
         * partition volume/filesystem.
         */
-       if ((mfsi_flags & XFS_MFSI_SECOND) == 0) {
+       if ((mfsi_flags & XFS_MFSI_SECOND) == 0 && (mp->m_flags & 
XFS_MOUNT_NOUUID) == 0) {
                if (xfs_uuid_mount(mp)) {
                        error = XFS_ERROR(EINVAL);
                        goto error1;
--- linux-xfs/Documentation/filesystems/xfs.txt-NOUUID  Mon Jun 18 23:16:03 2001
+++ linux-xfs/Documentation/filesystems/xfs.txt Mon Jun 18 23:18:33 2001
@@ -105,3 +105,7 @@
        instead of buffer heads. This is implemented for ide and scsi
        devices, it is not available for lvm or md at the moment.
 
+  nouuid
+        Don't check for double mounted file systems using the file system uuid.
+        This is useful to mount LVM snapshot volumes.
+

<Prev in Thread] Current Thread [Next in Thread>