Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71867
b: refs/heads/master
c: 9454742
h: refs/heads/master
i:
  71865: 6a3fb1a
  71863: 5841fba
v: v3
  • Loading branch information
Eric Dumazet authored and Adrian Bunk committed Oct 19, 2007
1 parent 785ce21 commit 1a05321
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6888c1ecd63a3e5e206048602b3f59b58f4ffd8f
refs/heads/master: 94547426db2f4f2aad2f640ca074ccb1c6f7e660
6 changes: 3 additions & 3 deletions trunk/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 the rcuref APIs
file structure. This is avoided using atomic_inc_not_zero()
on ->f_count :

rcu_read_lock();
file = fcheck_files(files, fd);
if (file) {
if (rcuref_inc_lf(&file->f_count))
if (atomic_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;

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
fget()/fget_light().

Expand Down

0 comments on commit 1a05321

Please sign in to comment.