File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -1219,12 +1219,9 @@ void set_close_on_exec(unsigned int fd, int flag)
12191219
12201220bool get_close_on_exec (unsigned int fd )
12211221{
1222- struct files_struct * files = current -> files ;
1223- struct fdtable * fdt ;
12241222 bool res ;
12251223 rcu_read_lock ();
1226- fdt = files_fdtable (files );
1227- res = close_on_exec (fd , fdt );
1224+ res = close_on_exec (fd , current -> files );
12281225 rcu_read_unlock ();
12291226 return res ;
12301227}
Original file line number Diff line number Diff line change @@ -39,10 +39,8 @@ static int seq_show(struct seq_file *m, void *v)
3939 spin_lock (& files -> file_lock );
4040 file = files_lookup_fd_locked (files , fd );
4141 if (file ) {
42- struct fdtable * fdt = files_fdtable (files );
43-
4442 f_flags = file -> f_flags ;
45- if (close_on_exec (fd , fdt ))
43+ if (close_on_exec (fd , files ))
4644 f_flags |= O_CLOEXEC ;
4745
4846 get_file (file );
Original file line number Diff line number Diff line change @@ -33,11 +33,6 @@ struct fdtable {
3333 struct rcu_head rcu ;
3434};
3535
36- static inline bool close_on_exec (unsigned int fd , const struct fdtable * fdt )
37- {
38- return test_bit (fd , fdt -> close_on_exec );
39- }
40-
4136static inline bool fd_is_open (unsigned int fd , const struct fdtable * fdt )
4237{
4338 return test_bit (fd , fdt -> open_fds );
@@ -107,6 +102,11 @@ struct file *lookup_fdget_rcu(unsigned int fd);
107102struct file * task_lookup_fdget_rcu (struct task_struct * task , unsigned int fd );
108103struct file * task_lookup_next_fdget_rcu (struct task_struct * task , unsigned int * fd );
109104
105+ static inline bool close_on_exec (unsigned int fd , const struct files_struct * files )
106+ {
107+ return test_bit (fd , files_fdtable (files )-> close_on_exec );
108+ }
109+
110110struct task_struct ;
111111
112112void put_files_struct (struct files_struct * fs );
You can’t perform that action at this time.
0 commit comments