[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why fput is SMP safe?



I don't understand why fput is SMP safe. It calls atomic_dec_and_test(), if 
the return value is true, it then directly goes to the clean up section. 
But after atomic_dec_and_test() (and before the clean up is done), another 
process can still call fget(). I mean, I doesn't see fput acquire any lock 
that can prevent fget be executed. Where I am wrong?

-- 
Haoqiang Zheng
Columbia University
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/