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)
1219
1219
1220
1220
bool get_close_on_exec (unsigned int fd )
1221
1221
{
1222
- struct files_struct * files = current -> files ;
1223
- struct fdtable * fdt ;
1224
1222
bool res ;
1225
1223
rcu_read_lock ();
1226
- fdt = files_fdtable (files );
1227
- res = close_on_exec (fd , fdt );
1224
+ res = close_on_exec (fd , current -> files );
1228
1225
rcu_read_unlock ();
1229
1226
return res ;
1230
1227
}
Original file line number Diff line number Diff line change @@ -39,10 +39,8 @@ static int seq_show(struct seq_file *m, void *v)
39
39
spin_lock (& files -> file_lock );
40
40
file = files_lookup_fd_locked (files , fd );
41
41
if (file ) {
42
- struct fdtable * fdt = files_fdtable (files );
43
-
44
42
f_flags = file -> f_flags ;
45
- if (close_on_exec (fd , fdt ))
43
+ if (close_on_exec (fd , files ))
46
44
f_flags |= O_CLOEXEC ;
47
45
48
46
get_file (file );
Original file line number Diff line number Diff line change @@ -33,11 +33,6 @@ struct fdtable {
33
33
struct rcu_head rcu ;
34
34
};
35
35
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
-
41
36
static inline bool fd_is_open (unsigned int fd , const struct fdtable * fdt )
42
37
{
43
38
return test_bit (fd , fdt -> open_fds );
@@ -107,6 +102,11 @@ struct file *lookup_fdget_rcu(unsigned int fd);
107
102
struct file * task_lookup_fdget_rcu (struct task_struct * task , unsigned int fd );
108
103
struct file * task_lookup_next_fdget_rcu (struct task_struct * task , unsigned int * fd );
109
104
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
+
110
110
struct task_struct ;
111
111
112
112
void put_files_struct (struct files_struct * fs );
You can’t perform that action at this time.
0 commit comments