diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2015-12-22 20:37:34 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2015-12-22 20:37:34 +0000 |
commit | cccac8a1ef5b58f91623066680e3b59d477f3885 (patch) | |
tree | e2a5d62f098471bcf5bafa2b393dd67bf0fadc43 /sys/sys/fcntl.h | |
parent | 6ee0db8b76fd94f513d929f0f209bd486b155bd1 (diff) | |
download | src-cccac8a1ef5b58f91623066680e3b59d477f3885.tar.gz src-cccac8a1ef5b58f91623066680e3b59d477f3885.zip |
Make it possible for the cdevsw d_close() driver method to detect last
close and close due to revoke(2)-like operation.
A new FLASTCLOSE flag indicates that this is last close. FREVOKE is
set for revokes, and FNONBLOCK is also set, same as is already done
for VOP_CLOSE() call from vgonel().
The flags reuse user open(2) flags which are never stored in f_flag,
to not consume bit space in the ABI visible way. Assert this with the
static check.
Requested and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=292624
Diffstat (limited to 'sys/sys/fcntl.h')
-rw-r--r-- | sys/sys/fcntl.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 5793229334bf..0467b2a43baf 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -138,6 +138,11 @@ typedef __pid_t pid_t; */ #ifdef _KERNEL + +/* Only for devfs d_close() flags. */ +#define FLASTCLOSE O_DIRECTORY +#define FREVOKE O_VERIFY + /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ #define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1) #define OFLAGS(fflags) ((fflags) & O_EXEC ? (fflags) : (fflags) - 1) |