]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
/proc/fs/nfsd as an alternate to /proc/fs/nfsd nfs-utils-1-0-5-post2
authorneilbrown <neilbrown>
Mon, 4 Aug 2003 04:25:54 +0000 (04:25 +0000)
committerneilbrown <neilbrown>
Mon, 4 Aug 2003 04:25:54 +0000 (04:25 +0000)
ChangeLog
support/export/xtab.c
support/include/nfslib.h
support/nfs/cacheio.c
support/nfs/nfssvc.c
utils/exportfs/exportfs.c
utils/exportfs/exportfs.man
utils/exportfs/nfsd.man
utils/mountd/cache.c

index 9f1d85a162604ef10d5b989f8a928bc707d08f05..00e380e94de469724cef18aafdfccccef66db84b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-08-04 NeilBrown <neilb@cse.unsw.edu.au>
+       * support/export/xtab.c, support/include/nfslib.h,
+       support/nfs/cacheio.c, support/nfs/nfssvc.c,
+       utils/exportfs/exportfs.c, utils/exportfs/exportfs.man,
+       utils/exportfs/nfsd.man, utils/mountd/cache.c: support
+       /proc/fs/nfsd/* as a perferred alternate to /proc/fs/nfs/*
+       (nfs-utils-1.0.5-post2)
+       
 2003-08-04 NeilBrown <neilb@cse.unsw.edu.au>
        * support/nfs/nfsexport.c: open channel file O_WRONLY when
        only writing.
@@ -6,6 +14,7 @@
        * utils/mountd/mountd.h: mountlist_{del,add} now take a host name
        rather than an nfs_export.
        * utils/mountd/rmtab.c: ditto.
+       (nfs-utils-1.5.0-post1)
        
 2003-07-24  Chip Salzenberg  <chip@pobox.com>
 
index d9265a24e078627725ea4319e89f43a72f5cb7d9..eb67b0d19411d128b21200869a1eb56a3cca9a30 100644 (file)
@@ -65,6 +65,9 @@ xtab_mount_read(void)
        if ((fd=open(_PATH_PROC_EXPORTS, O_RDONLY))>=0) {
                close(fd);
                return xtab_read(_PATH_PROC_EXPORTS, 0);
+       } else if ((fd=open(_PATH_PROC_EXPORTS_ALT, O_RDONLY) >= 0)) {
+               close(fd);
+               return xtab_read(_PATH_PROC_EXPORTS_ALT, 0);
        } else
                return xtab_read(_PATH_XTAB, 2);
 }
index c41f92ebcdfbb3c384776ce704725744aae1b279..e7e9f1db4442018c39079be129e38005794ffd2f 100644 (file)
@@ -43,6 +43,7 @@
 #endif
 #ifndef _PATH_PROC_EXPORTS
 #define        _PATH_PROC_EXPORTS      "/proc/fs/nfs/exports"
+#define        _PATH_PROC_EXPORTS_ALT  "/proc/fs/nfsd/exports"
 #endif
 
 enum cle_maptypes {
index ff5b02813e256c12b017da5356d80ecb17b9c43c..20d195c16ca4b792fbb7b7866688e7993ab87db8 100644 (file)
@@ -227,7 +227,8 @@ int
 check_new_cache(void)
 {
        struct stat stb;
-       return (stat("/proc/fs/nfs/filehandle", &stb) == 0);
+       return  (stat("/proc/fs/nfs/filehandle", &stb) == 0) ||
+               (stat("/proc/fs/nfsd/filehandle", &stb) == 0);
 }      
 
 
index dae16f7f7adc59a540b565e210e8861f71cacd37..67089be0fb347317e02e825c11101244bf73a680 100644 (file)
@@ -19,7 +19,9 @@ nfssvc(int port, int nrservs)
        struct nfsctl_arg       arg;
        int fd;
 
-       fd = open("/proc/fs/nfs/threads", O_WRONLY);
+       fd = open("/proc/fs/nfsd/threads", O_WRONLY);
+       if (fd < 0)
+               fd = open("/proc/fs/nfs/threads", O_WRONLY);
        if (fd >= 0) {
                /* 2.5+ kernel with nfsd filesystem mounted.
                 * Just write the number in.
index cbb0aa9ad859f55dca774a56939c9a3eb695d3d8..6f2a60d7d4bddd20f321df402f281d6d8a68985a 100644 (file)
@@ -97,7 +97,7 @@ main(int argc, char **argv)
                        if (new_cache)
                                cache_flush(1);
                        else {
-                               fprintf(stderr, "exportfs: -f: only available with new cache controls: mount /proc/fs/nfs first\n");
+                               fprintf(stderr, "exportfs: -f: only available with new cache controls: mount /proc/fs/nfsd first\n");
                                exit(1);
                        }
                        return 0;
index 7d18509e69b88c5d52e5385f524bb2540eec47ab..9024caf17838eea4f692c7de9fa97277ba19a007 100644 (file)
@@ -49,6 +49,8 @@ earlier versions of the Linux kernel, and a new mode which applies to
 2.6 and later versions providing the
 .B nfsd
 virtual filesystem has been mounted at
+.B /proc/fs/nfsd
+or
 .BR /proc/fs/nfs .
 If this filesystem is not mounted in 2.6, the legacy mode is used.
 .P
index b4806b44e62dc377b9c1ac8230f82d3ea799abc7..d475eb102526db027d6df936e84d0ef7f8ea79e1 100644 (file)
@@ -8,7 +8,7 @@
 .SH NAME
 nfsd \- special filesystem for controlling Linux NFS server
 .SH SYNPOSIS
-.B "mount -t nfsd nfsd /proc/fs/nfs"
+.B "mount -t nfsd nfsd /proc/fs/nfsd"
 .SH DESCRIPTION
 The
 .B nfsd
@@ -35,6 +35,8 @@ and
 .I mountd
 programs (part of the nfs-utils package) expect to find this
 filesystem mounted at
+.B /proc/fs/nfsd
+or
 .BR /proc/fs/nfs .
 If it is not mounted, they will fall-back on 2.4 style functionality.
 This involves accessing the NFS server via a systemcall.  This
index 2e35b17417173914899234d4cfe28f6ff9aa42a4..96492b8f5b467ec55ddc408eeb798339a8ce47f0 100644 (file)
@@ -368,15 +368,18 @@ void cache_export(nfs_export *exp)
  * { 
  *   echo $domain $path $length 
  *   read filehandle <&0
- * } <> /proc/fs/nfs/filehandle
+ * } <> /proc/fs/nfsd/filehandle
  */
 struct nfs_fh_len *
 cache_get_filehandle(nfs_export *exp, int len, char *p)
 {
-       FILE *f = fopen("/proc/fs/nfs/filehandle", "r+");
+       FILE *f = fopen("/proc/fs/nfsd/filehandle", "r+");
        char buf[200];
        char *bp = buf;
        static struct nfs_fh_len fh;
+
+       if (!f)
+               f = fopen("/proc/fs/nfs/filehandle", "r+");
        if (!f)
                return NULL;