diff options
author | kib <kib@FreeBSD.org> | 2015-12-22 20:37:34 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-12-22 20:37:34 +0000 |
commit | 76abdf80abd52cbd12cc65ecf3dde21790190789 (patch) | |
tree | e2a5d62f098471bcf5bafa2b393dd67bf0fadc43 /sys/sys/fcntl.h | |
parent | 3808bf980c2c46dcb44722f214c1d89db5b6c04d (diff) | |
download | FreeBSD-src-76abdf80abd52cbd12cc65ecf3dde21790190789.zip FreeBSD-src-76abdf80abd52cbd12cc65ecf3dde21790190789.tar.gz |
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
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 5793229..0467b2a 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) |