UKERNEL: add uafs_statvfs

Change-Id: Iedd7882f4a57cd89d145f1c61c5f85181187db03
Reviewed-on: http://gerrit.openafs.org/1716
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Andrew Deason 2010-04-08 14:49:53 -05:00 committed by Derrick Brashear
parent f7b1923642
commit b822971a3e
3 changed files with 35 additions and 0 deletions

View File

@ -1919,6 +1919,25 @@ uafs_Init(char *rn, char *mountDirParam, char *confDirParam,
return;
}
int
uafs_statvfs(struct statvfs *buf)
{
int rc;
AFS_GLOCK();
rc = afs_statvfs(&afs_RootVfs, buf);
AFS_GUNLOCK();
if (rc) {
errno = rc;
return -1;
}
return 0;
}
void
uafs_Shutdown(void)
{

View File

@ -151,5 +151,6 @@ extern int uafs_RPCStatsEnablePeer(void);
extern int uafs_RPCStatsDisablePeer(void);
extern int uafs_IsRoot(char *path);
extern int uafs_statmountpoint_r(char *path);
extern int uafs_statvfs(struct statvfs *buf);
#endif /* __AFS_USROPS_H__ */

View File

@ -119,6 +119,21 @@ afs_statfs(register struct vfs *afsp, struct statfs *abp)
return 0;
}
int
afs_statvfs(struct vfs *afsp, struct statvfs *abp)
{
AFS_STATCNT(afs_statfs);
abp->f_frsize = 1024;
abp->f_favail = 9000000;
abp->f_bsize = afsp->vfs_bsize;
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
abp->f_ffree = 9000000;
abp->f_fsid = (AFS_VFSMAGIC << 16) || AFS_VFSFSID;
return 0;
}
int
afs_mountroot(void)
{