Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8318b01 authored by Al Viro's avatar Al Viro
Browse files

take __{set,clear}_{open_fd,close_on_exec}() into fs/file.c



nobody uses those outside anymore.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ee97cd87
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -256,6 +256,26 @@ int expand_files(struct files_struct *files, int nr)
	return expand_fdtable(files, nr);
}

static inline void __set_close_on_exec(int fd, struct fdtable *fdt)
{
	__set_bit(fd, fdt->close_on_exec);
}

static inline void __clear_close_on_exec(int fd, struct fdtable *fdt)
{
	__clear_bit(fd, fdt->close_on_exec);
}

static inline void __set_open_fd(int fd, struct fdtable *fdt)
{
	__set_bit(fd, fdt->open_fds);
}

static inline void __clear_open_fd(int fd, struct fdtable *fdt)
{
	__clear_bit(fd, fdt->open_fds);
}

static int count_open_files(struct fdtable *fdt)
{
	int size = fdt->max_fds;
+0 −20
Original line number Diff line number Diff line
@@ -30,31 +30,11 @@ struct fdtable {
	struct fdtable *next;
};

static inline void __set_close_on_exec(int fd, struct fdtable *fdt)
{
	__set_bit(fd, fdt->close_on_exec);
}

static inline void __clear_close_on_exec(int fd, struct fdtable *fdt)
{
	__clear_bit(fd, fdt->close_on_exec);
}

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

static inline void __set_open_fd(int fd, struct fdtable *fdt)
{
	__set_bit(fd, fdt->open_fds);
}

static inline void __clear_open_fd(int fd, struct fdtable *fdt)
{
	__clear_bit(fd, fdt->open_fds);
}

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