@@ -196,22 +196,22 @@ int acquire_orphan_inode(struct f2fs_sb_info *sbi)
196196{
197197 int err = 0 ;
198198
199- mutex_lock (& sbi -> orphan_inode_mutex );
199+ spin_lock (& sbi -> orphan_inode_lock );
200200 if (unlikely (sbi -> n_orphans >= sbi -> max_orphans ))
201201 err = - ENOSPC ;
202202 else
203203 sbi -> n_orphans ++ ;
204- mutex_unlock (& sbi -> orphan_inode_mutex );
204+ spin_unlock (& sbi -> orphan_inode_lock );
205205
206206 return err ;
207207}
208208
209209void release_orphan_inode (struct f2fs_sb_info * sbi )
210210{
211- mutex_lock (& sbi -> orphan_inode_mutex );
211+ spin_lock (& sbi -> orphan_inode_lock );
212212 f2fs_bug_on (sbi -> n_orphans == 0 );
213213 sbi -> n_orphans -- ;
214- mutex_unlock (& sbi -> orphan_inode_mutex );
214+ spin_unlock (& sbi -> orphan_inode_lock );
215215}
216216
217217void add_orphan_inode (struct f2fs_sb_info * sbi , nid_t ino )
@@ -222,12 +222,12 @@ void add_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
222222 new = f2fs_kmem_cache_alloc (orphan_entry_slab , GFP_ATOMIC );
223223 new -> ino = ino ;
224224
225- mutex_lock (& sbi -> orphan_inode_mutex );
225+ spin_lock (& sbi -> orphan_inode_lock );
226226 head = & sbi -> orphan_inode_list ;
227227 list_for_each (this , head ) {
228228 orphan = list_entry (this , struct orphan_inode_entry , list );
229229 if (orphan -> ino == ino ) {
230- mutex_unlock (& sbi -> orphan_inode_mutex );
230+ spin_unlock (& sbi -> orphan_inode_lock );
231231 kmem_cache_free (orphan_entry_slab , new );
232232 return ;
233233 }
@@ -242,15 +242,15 @@ void add_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
242242 list_add (& new -> list , this -> prev );
243243 else
244244 list_add_tail (& new -> list , head );
245- mutex_unlock (& sbi -> orphan_inode_mutex );
245+ spin_unlock (& sbi -> orphan_inode_lock );
246246}
247247
248248void remove_orphan_inode (struct f2fs_sb_info * sbi , nid_t ino )
249249{
250250 struct list_head * head ;
251251 struct orphan_inode_entry * orphan ;
252252
253- mutex_lock (& sbi -> orphan_inode_mutex );
253+ spin_lock (& sbi -> orphan_inode_lock );
254254 head = & sbi -> orphan_inode_list ;
255255 list_for_each_entry (orphan , head , list ) {
256256 if (orphan -> ino == ino ) {
@@ -261,7 +261,7 @@ void remove_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
261261 break ;
262262 }
263263 }
264- mutex_unlock (& sbi -> orphan_inode_mutex );
264+ spin_unlock (& sbi -> orphan_inode_lock );
265265}
266266
267267static void recover_orphan_inode (struct f2fs_sb_info * sbi , nid_t ino )
@@ -318,7 +318,7 @@ static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk)
318318 pages [index ] = grab_meta_page (sbi , start_blk + index );
319319
320320 index = 1 ;
321- mutex_lock (& sbi -> orphan_inode_mutex );
321+ spin_lock (& sbi -> orphan_inode_lock );
322322 head = & sbi -> orphan_inode_list ;
323323
324324 /* loop for each orphan inode entry and write them in Jornal block */
@@ -357,7 +357,7 @@ static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk)
357357 f2fs_put_page (page , 1 );
358358 }
359359
360- mutex_unlock (& sbi -> orphan_inode_mutex );
360+ spin_unlock (& sbi -> orphan_inode_lock );
361361}
362362
363363static struct page * validate_checkpoint (struct f2fs_sb_info * sbi ,
@@ -828,7 +828,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
828828
829829void init_orphan_info (struct f2fs_sb_info * sbi )
830830{
831- mutex_init (& sbi -> orphan_inode_mutex );
831+ spin_lock_init (& sbi -> orphan_inode_lock );
832832 INIT_LIST_HEAD (& sbi -> orphan_inode_list );
833833 sbi -> n_orphans = 0 ;
834834 /*
0 commit comments