MCPcopy Create free account
hub / github.com/F-Stack/f-stack / freebsd11_fhstatfs

Function freebsd11_fhstatfs

freebsd/kern/vfs_syscalls.c:822–841  ·  view source on GitHub ↗

* Implement fstatfs() for (NFS) file handles. */

Source from the content-addressed store, hash-verified

820 * Implement fstatfs() for (NFS) file handles.
821 */
822int
823freebsd11_fhstatfs(struct thread *td, struct freebsd11_fhstatfs_args *uap)
824{
825 struct freebsd11_statfs osb;
826 struct statfs *sfp;
827 fhandle_t fh;
828 int error;
829
830 error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t));
831 if (error)
832 return (error);
833 sfp = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
834 error = kern_fhstatfs(td, fh, sfp);
835 if (error == 0) {
836 freebsd11_cvtstatfs(sfp, &osb);
837 error = copyout(&osb, uap->buf, sizeof(osb));
838 }
839 free(sfp, M_STATFS);
840 return (error);
841}
842
843/*
844 * Convert a new format statfs structure to an old format statfs structure.

Callers

nothing calls this directly

Calls 6

mallocFunction · 0.85
kern_fhstatfsFunction · 0.85
freebsd11_cvtstatfsFunction · 0.85
freeFunction · 0.70
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected