* NEWS: webnfs support
authorIon Badulescu <ib42@cs.columbia.edu>
Tue, 16 Sep 2003 04:14:36 +0000 (04:14 +0000)
committerIon Badulescu <ib42@cs.columbia.edu>
Tue, 16 Sep 2003 04:14:36 +0000 (04:14 +0000)
* amd/srvr_nfs.c (find_nfs_srvr): set MFF_WEBNFS if the "webnfs"
(former "ignore_portmapper") mount option is present

* amd/ops_nfs.c (prime_nfs_fhandle_cache): generate a public
filehandle (all zeros) if MFF_WEBNFS is set
(nfs_umounted): don't talk to mountd if MFF_WEBNFS is set

* amd/amd.h (MFF_WEBNFS): new flag, obvious meaning

ChangeLog
NEWS
amd/amd.h
amd/ops_nfs.c
amd/srvr_nfs.c

index 449fc3fb4acd676eb34b138dbf3263bc890c52b0..1f2dd0d8b35602aad2bbb3b9146a73ef1f40ffc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2003-09-16  Ion Badulescu  <ionut@moisil.badula.org>
+
+       * NEWS: webnfs support
+
+       * amd/srvr_nfs.c (find_nfs_srvr): set MFF_WEBNFS if the "webnfs"
+       (former "ignore_portmapper") mount option is present
+
+       * amd/ops_nfs.c (prime_nfs_fhandle_cache): generate a public
+       filehandle (all zeros) if MFF_WEBNFS is set
+       (nfs_umounted): don't talk to mountd if MFF_WEBNFS is set
+
+       * amd/amd.h (MFF_WEBNFS): new flag, obvious meaning
+
 2003-09-13  Ion Badulescu  <ionut@moisil.badula.org>
 
        * amd/srvr_nfs.c: renamed np_xid to global_xid; sanitized the
diff --git a/NEWS b/NEWS
index f257e2b1666184d278499eae36a1070ff907c24c..f22ad95dc268387279915148bb37623914102a91 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,12 @@
 - speed up the recovery of inherited (restarted) filesystems by using the
   proper waiting channels
 
+- added support for mounting webnfs filesystems, see entry below. It doesn't
+  do any probing currently, so it will default to v2/UDP unless another
+  version and/or protocol is explicitly specified.
+
+- pseudo-mount option "ignore_portmapper" renamed to "webnfs"
+
 - bugs fixed:
        * properly time out autofs filesystems on Linux
        * link mounts with relative targets weren't working on autofs
index 2124f0601c0c441f5f23e4429d6bded641ac967a..250af98215b129e8c68155aaab317b738b3d1cfc 100644 (file)
--- a/amd/amd.h
+++ b/amd/amd.h
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: amd.h,v 1.45 2003/09/13 23:07:56 ib42 Exp $
+ * $Id: amd.h,v 1.46 2003/09/16 04:14:37 ib42 Exp $
  *
  */
 
 #define MFF_IS_AUTOFS  0x0400  /* this filesystem is of type autofs */
 #define MFF_NFS_SCALEDOWN 0x0800 /* the mount failed, retry with v2/UDP */
 #define MFF_ON_AUTOFS  0x1000  /* autofs has a lofs/link to this f/s */
+#define MFF_WEBNFS     0x2000  /* use public filehandle */
 
 /*
  * macros for struct fserver.
index f29bec3794d6f7ad76ccec9938e4418dd09340c5..67f1fd41f65d28a07788d5bc3cf3a434ae890ac0 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: ops_nfs.c,v 1.30 2003/09/13 23:07:56 ib42 Exp $
+ * $Id: ops_nfs.c,v 1.31 2003/09/16 04:14:37 ib42 Exp $
  *
  */
 
@@ -383,6 +383,24 @@ prime_nfs_fhandle_cache(char *path, fserver *fs, am_nfs_handle_t *fhbuf, mntfs *
   fp->fh_fs = dup_srvr(fs);
   fp->fh_path = strdup(path);
 
+  if (mf->mf_flags & MFF_WEBNFS) {
+    dlog("Using public filehandle for '%s'", mf->mf_info);
+    memset(&fp->fh_nfs_handle, 0, sizeof(fp->fh_nfs_handle));
+    if (fhbuf) {
+#ifdef HAVE_FS_NFS3
+      if (fp->fh_nfs_version == NFS_VERSION3)
+       memmove((voidp) &(fhbuf->v3), (voidp) &(fp->fh_nfs_handle.v3),
+               sizeof(fp->fh_nfs_handle.v3));
+      else
+#endif /* HAVE_FS_NFS3 */
+       memmove((voidp) &(fhbuf->v2), (voidp) &(fp->fh_nfs_handle.v2),
+               sizeof(fp->fh_nfs_handle.v2));
+    }
+    wakeup(get_mntfs_wchan(mf));
+    fp->fh_error = 0;
+    return 0;
+  }
+
   error = call_mountd(fp, MOUNTPROC_MNT, got_nfs_fh, get_mntfs_wchan(mf));
   if (error) {
     /*
@@ -779,7 +797,8 @@ nfs_umounted(mntfs *mf)
   if (mf->mf_error || mf->mf_refc > 1)
     return;
 
-  fs = mf->mf_server;
+  if (mf->mf_flags & MFF_WEBNFS)
+    return;
 
   /*
    * Call the mount daemon on the server to announce that we are not using
@@ -789,6 +808,7 @@ nfs_umounted(mntfs *mf)
    * flushed from the cache, and a reference held to the cached entry while
    * the fs is mounted...
    */
+  fs = mf->mf_server;
   colon = path = strchr(mf->mf_info, ':');
   if (fs && colon) {
     fh_cache f;
index 96c61d42fb6abd6131d4ae74df1621a9b480aac9..025a428aebabe90a61b0de4112c9ff5a135b93e5 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: srvr_nfs.c,v 1.29 2003/09/13 23:07:57 ib42 Exp $
+ * $Id: srvr_nfs.c,v 1.30 2003/09/16 04:14:37 ib42 Exp $
  *
  */
 
@@ -744,8 +744,9 @@ find_nfs_srvr(mntfs *mf)
 #endif /* not HAVE_FS_NFS3 */
 
 
-  if (amu_hasmntopt(&mnt, "ignore_portmapper")) {
-    plog(XLOG_INFO, "ignore_portmapper option used, NOT contacting the portmapper on %s", host);
+  if (amu_hasmntopt(&mnt, "webnfs")) {
+    plog(XLOG_INFO, "webnfs option used, NOT contacting the portmapper on %s", host);
+    mf->mf_flags |= MFF_WEBNFS;
     if (!nfs_version) {
       plog(XLOG_INFO, "No NFS version specified, will use NFSv2");
       nfs_version = NFS_VERSION;