aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-01-13 14:16:38 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-01-13 15:29:34 +0000
commit5753be8e432f26b02c0bd06d7dd84316ddc50ed5 (patch)
tree3bf22a1a8eb67ec785391271eba881f6e01fb853 /sys/sys
parent8f54940f019ca586bcfbf189ef9974eeb0a8194a (diff)
downloadsrc-5753be8e432f26b02c0bd06d7dd84316ddc50ed5.tar.gz
src-5753be8e432f26b02c0bd06d7dd84316ddc50ed5.zip
fd: add refcount argument to falloc_noinstall
This lets callers avoid atomic ops by initializing the count to required value from the get go. While here add falloc_abort to backpedal from this without having to fdrop.
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/filedesc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h
index f0cae3ed6911..9b65c7a66054 100644
--- a/sys/sys/filedesc.h
+++ b/sys/sys/filedesc.h
@@ -229,7 +229,9 @@ int dupfdopen(struct thread *td, struct filedesc *fdp, int dfd, int mode,
int openerror, int *indxp);
int falloc_caps(struct thread *td, struct file **resultfp, int *resultfd,
int flags, struct filecaps *fcaps);
-int falloc_noinstall(struct thread *td, struct file **resultfp);
+void falloc_abort(struct thread *td, struct file *fp);
+int _falloc_noinstall(struct thread *td, struct file **resultfp, u_int n);
+#define falloc_noinstall(td, resultfp) _falloc_noinstall(td, resultfp, 1)
void _finstall(struct filedesc *fdp, struct file *fp, int fd, int flags,
struct filecaps *fcaps);
int finstall(struct thread *td, struct file *fp, int *resultfd, int flags,