summaryrefslogtreecommitdiffstats
path: root/fs/coda/upcall.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
commit0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch)
tree5085c389f09da78182b899d19fe1068b619a69dd /fs/coda/upcall.c
parent273767781288c35c9d679e908672b9996cda4c34 (diff)
Merge with 2.3.10.
Diffstat (limited to 'fs/coda/upcall.c')
-rw-r--r--fs/coda/upcall.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index a0c1092b2..62fd62e35 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -580,6 +580,33 @@ int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
return error;
}
+int venus_statfs(struct super_block *sb, struct statfs *sfs)
+{
+ union inputArgs *inp;
+ union outputArgs *outp;
+ int insize, outsize, error;
+
+ insize = max(INSIZE(statfs), OUTSIZE(statfs));
+ UPARG(CODA_STATFS);
+
+ error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
+
+ if (!error) {
+ sfs->f_blocks = outp->coda_statfs.stat.f_blocks;
+ sfs->f_bfree = outp->coda_statfs.stat.f_bfree;
+ sfs->f_bavail = outp->coda_statfs.stat.f_bavail;
+ sfs->f_files = outp->coda_statfs.stat.f_files;
+ sfs->f_ffree = outp->coda_statfs.stat.f_ffree;
+ } else {
+ printk("coda_statfs: Venus returns: %d\n", error);
+ }
+
+ if (inp) CODA_FREE(inp, insize);
+ CDEBUG(D_INODE, " result %d\n",error);
+ EXIT;
+ return error;
+}
+
/*
* coda_upcall and coda_downcall routines.
*
@@ -588,10 +615,12 @@ int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
static inline unsigned long coda_waitfor_upcall(struct upc_req *vmp)
{
DECLARE_WAITQUEUE(wait, current);
- unsigned long posttime;
+ struct timeval begin = { 0, 0 }, end = { 0, 0 };
vmp->uc_posttime = jiffies;
- posttime = jiffies;
+
+ if (coda_upcall_timestamping)
+ do_gettimeofday(&begin);
add_wait_queue(&vmp->uc_sleep, &wait);
for (;;) {
@@ -620,9 +649,20 @@ static inline unsigned long coda_waitfor_upcall(struct upc_req *vmp)
remove_wait_queue(&vmp->uc_sleep, &wait);
current->state = TASK_RUNNING;
- CDEBUG(D_SPECIAL, "posttime: %ld, returned: %ld\n", posttime, jiffies-posttime);
- return (jiffies - posttime);
+ if (coda_upcall_timestamping && begin.tv_sec != 0) {
+ do_gettimeofday(&end);
+
+ if (end.tv_usec < begin.tv_usec) {
+ end.tv_usec += 1000000; end.tv_sec--;
+ }
+ end.tv_sec -= begin.tv_sec;
+ end.tv_usec -= begin.tv_usec;
+ }
+
+ CDEBUG(D_SPECIAL, "begin: %ld.%06ld, elapsed: %ld.%06ld\n",
+ begin.tv_sec, begin.tv_usec, end.tv_sec, end.tv_usec);
+ return ((end.tv_sec * 1000000) + end.tv_usec);
}