diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-08-18 23:18:40 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-08-18 23:18:40 +0000 |
commit | 1d0cd383e9c80cc07ea8ddd32157657e3842caaa (patch) | |
tree | 8fffbdb4be95026191f825874d8cc82e5e4ccfee /nfs/ops.c | |
parent | 5fec5844a41a345898fdbe3ad03d083c08b5bb45 (diff) |
entered into RCS
Diffstat (limited to 'nfs/ops.c')
-rw-r--r-- | nfs/ops.c | 41 |
1 files changed, 40 insertions, 1 deletions
@@ -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; +} + |