Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fix f_count description in Documentation/filesystems/files.txt

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>

authored by

Eric Dumazet and committed by
Al Viro
fd659fd6 1239f26c

+3 -3
+3 -3
Documentation/filesystems/files.txt
··· 76 76 5. Handling of the file structures is special. Since the look-up 77 77 of the fd (fget()/fget_light()) are lock-free, it is possible 78 78 that look-up may race with the last put() operation on the 79 - file structure. This is avoided using atomic_inc_not_zero() 79 + file structure. This is avoided using atomic_long_inc_not_zero() 80 80 on ->f_count : 81 81 82 82 rcu_read_lock(); 83 83 file = fcheck_files(files, fd); 84 84 if (file) { 85 - if (atomic_inc_not_zero(&file->f_count)) 85 + if (atomic_long_inc_not_zero(&file->f_count)) 86 86 *fput_needed = 1; 87 87 else 88 88 /* Didn't get the reference, someone's freed */ ··· 92 92 .... 93 93 return file; 94 94 95 - atomic_inc_not_zero() detects if refcounts is already zero or 95 + atomic_long_inc_not_zero() detects if refcounts is already zero or 96 96 goes to zero during increment. If it does, we fail 97 97 fget()/fget_light(). 98 98