aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/filemon/filemon.c
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2018-05-09 18:47:24 +0000
committerMatt Macy <mmacy@FreeBSD.org>2018-05-09 18:47:24 +0000
commitcbd92ce62e92bd17871c9668c2c2bebac3e2ac2e (patch)
tree40c405d5c0a6545e7dfd7beb64dc7e5076f7b644 /sys/dev/filemon/filemon.c
parent0272270a8d6fe4e6edb92de3e1711442e5d15766 (diff)
downloadsrc-cbd92ce62e92bd17871c9668c2c2bebac3e2ac2e.tar.gz
src-cbd92ce62e92bd17871c9668c2c2bebac3e2ac2e.zip
Eliminate the overhead of gratuitous repeated reinitialization of cap_rights
- Add macros to allow preinitialization of cap_rights_t. - Convert most commonly used code paths to use preinitialized cap_rights_t. A 3.6% speedup in fstat was measured with this change. Reported by: mjg Reviewed by: oshogbo Approved by: sbruno MFC after: 1 month
Notes
Notes: svn path=/head/; revision=333425
Diffstat (limited to 'sys/dev/filemon/filemon.c')
-rw-r--r--sys/dev/filemon/filemon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/filemon/filemon.c b/sys/dev/filemon/filemon.c
index 38c4eb3f4a56..80c3c28ff51a 100644
--- a/sys/dev/filemon/filemon.c
+++ b/sys/dev/filemon/filemon.c
@@ -361,7 +361,6 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused,
int error = 0;
struct filemon *filemon;
struct proc *p;
- cap_rights_t rights;
if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0)
return (error);
@@ -377,7 +376,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused,
}
error = fget_write(td, *(int *)data,
- cap_rights_init(&rights, CAP_PWRITE),
+ &cap_pwrite_rights,
&filemon->fp);
if (error == 0)
/* Write the file header. */