Lines Matching +full:look +full:- +full:up

1 .. SPDX-License-Identifier: GPL-2.0
10 Up until 2.6.12, the file descriptor table has been protected
11 with a lock (files->file_lock) and reference count (files->count).
12 ->file_lock protected accesses to all the file related fields
13 of the table. ->count was used for sharing the file descriptor
19 reference count (->f_count).
21 In the new lock-free model of file descriptor management,
24 elements - the fd sets (open_fds and close_on_exec, the
27 a lock-free reader, all the elements of the file descriptor
28 table are in a separate structure - struct fdtable.
33 and files->fdtab points to the new structure. The fdtable
34 structure is freed with RCU and lock-free readers either
37 the fdtable structure -
48 if (n <= fdt->max_fds)
54 the memory barrier requirements for lock-free dereference.
55 The fdtable pointer must be read within the read-side
61 3. For any update to the fd table, files->file_lock must
64 4. To look up the file structure given an fd, a reader
66 take care of barrier requirements due to lock-free lookup.
80 5. Handling of the file structures is special. Since the look-up
81 of the fd (fget()/fget_light()) are lock-free, it is possible
82 that look-up may race with the last put() operation on the
84 on ->f_count::
89 if (atomic_long_inc_not_zero(&file->f_count))
103 6. Since both fdtable and file structures can be looked up
104 lock-free, they must be installed using rcu_assign_pointer()
105 API. If they are looked up lock-free, rcu_dereference()
109 7. While updating, the fdtable pointer must be looked up while
110 holding files->file_lock. If ->file_lock is dropped, then
116 spin_lock(&files->file_lock);
123 spin_unlock(&files->file_lock);
126 Since locate_fd() can drop ->file_lock (and reacquire ->file_lock),