X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=Documentation%2Ffilesystems%2Ffiles.txt;h=ac2facc50d2a2b2914d10a3268c3ae375ae57d6c;hb=e0aa51f54faa0659b529143de6c608e76675326f;hp=bb0142f6108458f6ccd27b90e965a6bdf820e501;hpb=41f81e88e01eb959f439f8537c58078e4bfc5291;p=mv-sheeva.git diff --git a/Documentation/filesystems/files.txt b/Documentation/filesystems/files.txt index bb0142f6108..ac2facc50d2 100644 --- a/Documentation/filesystems/files.txt +++ b/Documentation/filesystems/files.txt @@ -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 */ @@ -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().