Skip to content

Commit

Permalink
fd_is_open(): move to fs/file.c
Browse files Browse the repository at this point in the history
no users outside that...

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 15, 2024
1 parent f60d374 commit c4aab26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions include/linux/fdtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ struct fdtable {
struct rcu_head rcu;
};

static inline bool fd_is_open(unsigned int fd, const struct fdtable *fdt)
{
return test_bit(fd, fdt->open_fds);
}

/*
* Open file table structure
*/
Expand Down

0 comments on commit c4aab26

Please sign in to comment.