Commit 94547426 authored by Eric Dumazet's avatar Eric Dumazet Committed by Adrian Bunk

Documentation/filesystems/files.txt: remove rcuref_inc_lf() reverences

rcuref_inc_lf() is not used anymore. Replace it by atomic_inc_not_zero()
Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
parent 6888c1ec
...@@ -76,13 +76,13 @@ the fdtable structure - ...@@ -76,13 +76,13 @@ the fdtable structure -
5. Handling of the file structures is special. Since the look-up 5. Handling of the file structures is special. Since the look-up
of the fd (fget()/fget_light()) are lock-free, it is possible of the fd (fget()/fget_light()) are lock-free, it is possible
that look-up may race with the last put() operation on the that look-up may race with the last put() operation on the
file structure. This is avoided using the rcuref APIs file structure. This is avoided using atomic_inc_not_zero()
on ->f_count : on ->f_count :
rcu_read_lock(); rcu_read_lock();
file = fcheck_files(files, fd); file = fcheck_files(files, fd);
if (file) { if (file) {
if (rcuref_inc_lf(&file->f_count)) if (atomic_inc_not_zero(&file->f_count))
*fput_needed = 1; *fput_needed = 1;
else else
/* Didn't get the reference, someone's freed */ /* Didn't get the reference, someone's freed */
...@@ -92,7 +92,7 @@ the fdtable structure - ...@@ -92,7 +92,7 @@ the fdtable structure -
.... ....
return file; return file;
rcuref_inc_lf() detects if refcounts is already zero or atomic_inc_not_zero() detects if refcounts is already zero or
goes to zero during increment. If it does, we fail goes to zero during increment. If it does, we fail
fget()/fget_light(). fget()/fget_light().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment