summaryrefslogtreecommitdiff
path: root/nfs
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-08-12 18:31:04 +0000
committerThomas Bushnell <thomas@gnu.org>1996-08-12 18:31:04 +0000
commit9474c6318ad2effa3e80246d1012cb111e726bf0 (patch)
treeb1f5dbfbd38913dcc4ebf721f81443472937dec0 /nfs
parent4b4fc640461f0f6e152204deda38a4e9272fe9e1 (diff)
*** empty log message ***
Diffstat (limited to 'nfs')
-rw-r--r--nfs/ChangeLog18
-rw-r--r--nfs/mount.c2
-rw-r--r--nfs/nfs.c35
-rw-r--r--nfs/nfs.h3
-rw-r--r--nfs/rpcsvc/nfs_prot.h15
5 files changed, 70 insertions, 3 deletions
diff --git a/nfs/ChangeLog b/nfs/ChangeLog
index e213507e..23d5ba38 100644
--- a/nfs/ChangeLog
+++ b/nfs/ChangeLog
@@ -1,3 +1,21 @@
+Mon Aug 12 11:13:58 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * nfs.c (nfs_error_trans): Repair syntax.
+
+Thu Aug 8 18:48:22 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
+
+ * nfs.h (protocol_version): New variable.
+ * mount.c (protocol_version): Define and initialize to `2'.
+
+ * rpcsvc/nfs_prot.h (enum nfsstat): Added new nfsv3 error codes:
+ NFSERR_XDEV, NFSERR_INVAL, NFSERR_MLINK, NFSERR_REMOTE,
+ NFSERR_BADHANDLE, NFSERR_NOT_SYNC, NFSERR_BAD_COOKIE,
+ NFSERR_NOTSUPP, NFSERR_TOOSMALL, NFSERR_SERVERFAULT,
+ NFSERR_BADTYPE, NFSERR_JUKEBOX.
+ (NFSERR_TRYLATER): New macro.
+ * nfs.c (nfs_error_trans): Understand v3 error codes if we are
+ runnnig v3.
+
Wed Jul 31 13:25:00 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* ops.c (netfs_attempt_statfs): Use NFSPROC_STATFS, not SETATTR to
diff --git a/nfs/mount.c b/nfs/mount.c
index 59363073..687257c1 100644
--- a/nfs/mount.c
+++ b/nfs/mount.c
@@ -59,6 +59,8 @@ short nfs_port = NFS_PORT;
/* True iff NFS_PORT should be used even if portmapper present. */
int nfs_port_override = 0;
+int protocol_version = 2;
+
/* Set up an RPC for procedure PROCNUM for talking to the portmapper.
Allocate storage with malloc and point *BUF at it; caller must free
this when done. Return the address where the args for the
diff --git a/nfs/nfs.c b/nfs/nfs.c
index 617ca334..ae7e677f 100644
--- a/nfs/nfs.c
+++ b/nfs/nfs.c
@@ -401,8 +401,39 @@ nfs_error_trans (int error)
return ESTALE;
case NFSERR_WFLUSH:
- default:
+ /* Not known in v3, but we just give EINVAL for unknown errors
+ so it's the same. */
return EINVAL;
+
+ default:
+ if (protocol_version == 2)
+ return EINVAL;
+ else
+ switch (error)
+ {
+ case NFSERR_XDEV:
+ return EXDEV;
+
+ case NFSERR_INVAL:
+ case NFSERR_REMOTE: /* not sure about this one */
+ default:
+ return EINVAL;
+
+ case NFSERR_MLINK:
+ return EMLINK;
+
+ case NFSERR_NOTSUPP:
+ return EOPNOTSUPP;
+
+ case NFSERR_BADHANDLE:
+ case NFSERR_NOT_SYNC:
+ case NFSERR_BAD_COOKIE:
+ case NFSERR_TOOSMALL:
+ case NFSERR_SERVERFAULT: /* perhaps EIO instead?? */
+ case NFSERR_BADTYPE:
+ case NFSERR_JUKEBOX: /* ??? */
+ /* These indicate bugs in the client, so EGRATUITOUS is right. */
+ return EGRATUITOUS;
+ }
}
}
-
diff --git a/nfs/nfs.h b/nfs/nfs.h
index d9d01121..6a384afa 100644
--- a/nfs/nfs.h
+++ b/nfs/nfs.h
@@ -142,6 +142,9 @@ extern short nfs_port;
portmapper. */
extern int nfs_port_override;
+/* Which NFS protocol version we are using */
+extern int protocol_version;
+
/* Count how many four-byte chunks it takss to hold LEN bytes. */
#define INTSIZE(len) (((len)+3)>>2)
diff --git a/nfs/rpcsvc/nfs_prot.h b/nfs/rpcsvc/nfs_prot.h
index 7f974930..a5af07e0 100644
--- a/nfs/rpcsvc/nfs_prot.h
+++ b/nfs/rpcsvc/nfs_prot.h
@@ -22,17 +22,30 @@ enum nfsstat {
NFSERR_NXIO = 6,
NFSERR_ACCES = 13,
NFSERR_EXIST = 17,
+ NFSERR_XDEV = 18, /* v3 only */
NFSERR_NODEV = 19,
NFSERR_NOTDIR = 20,
NFSERR_ISDIR = 21,
+ NFSERR_INVAL = 22, /* v3 only */
NFSERR_FBIG = 27,
NFSERR_NOSPC = 28,
NFSERR_ROFS = 30,
+ NFSERR_MLINK = 31, /* v3 only */
NFSERR_NAMETOOLONG = 63,
NFSERR_NOTEMPTY = 66,
NFSERR_DQUOT = 69,
NFSERR_STALE = 70,
- NFSERR_WFLUSH = 99,
+ NFSERR_REMOTE = 71, /* v3 only */
+ NFSERR_WFLUSH = 99, /* v2 only */
+ NFSERR_BADHANDLE = 10001, /* v3 only */
+ NFSERR_NOT_SYNC = 10002, /* v3 only */
+ NFSERR_BAD_COOKIE = 10003, /* v3 only */
+ NFSERR_NOTSUPP = 10004, /* v3 only */
+ NFSERR_TOOSMALL = 10005, /* v3 only */
+ NFSERR_SERVERFAULT = 10006, /* v3 only */
+ NFSERR_BADTYPE = 10007, /* v3 only */
+ NFSERR_JUKEBOX = 10008, /* v3 only */
+#define NFSERR_TRYLATER NFSERR_JUKEBOX
};
typedef enum nfsstat nfsstat;
bool_t xdr_nfsstat();