Why fput is SMP safe?

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

 



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/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux