Skip to content

Commit

Permalink
fix f_count description in Documentation/filesystems/files.txt
Browse files Browse the repository at this point in the history
Documentation/filesystems/files.txt was not updated when
f_count became an atomic_long_t.
atomic_long_inc_not_zero() is now used instead of atomic_inc_not_zero()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Eric Dumazet authored and Al Viro committed Dec 31, 2008
1 parent 1239f26 commit fd659fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Documentation/filesystems/files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ the fdtable structure -
5. Handling of the file structures is special. Since the look-up
of the fd (fget()/fget_light()) are lock-free, it is possible
that look-up may race with the last put() operation on the
file structure. This is avoided using atomic_inc_not_zero()
file structure. This is avoided using atomic_long_inc_not_zero()
on ->f_count :

rcu_read_lock();
file = fcheck_files(files, fd);
if (file) {
if (atomic_inc_not_zero(&file->f_count))
if (atomic_long_inc_not_zero(&file->f_count))
*fput_needed = 1;
else
/* Didn't get the reference, someone's freed */
Expand All @@ -92,7 +92,7 @@ the fdtable structure -
....
return file;

atomic_inc_not_zero() detects if refcounts is already zero or
atomic_long_inc_not_zero() detects if refcounts is already zero or
goes to zero during increment. If it does, we fail
fget()/fget_light().

Expand Down

0 comments on commit fd659fd

Please sign in to comment.