aboutsummaryrefslogtreecommitdiff
path: root/sys/netsmb
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/netsmb
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/netsmb')
-rw-r--r--sys/netsmb/smb_dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/netsmb/smb_dev.c b/sys/netsmb/smb_dev.c
index 71c9432328bc..f88d14330c4a 100644
--- a/sys/netsmb/smb_dev.c
+++ b/sys/netsmb/smb_dev.c
@@ -380,7 +380,6 @@ int
smb_dev2share(int fd, int mode, struct smb_cred *scred,
struct smb_share **sspp, struct smb_dev **ssdp)
{
- cap_rights_t rights;
struct file *fp, *fptmp;
struct smb_dev *sdp;
struct smb_share *ssp;
@@ -388,7 +387,7 @@ smb_dev2share(int fd, int mode, struct smb_cred *scred,
int error;
td = curthread;
- error = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp);
+ error = fget(td, fd, &cap_read_rights, &fp);
if (error)
return (error);
fptmp = td->td_fpop;