From 1d0cd383e9c80cc07ea8ddd32157657e3842caaa Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 18 Aug 1994 23:18:40 +0000 Subject: entered into RCS --- nfs/ops.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'nfs/ops.c') diff --git a/nfs/ops.c b/nfs/ops.c index 4347ae0f..824affe7 100644 --- a/nfs/ops.c +++ b/nfs/ops.c @@ -24,6 +24,8 @@ netfs_validate_stat (struct node *np, struct protid *cred) struct vfsv2_fattr *fattr; size_t hsize; char *rpc; + struct nfsv2_attrstat *reply; + error_t err; /* The only arg is the file handle. */ @@ -34,4 +36,41 @@ netfs_validate_stat (struct node *np, struct protid *cred) bcopy (&np->nn.handle, rpc + hsize, NFSV2_FHSIZE); /* Transmit */ - rpc_send ( + err = nfs_rpc_send (NFSV2_GETATTR, rpc, hsize + NFSV2_FHSIZE, + &reply, sizeof (struct nfsv2_attrstat)); + if (err) + return err; + + xdr_to_native_attrstat (reply); + + if (reply->status != NFSV2_OK) + err = nfsv2err_to_hurderr (reply->status); + else + { + np->nn_stat.st_mode = nfsv2mode_to_hurdmode (reply->attributes.type, + reply->attributes.mode); + np->nn_stat.st_nlink = reply->attributes.nlink; + np->nn_stat.st_uid = reply->attributes.uid; + np->nn_stat.st_gid = reply->attributes.gid; + np->nn_stat.st_size = reply->attributes.size; + np->nn_stat.st_blksize = reply->attributes.blocksize; + np->nn_stat.st_rdev = reply->attributes.rdev; + np->nn_stat.st_blocks = reply->attributes.blocks; + np->nn_stat.st_fstype = FSTYPE_NFS; + np->nn_stat.st_fsid = reply->attributes.fsid; /* surely wrong XXX */ + np->nn_stat.st_fileid = reply->attributes.fileid; + np->nn_stat.st_atime = reply->attributes.atime.seconds; + np->nn_stat.st_atime_usec = reply->attributes.atime.useconds; + np->nn_stat.st_mtime = reply->attributes.mtime.seconds; + np->nn_stat.st_mtime_usec = reply->attributes.mtime.useconds; + np->nn_stat.st_ctime = reply->attributes.ctime.seconds; + np->nn_stat.st_ctime_usec = reply->attributes.ctime.useconds; + /* Deal with other values appropriately? */ + + err = 0; + } + + deallocate_reply_buffer (reply); + return err; +} + -- cgit v1.2.3