diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-02-20 13:05:29 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-02-20 13:05:29 +0000 |
commit | 0eee862a5427f8d1975b1b3152949558489afaf7 (patch) | |
tree | 7eab17a425e09a913acc34c0b450fa5ccedd74c7 /sys/kern/vfs_syscalls.c | |
parent | 3d919b75217236f2d55d0e821f4d164916310581 (diff) | |
download | src-test2-0eee862a5427f8d1975b1b3152949558489afaf7.tar.gz src-test2-0eee862a5427f8d1975b1b3152949558489afaf7.zip |
Notes
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 80da9b750190..ad69698b196b 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -339,8 +339,6 @@ kern_statfs(struct thread *td, char *path, enum uio_seg pathseg, out: vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); - if (mtx_owned(&Giant)) - printf("statfs(%d): %s: %d\n", vfslocked, path, error); return (error); } @@ -2343,6 +2341,15 @@ int kern_statat(struct thread *td, int flag, int fd, char *path, enum uio_seg pathseg, struct stat *sbp) { + + return (kern_statat_vnhook(td, flag, fd, path, pathseg, sbp, NULL)); +} + +int +kern_statat_vnhook(struct thread *td, int flag, int fd, char *path, + enum uio_seg pathseg, struct stat *sbp, + void (*hook)(struct vnode *vp, struct stat *sbp)) +{ struct nameidata nd; struct stat sb; int error, vfslocked; @@ -2362,12 +2369,12 @@ kern_statat(struct thread *td, int flag, int fd, char *path, SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0); if (S_ISREG(sb.st_mode)) SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0); + if (__predict_false(hook != NULL)) + hook(nd.ni_vp, &sb); } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); - if (mtx_owned(&Giant)) - printf("stat(%d): %s\n", vfslocked, path); if (error) return (error); *sbp = sb; |