Re: [f2fs-dev] [RFC PATCH 2/2] f2fs: simplify free nid management
Hi Gu, The reason why I added the state of free nids was to avoid race conditions. [Without state transition] Thread 1:Thread 2: alloc_nid() - get a free nid : X alloc_nid() - remove X from the list - no free nids
[f2fs-dev] [RFC PATCH 2/2] f2fs: simplify free nid management
Previously, in the free nid management, we use two states to describe the state of a free nid entry: NID_NEW /* newly added to free nid list */ NID_ALLOC /* it is allocated, but not really used*/ When we alloc a new nid from free nid list, we just change the state from *NID_NEW* to