diff mbox series

[2/6] fd_is_open(): move to fs/file.c

Message ID 20240406045730.GB1632446@ZenIV (mailing list archive)
State New
Headers show
Series [1/6] close_on_exec(): pass files_struct instead of fdtable | expand

Commit Message

Al Viro April 6, 2024, 4:57 a.m. UTC
no users outside that...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/file.c               | 5 +++++
 include/linux/fdtable.h | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Christian Brauner April 9, 2024, 9:21 a.m. UTC | #1
On Sat, Apr 06, 2024 at 05:57:30AM +0100, Al Viro wrote:
> no users outside that...
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---

Reviewed-by: Christian Brauner <brauner@kernel.org>
diff mbox series

Patch

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;
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index cc060b20502b..2944d4aa413b 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -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
  */