Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys MNT_GETARGS support



details:   https://anonhg.NetBSD.org/src/rev/a1f3398f93ac
branches:  trunk
changeset: 536763:a1f3398f93ac
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 21 18:10:34 2002 +0000

description:
MNT_GETARGS support

diffstat:

 sys/coda/coda_vfsops.c           |   6 ++++--
 sys/filecorefs/filecore_mount.h  |   6 +++++-
 sys/filecorefs/filecore_vfsops.c |  15 +++++++++++++--
 sys/fs/smbfs/smbfs_vfsops.c      |   8 +++++++-
 sys/isofs/cd9660/cd9660_mount.h  |   6 +++++-
 sys/isofs/cd9660/cd9660_vfsops.c |  13 +++++++++++--
 sys/msdosfs/msdosfs_vfsops.c     |  16 ++++++++++++++--
 sys/msdosfs/msdosfsmount.h       |   6 +++++-
 sys/ntfs/ntfs_vfsops.c           |  16 ++++++++++++++--
 sys/ntfs/ntfsmount.h             |   5 ++++-
 sys/ufs/ext2fs/ext2fs_vfsops.c   |  13 +++++++++++--
 sys/ufs/ffs/ffs_vfsops.c         |  12 ++++++++++--
 sys/ufs/lfs/lfs_vfsops.c         |  12 ++++++++++--
 sys/ufs/mfs/mfs_vfsops.c         |  26 ++++++++++++++++++++++++--
 14 files changed, 137 insertions(+), 23 deletions(-)

diffs (truncated from 410 to 300 lines):

diff -r cbc80932f82c -r a1f3398f93ac sys/coda/coda_vfsops.c
--- a/sys/coda/coda_vfsops.c    Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/coda/coda_vfsops.c    Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_vfsops.c,v 1.18 2002/09/06 13:18:43 gehenna Exp $ */
+/*     $NetBSD: coda_vfsops.c,v 1.19 2002/09/21 18:10:34 christos Exp $        */
 
 /*
  * 
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.18 2002/09/06 13:18:43 gehenna Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.19 2002/09/21 18:10:34 christos Exp $");
 
 #ifdef _LKM
 #define        NVCODA 4
@@ -160,6 +160,8 @@
     ViceFid ctlfid;
     int error;
 
+    if (vfsp->mnt_flag & MNT_GETARGS)
+       return 0;
     ENTRY;
 
     coda_vfsopstats_init();
diff -r cbc80932f82c -r a1f3398f93ac sys/filecorefs/filecore_mount.h
--- a/sys/filecorefs/filecore_mount.h   Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/filecorefs/filecore_mount.h   Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filecore_mount.h,v 1.2 1998/08/14 18:04:05 mark Exp $  */
+/*     $NetBSD: filecore_mount.h,v 1.3 2002/09/21 18:11:13 christos Exp $      */
 
 /*
  * Copyright (c) 1998 Andrew McMurry
@@ -53,3 +53,7 @@
 #define        FILECOREMNT_OWNREAD     4       /* All files have Owner read access */
 #define        FILECOREMNT_USEUID      8       /* Use uid of mount process */
 #define        FILECOREMNT_FILETYPE    16      /* Include filetype in filename */
+
+#define FILECOREMNT_BITS "\177\20" \
+    "b\00root\0b\01ownaccess\0b\02allaccess\0b\03ownread\0" \
+    "b\04useuid\0b\05filetype"
diff -r cbc80932f82c -r a1f3398f93ac sys/filecorefs/filecore_vfsops.c
--- a/sys/filecorefs/filecore_vfsops.c  Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/filecorefs/filecore_vfsops.c  Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filecore_vfsops.c,v 1.20 2002/09/06 13:18:43 gehenna Exp $     */
+/*     $NetBSD: filecore_vfsops.c,v 1.21 2002/09/21 18:11:13 christos Exp $    */
 
 /*-
  * Copyright (c) 1998 Andrew McMurry
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.20 2002/09/06 13:18:43 gehenna Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.21 2002/09/21 18:11:13 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -161,6 +161,17 @@
        int error;
        struct filecore_mnt *fcmp = NULL;
        
+       if (mp->mnt_flag & MNT_GETARGS) {
+               fcmp = VFSTOFILECORE(mp);
+               if (fcmp == NULL)
+                       return EIO;
+               args.flags = fcmp->fc_mntflags;
+               args.uid = fcmp->fc_uid;
+               args.gid = fcmp->fc_gid;
+               args.fspec = NULL;
+               args.export = fcmp->fc_export;
+               return copyout(&args, data, sizeof(args));
+       }
        error = copyin(data, (caddr_t)&args, sizeof (struct filecore_args));
        if (error)
                return (error);
diff -r cbc80932f82c -r a1f3398f93ac sys/fs/smbfs/smbfs_vfsops.c
--- a/sys/fs/smbfs/smbfs_vfsops.c       Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/fs/smbfs/smbfs_vfsops.c       Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smbfs_vfsops.c,v 1.3 2002/07/30 07:40:08 soren Exp $   */
+/*     $NetBSD: smbfs_vfsops.c,v 1.4 2002/09/21 18:11:56 christos Exp $        */
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -145,6 +145,12 @@
                printf("missing data argument\n");
                return EINVAL;
        }
+       if (mp->mnt_flag & MNT_GETARGS) {
+               smp = VFSTOSMBFS(mp);
+               if (smp == NULL)
+                       return EIO;
+               return copyout(&smp->sm_args, data, sizeof(smp->sm_args));
+       }
        if (mp->mnt_flag & MNT_UPDATE) {
                printf("MNT_UPDATE not implemented");
                return EOPNOTSUPP;
diff -r cbc80932f82c -r a1f3398f93ac sys/isofs/cd9660/cd9660_mount.h
--- a/sys/isofs/cd9660/cd9660_mount.h   Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/isofs/cd9660/cd9660_mount.h   Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_mount.h,v 1.5 2000/07/15 21:40:44 jdolecek Exp $        */
+/*     $NetBSD: cd9660_mount.h,v 1.6 2002/09/21 18:12:43 christos Exp $        */
 /*
  * Copyright (c) 1995
  *     The Regents of the University of California.  All rights reserved.
@@ -53,3 +53,7 @@
 #define        ISOFSMNT_NOJOLIET       0x00000008 /* disable Joliet extensions */
 #define        ISOFSMNT_NOCASETRANS    0x00000010 /* do not make names lower case */
 #define        ISOFSMNT_RRCASEINS      0x00000020 /* case insensitive Rock Ridge */
+
+#define ISOFSMNT_BITS "\177\20" \
+    "b\00norrip\0b\01gens\0b\02extatt\0b\03nojoliet\0" \
+    "b\04nocasetrans\0b\05rrcaseins"
diff -r cbc80932f82c -r a1f3398f93ac sys/isofs/cd9660/cd9660_vfsops.c
--- a/sys/isofs/cd9660/cd9660_vfsops.c  Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/isofs/cd9660/cd9660_vfsops.c  Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_vfsops.c,v 1.63 2002/09/06 13:18:43 gehenna Exp $       */
+/*     $NetBSD: cd9660_vfsops.c,v 1.64 2002/09/21 18:12:43 christos Exp $      */
 
 /*-
  * Copyright (c) 1994
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.63 2002/09/06 13:18:43 gehenna Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.64 2002/09/21 18:12:43 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -179,6 +179,15 @@
        int error;
        struct iso_mnt *imp = NULL;
        
+       if (mp->mnt_flag & MNT_GETARGS) {
+               imp = VFSTOISOFS(mp);
+               if (imp == NULL)
+                       return EIO;
+               args.fspec = NULL;
+               args.flags = imp->im_flags;
+               vfs_showexport(mp, &args.export, &imp->im_export);
+               return copyout(&args, data, sizeof(args));
+       }
        error = copyin(data, (caddr_t)&args, sizeof (struct iso_args));
        if (error)
                return (error);
diff -r cbc80932f82c -r a1f3398f93ac sys/msdosfs/msdosfs_vfsops.c
--- a/sys/msdosfs/msdosfs_vfsops.c      Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/msdosfs/msdosfs_vfsops.c      Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vfsops.c,v 1.83 2002/09/06 13:18:43 gehenna Exp $      */
+/*     $NetBSD: msdosfs_vfsops.c,v 1.84 2002/09/21 18:13:25 christos Exp $     */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.83 2002/09/06 13:18:43 gehenna Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.84 2002/09/21 18:13:25 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -246,6 +246,18 @@
        int error, flags;
        mode_t accessmode;
 
+       if (mp->mnt_flag & MNT_GETARGS) {
+               pmp = VFSTOMSDOSFS(mp);
+               if (pmp == NULL)
+                       return EIO;
+               args.fspec = NULL;
+               args.uid = pmp->pm_uid;
+               args.gid = pmp->pm_gid;
+               args.mask = pmp->pm_mask;
+               args.flags = pmp->pm_flags;
+               vfs_showexport(mp, &args.export, &pmp->pm_export);
+               return copyout(&args, data, sizeof(args));
+       }
        error = copyin(data, (caddr_t)&args, sizeof(struct msdosfs_args));
        if (error)
                return (error);
diff -r cbc80932f82c -r a1f3398f93ac sys/msdosfs/msdosfsmount.h
--- a/sys/msdosfs/msdosfsmount.h        Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/msdosfs/msdosfsmount.h        Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfsmount.h,v 1.22 2001/09/15 16:13:01 chs Exp $    */
+/*     $NetBSD: msdosfsmount.h,v 1.23 2002/09/21 18:13:26 christos Exp $       */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -75,6 +75,10 @@
 #define        MSDOSFSMNT_WAITONFAT    0x40000000      /* mounted synchronous  */
 #define        MSDOSFS_FATMIRROR       0x20000000      /* FAT is mirrored */
 
+#define MSDOSFSMNT_BITS "\177\20" \
+    "b\00shortname\0b\01longname\0b\02nowin95\0bgemdosfs\0" \
+    "b\037ronly\0b\036waitonfat\0b\035fatmirror"
+
 #ifdef _KERNEL
 /*
  * Layout of the mount control block for a msdos file system.
diff -r cbc80932f82c -r a1f3398f93ac sys/ntfs/ntfs_vfsops.c
--- a/sys/ntfs/ntfs_vfsops.c    Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/ntfs/ntfs_vfsops.c    Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_vfsops.c,v 1.42 2002/09/06 13:18:43 gehenna Exp $ */
+/*     $NetBSD: ntfs_vfsops.c,v 1.43 2002/09/21 18:13:54 christos Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.42 2002/09/06 13:18:43 gehenna Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.43 2002/09/21 18:13:54 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -286,6 +286,18 @@
        }
 #endif /* FreeBSD */
 
+       if (mp->mnt_flag & MNT_GETARGS) {
+               struct ntfsmount *ntmp = VFSTONTFS(mp);
+               if (ntmp == NULL)
+                       return EIO;
+               args.fspec = NULL;
+               args.uid = ntmp->ntm_uid;
+               args.gid = ntmp->ntm_gid;
+               args.mode = ntmp->ntm_mode;
+               args.flag = ntmp->ntm_flag;
+               vfs_showexport(mp, &args.export, &ntmp->ntm_export);
+               return copyout(&args, data, sizeof(args));
+       }
        /*
         ***
         * Mounting non-root file system or updating a file system
diff -r cbc80932f82c -r a1f3398f93ac sys/ntfs/ntfsmount.h
--- a/sys/ntfs/ntfsmount.h      Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/ntfs/ntfsmount.h      Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfsmount.h,v 1.3 1999/07/26 14:02:32 jdolecek Exp $   */
+/*     $NetBSD: ntfsmount.h,v 1.4 2002/09/21 18:13:54 christos Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -39,3 +39,6 @@
        mode_t  mode;                   /* mask to be applied for ntfs perms */
        u_long  flag;                   /* additional flags */
 };
+
+#define NTFS_MFLAG_BITS        "\177\20" \
+    "b\00caseins\0b\01allnames"
diff -r cbc80932f82c -r a1f3398f93ac sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c    Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c    Sat Sep 21 18:10:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_vfsops.c,v 1.51 2002/09/06 13:18:43 gehenna Exp $       */
+/*     $NetBSD: ext2fs_vfsops.c,v 1.52 2002/09/21 18:14:49 christos Exp $      */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.51 2002/09/06 13:18:43 gehenna Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.52 2002/09/21 18:14:49 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -225,6 +225,15 @@
        int error, flags;
        mode_t accessmode;
 
+       if (mp->mnt_flag & MNT_GETARGS) {
+               ump = VFSTOUFS(mp);
+               if (ump == NULL)
+                       return EIO;
+               args.fspec = NULL;
+               vfs_showexport(mp, &args.export, &ump->um_export);
+               return copyout(&args, data, sizeof(args));
+       }
+
        error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args));
        if (error)
                return (error);
diff -r cbc80932f82c -r a1f3398f93ac sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Sat Sep 21 18:10:04 2002 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Sat Sep 21 18:10:34 2002 +0000



Home | Main Index | Thread Index | Old Index