summaryrefslogtreecommitdiff
path: root/fs/file.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-01-04 21:45:47 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2024-04-15 16:03:24 -0400
commitc4aab26253cd1f302279b8d6b5b66ccf1b120520 (patch)
treec7773fd719105433627faab93e2503f3c2247e13 /fs/file.c
parentf60d374d2cc88034385265d193a38e3f4a4b430c (diff)
fd_is_open(): move to fs/file.c
no users outside that... Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file.c')
-rw-r--r--fs/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/file.c b/fs/file.c
index eff5ce79f66a..ab38b005633c 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -271,6 +271,11 @@ static inline void __clear_open_fd(unsigned int fd, struct fdtable *fdt)
__clear_bit(fd / BITS_PER_LONG, fdt->full_fds_bits);
}
+static inline bool fd_is_open(unsigned int fd, const struct fdtable *fdt)
+{
+ return test_bit(fd, fdt->open_fds);
+}
+
static unsigned int count_open_files(struct fdtable *fdt)
{
unsigned int size = fdt->max_fds;