* Implement fstatfs() for (NFS) file handles. */
| 820 | * Implement fstatfs() for (NFS) file handles. |
| 821 | */ |
| 822 | int |
| 823 | freebsd11_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. |
nothing calls this directly
no test coverage detected