diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
commit | 0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch) | |
tree | 41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /fs/f2fs | |
parent | aa877175e7a9982233ed8f10cb4bfddd78d82741 (diff) | |
parent | 3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff) |
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 2 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 12 | ||||
-rw-r--r-- | fs/f2fs/file.c | 13 | ||||
-rw-r--r-- | fs/f2fs/node.c | 47 | ||||
-rw-r--r-- | fs/f2fs/super.c | 6 |
5 files changed, 40 insertions, 40 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index d64d2a515cb2..ccb401eebc11 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -1699,11 +1699,11 @@ static int f2fs_write_end(struct file *file, | |||
1699 | trace_f2fs_write_end(inode, pos, len, copied); | 1699 | trace_f2fs_write_end(inode, pos, len, copied); |
1700 | 1700 | ||
1701 | set_page_dirty(page); | 1701 | set_page_dirty(page); |
1702 | f2fs_put_page(page, 1); | ||
1703 | 1702 | ||
1704 | if (pos + copied > i_size_read(inode)) | 1703 | if (pos + copied > i_size_read(inode)) |
1705 | f2fs_i_size_write(inode, pos + copied); | 1704 | f2fs_i_size_write(inode, pos + copied); |
1706 | 1705 | ||
1706 | f2fs_put_page(page, 1); | ||
1707 | f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); | 1707 | f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); |
1708 | return copied; | 1708 | return copied; |
1709 | } | 1709 | } |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 675fa79d86f6..14f5fe2b841e 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -538,7 +538,7 @@ struct f2fs_nm_info { | |||
538 | /* NAT cache management */ | 538 | /* NAT cache management */ |
539 | struct radix_tree_root nat_root;/* root of the nat entry cache */ | 539 | struct radix_tree_root nat_root;/* root of the nat entry cache */ |
540 | struct radix_tree_root nat_set_root;/* root of the nat set cache */ | 540 | struct radix_tree_root nat_set_root;/* root of the nat set cache */ |
541 | struct percpu_rw_semaphore nat_tree_lock; /* protect nat_tree_lock */ | 541 | struct rw_semaphore nat_tree_lock; /* protect nat_tree_lock */ |
542 | struct list_head nat_entries; /* cached nat entry list (clean) */ | 542 | struct list_head nat_entries; /* cached nat entry list (clean) */ |
543 | unsigned int nat_cnt; /* the # of cached nat entries */ | 543 | unsigned int nat_cnt; /* the # of cached nat entries */ |
544 | unsigned int dirty_nat_cnt; /* total num of nat entries in set */ | 544 | unsigned int dirty_nat_cnt; /* total num of nat entries in set */ |
@@ -787,7 +787,7 @@ struct f2fs_sb_info { | |||
787 | struct f2fs_checkpoint *ckpt; /* raw checkpoint pointer */ | 787 | struct f2fs_checkpoint *ckpt; /* raw checkpoint pointer */ |
788 | struct inode *meta_inode; /* cache meta blocks */ | 788 | struct inode *meta_inode; /* cache meta blocks */ |
789 | struct mutex cp_mutex; /* checkpoint procedure lock */ | 789 | struct mutex cp_mutex; /* checkpoint procedure lock */ |
790 | struct percpu_rw_semaphore cp_rwsem; /* blocking FS operations */ | 790 | struct rw_semaphore cp_rwsem; /* blocking FS operations */ |
791 | struct rw_semaphore node_write; /* locking node writes */ | 791 | struct rw_semaphore node_write; /* locking node writes */ |
792 | wait_queue_head_t cp_wait; | 792 | wait_queue_head_t cp_wait; |
793 | unsigned long last_time[MAX_TIME]; /* to store time in jiffies */ | 793 | unsigned long last_time[MAX_TIME]; /* to store time in jiffies */ |
@@ -1074,22 +1074,22 @@ static inline void clear_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) | |||
1074 | 1074 | ||
1075 | static inline void f2fs_lock_op(struct f2fs_sb_info *sbi) | 1075 | static inline void f2fs_lock_op(struct f2fs_sb_info *sbi) |
1076 | { | 1076 | { |
1077 | percpu_down_read(&sbi->cp_rwsem); | 1077 | down_read(&sbi->cp_rwsem); |
1078 | } | 1078 | } |
1079 | 1079 | ||
1080 | static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi) | 1080 | static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi) |
1081 | { | 1081 | { |
1082 | percpu_up_read(&sbi->cp_rwsem); | 1082 | up_read(&sbi->cp_rwsem); |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | static inline void f2fs_lock_all(struct f2fs_sb_info *sbi) | 1085 | static inline void f2fs_lock_all(struct f2fs_sb_info *sbi) |
1086 | { | 1086 | { |
1087 | percpu_down_write(&sbi->cp_rwsem); | 1087 | down_write(&sbi->cp_rwsem); |
1088 | } | 1088 | } |
1089 | 1089 | ||
1090 | static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi) | 1090 | static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi) |
1091 | { | 1091 | { |
1092 | percpu_up_write(&sbi->cp_rwsem); | 1092 | up_write(&sbi->cp_rwsem); |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | static inline int __get_cp_reason(struct f2fs_sb_info *sbi) | 1095 | static inline int __get_cp_reason(struct f2fs_sb_info *sbi) |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 0e493f63ea41..47abb96098e4 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -2086,15 +2086,19 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, | |||
2086 | if (unlikely(f2fs_readonly(src->i_sb))) | 2086 | if (unlikely(f2fs_readonly(src->i_sb))) |
2087 | return -EROFS; | 2087 | return -EROFS; |
2088 | 2088 | ||
2089 | if (S_ISDIR(src->i_mode) || S_ISDIR(dst->i_mode)) | 2089 | if (!S_ISREG(src->i_mode) || !S_ISREG(dst->i_mode)) |
2090 | return -EISDIR; | 2090 | return -EINVAL; |
2091 | 2091 | ||
2092 | if (f2fs_encrypted_inode(src) || f2fs_encrypted_inode(dst)) | 2092 | if (f2fs_encrypted_inode(src) || f2fs_encrypted_inode(dst)) |
2093 | return -EOPNOTSUPP; | 2093 | return -EOPNOTSUPP; |
2094 | 2094 | ||
2095 | inode_lock(src); | 2095 | inode_lock(src); |
2096 | if (src != dst) | 2096 | if (src != dst) { |
2097 | inode_lock(dst); | 2097 | if (!inode_trylock(dst)) { |
2098 | ret = -EBUSY; | ||
2099 | goto out; | ||
2100 | } | ||
2101 | } | ||
2098 | 2102 | ||
2099 | ret = -EINVAL; | 2103 | ret = -EINVAL; |
2100 | if (pos_in + len > src->i_size || pos_in + len < pos_in) | 2104 | if (pos_in + len > src->i_size || pos_in + len < pos_in) |
@@ -2152,6 +2156,7 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, | |||
2152 | out_unlock: | 2156 | out_unlock: |
2153 | if (src != dst) | 2157 | if (src != dst) |
2154 | inode_unlock(dst); | 2158 | inode_unlock(dst); |
2159 | out: | ||
2155 | inode_unlock(src); | 2160 | inode_unlock(src); |
2156 | return ret; | 2161 | return ret; |
2157 | } | 2162 | } |
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index b2fa4b615925..f75d197d5beb 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c | |||
@@ -206,14 +206,14 @@ int need_dentry_mark(struct f2fs_sb_info *sbi, nid_t nid) | |||
206 | struct nat_entry *e; | 206 | struct nat_entry *e; |
207 | bool need = false; | 207 | bool need = false; |
208 | 208 | ||
209 | percpu_down_read(&nm_i->nat_tree_lock); | 209 | down_read(&nm_i->nat_tree_lock); |
210 | e = __lookup_nat_cache(nm_i, nid); | 210 | e = __lookup_nat_cache(nm_i, nid); |
211 | if (e) { | 211 | if (e) { |
212 | if (!get_nat_flag(e, IS_CHECKPOINTED) && | 212 | if (!get_nat_flag(e, IS_CHECKPOINTED) && |
213 | !get_nat_flag(e, HAS_FSYNCED_INODE)) | 213 | !get_nat_flag(e, HAS_FSYNCED_INODE)) |
214 | need = true; | 214 | need = true; |
215 | } | 215 | } |
216 | percpu_up_read(&nm_i->nat_tree_lock); | 216 | up_read(&nm_i->nat_tree_lock); |
217 | return need; | 217 | return need; |
218 | } | 218 | } |
219 | 219 | ||
@@ -223,11 +223,11 @@ bool is_checkpointed_node(struct f2fs_sb_info *sbi, nid_t nid) | |||
223 | struct nat_entry *e; | 223 | struct nat_entry *e; |
224 | bool is_cp = true; | 224 | bool is_cp = true; |
225 | 225 | ||
226 | percpu_down_read(&nm_i->nat_tree_lock); | 226 | down_read(&nm_i->nat_tree_lock); |
227 | e = __lookup_nat_cache(nm_i, nid); | 227 | e = __lookup_nat_cache(nm_i, nid); |
228 | if (e && !get_nat_flag(e, IS_CHECKPOINTED)) | 228 | if (e && !get_nat_flag(e, IS_CHECKPOINTED)) |
229 | is_cp = false; | 229 | is_cp = false; |
230 | percpu_up_read(&nm_i->nat_tree_lock); | 230 | up_read(&nm_i->nat_tree_lock); |
231 | return is_cp; | 231 | return is_cp; |
232 | } | 232 | } |
233 | 233 | ||
@@ -237,13 +237,13 @@ bool need_inode_block_update(struct f2fs_sb_info *sbi, nid_t ino) | |||
237 | struct nat_entry *e; | 237 | struct nat_entry *e; |
238 | bool need_update = true; | 238 | bool need_update = true; |
239 | 239 | ||
240 | percpu_down_read(&nm_i->nat_tree_lock); | 240 | down_read(&nm_i->nat_tree_lock); |
241 | e = __lookup_nat_cache(nm_i, ino); | 241 | e = __lookup_nat_cache(nm_i, ino); |
242 | if (e && get_nat_flag(e, HAS_LAST_FSYNC) && | 242 | if (e && get_nat_flag(e, HAS_LAST_FSYNC) && |
243 | (get_nat_flag(e, IS_CHECKPOINTED) || | 243 | (get_nat_flag(e, IS_CHECKPOINTED) || |
244 | get_nat_flag(e, HAS_FSYNCED_INODE))) | 244 | get_nat_flag(e, HAS_FSYNCED_INODE))) |
245 | need_update = false; | 245 | need_update = false; |
246 | percpu_up_read(&nm_i->nat_tree_lock); | 246 | up_read(&nm_i->nat_tree_lock); |
247 | return need_update; | 247 | return need_update; |
248 | } | 248 | } |
249 | 249 | ||
@@ -284,7 +284,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, | |||
284 | struct f2fs_nm_info *nm_i = NM_I(sbi); | 284 | struct f2fs_nm_info *nm_i = NM_I(sbi); |
285 | struct nat_entry *e; | 285 | struct nat_entry *e; |
286 | 286 | ||
287 | percpu_down_write(&nm_i->nat_tree_lock); | 287 | down_write(&nm_i->nat_tree_lock); |
288 | e = __lookup_nat_cache(nm_i, ni->nid); | 288 | e = __lookup_nat_cache(nm_i, ni->nid); |
289 | if (!e) { | 289 | if (!e) { |
290 | e = grab_nat_entry(nm_i, ni->nid); | 290 | e = grab_nat_entry(nm_i, ni->nid); |
@@ -334,7 +334,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni, | |||
334 | set_nat_flag(e, HAS_FSYNCED_INODE, true); | 334 | set_nat_flag(e, HAS_FSYNCED_INODE, true); |
335 | set_nat_flag(e, HAS_LAST_FSYNC, fsync_done); | 335 | set_nat_flag(e, HAS_LAST_FSYNC, fsync_done); |
336 | } | 336 | } |
337 | percpu_up_write(&nm_i->nat_tree_lock); | 337 | up_write(&nm_i->nat_tree_lock); |
338 | } | 338 | } |
339 | 339 | ||
340 | int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) | 340 | int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) |
@@ -342,7 +342,8 @@ int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) | |||
342 | struct f2fs_nm_info *nm_i = NM_I(sbi); | 342 | struct f2fs_nm_info *nm_i = NM_I(sbi); |
343 | int nr = nr_shrink; | 343 | int nr = nr_shrink; |
344 | 344 | ||
345 | percpu_down_write(&nm_i->nat_tree_lock); | 345 | if (!down_write_trylock(&nm_i->nat_tree_lock)) |
346 | return 0; | ||
346 | 347 | ||
347 | while (nr_shrink && !list_empty(&nm_i->nat_entries)) { | 348 | while (nr_shrink && !list_empty(&nm_i->nat_entries)) { |
348 | struct nat_entry *ne; | 349 | struct nat_entry *ne; |
@@ -351,7 +352,7 @@ int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) | |||
351 | __del_from_nat_cache(nm_i, ne); | 352 | __del_from_nat_cache(nm_i, ne); |
352 | nr_shrink--; | 353 | nr_shrink--; |
353 | } | 354 | } |
354 | percpu_up_write(&nm_i->nat_tree_lock); | 355 | up_write(&nm_i->nat_tree_lock); |
355 | return nr - nr_shrink; | 356 | return nr - nr_shrink; |
356 | } | 357 | } |
357 | 358 | ||
@@ -373,13 +374,13 @@ void get_node_info(struct f2fs_sb_info *sbi, nid_t nid, struct node_info *ni) | |||
373 | ni->nid = nid; | 374 | ni->nid = nid; |
374 | 375 | ||
375 | /* Check nat cache */ | 376 | /* Check nat cache */ |
376 | percpu_down_read(&nm_i->nat_tree_lock); | 377 | down_read(&nm_i->nat_tree_lock); |
377 | e = __lookup_nat_cache(nm_i, nid); | 378 | e = __lookup_nat_cache(nm_i, nid); |
378 | if (e) { | 379 | if (e) { |
379 | ni->ino = nat_get_ino(e); | 380 | ni->ino = nat_get_ino(e); |
380 | ni->blk_addr = nat_get_blkaddr(e); | 381 | ni->blk_addr = nat_get_blkaddr(e); |
381 | ni->version = nat_get_version(e); | 382 | ni->version = nat_get_version(e); |
382 | percpu_up_read(&nm_i->nat_tree_lock); | 383 | up_read(&nm_i->nat_tree_lock); |
383 | return; | 384 | return; |
384 | } | 385 | } |
385 | 386 | ||
@@ -403,11 +404,11 @@ void get_node_info(struct f2fs_sb_info *sbi, nid_t nid, struct node_info *ni) | |||
403 | node_info_from_raw_nat(ni, &ne); | 404 | node_info_from_raw_nat(ni, &ne); |
404 | f2fs_put_page(page, 1); | 405 | f2fs_put_page(page, 1); |
405 | cache: | 406 | cache: |
406 | percpu_up_read(&nm_i->nat_tree_lock); | 407 | up_read(&nm_i->nat_tree_lock); |
407 | /* cache nat entry */ | 408 | /* cache nat entry */ |
408 | percpu_down_write(&nm_i->nat_tree_lock); | 409 | down_write(&nm_i->nat_tree_lock); |
409 | cache_nat_entry(sbi, nid, &ne); | 410 | cache_nat_entry(sbi, nid, &ne); |
410 | percpu_up_write(&nm_i->nat_tree_lock); | 411 | up_write(&nm_i->nat_tree_lock); |
411 | } | 412 | } |
412 | 413 | ||
413 | /* | 414 | /* |
@@ -1788,7 +1789,7 @@ void build_free_nids(struct f2fs_sb_info *sbi) | |||
1788 | ra_meta_pages(sbi, NAT_BLOCK_OFFSET(nid), FREE_NID_PAGES, | 1789 | ra_meta_pages(sbi, NAT_BLOCK_OFFSET(nid), FREE_NID_PAGES, |
1789 | META_NAT, true); | 1790 | META_NAT, true); |
1790 | 1791 | ||
1791 | percpu_down_read(&nm_i->nat_tree_lock); | 1792 | down_read(&nm_i->nat_tree_lock); |
1792 | 1793 | ||
1793 | while (1) { | 1794 | while (1) { |
1794 | struct page *page = get_current_nat_page(sbi, nid); | 1795 | struct page *page = get_current_nat_page(sbi, nid); |
@@ -1820,7 +1821,7 @@ void build_free_nids(struct f2fs_sb_info *sbi) | |||
1820 | remove_free_nid(nm_i, nid); | 1821 | remove_free_nid(nm_i, nid); |
1821 | } | 1822 | } |
1822 | up_read(&curseg->journal_rwsem); | 1823 | up_read(&curseg->journal_rwsem); |
1823 | percpu_up_read(&nm_i->nat_tree_lock); | 1824 | up_read(&nm_i->nat_tree_lock); |
1824 | 1825 | ||
1825 | ra_meta_pages(sbi, NAT_BLOCK_OFFSET(nm_i->next_scan_nid), | 1826 | ra_meta_pages(sbi, NAT_BLOCK_OFFSET(nm_i->next_scan_nid), |
1826 | nm_i->ra_nid_pages, META_NAT, false); | 1827 | nm_i->ra_nid_pages, META_NAT, false); |
@@ -2209,7 +2210,7 @@ void flush_nat_entries(struct f2fs_sb_info *sbi) | |||
2209 | if (!nm_i->dirty_nat_cnt) | 2210 | if (!nm_i->dirty_nat_cnt) |
2210 | return; | 2211 | return; |
2211 | 2212 | ||
2212 | percpu_down_write(&nm_i->nat_tree_lock); | 2213 | down_write(&nm_i->nat_tree_lock); |
2213 | 2214 | ||
2214 | /* | 2215 | /* |
2215 | * if there are no enough space in journal to store dirty nat | 2216 | * if there are no enough space in journal to store dirty nat |
@@ -2232,7 +2233,7 @@ void flush_nat_entries(struct f2fs_sb_info *sbi) | |||
2232 | list_for_each_entry_safe(set, tmp, &sets, set_list) | 2233 | list_for_each_entry_safe(set, tmp, &sets, set_list) |
2233 | __flush_nat_entry_set(sbi, set); | 2234 | __flush_nat_entry_set(sbi, set); |
2234 | 2235 | ||
2235 | percpu_up_write(&nm_i->nat_tree_lock); | 2236 | up_write(&nm_i->nat_tree_lock); |
2236 | 2237 | ||
2237 | f2fs_bug_on(sbi, nm_i->dirty_nat_cnt); | 2238 | f2fs_bug_on(sbi, nm_i->dirty_nat_cnt); |
2238 | } | 2239 | } |
@@ -2268,8 +2269,7 @@ static int init_node_manager(struct f2fs_sb_info *sbi) | |||
2268 | 2269 | ||
2269 | mutex_init(&nm_i->build_lock); | 2270 | mutex_init(&nm_i->build_lock); |
2270 | spin_lock_init(&nm_i->free_nid_list_lock); | 2271 | spin_lock_init(&nm_i->free_nid_list_lock); |
2271 | if (percpu_init_rwsem(&nm_i->nat_tree_lock)) | 2272 | init_rwsem(&nm_i->nat_tree_lock); |
2272 | return -ENOMEM; | ||
2273 | 2273 | ||
2274 | nm_i->next_scan_nid = le32_to_cpu(sbi->ckpt->next_free_nid); | 2274 | nm_i->next_scan_nid = le32_to_cpu(sbi->ckpt->next_free_nid); |
2275 | nm_i->bitmap_size = __bitmap_size(sbi, NAT_BITMAP); | 2275 | nm_i->bitmap_size = __bitmap_size(sbi, NAT_BITMAP); |
@@ -2326,7 +2326,7 @@ void destroy_node_manager(struct f2fs_sb_info *sbi) | |||
2326 | spin_unlock(&nm_i->free_nid_list_lock); | 2326 | spin_unlock(&nm_i->free_nid_list_lock); |
2327 | 2327 | ||
2328 | /* destroy nat cache */ | 2328 | /* destroy nat cache */ |
2329 | percpu_down_write(&nm_i->nat_tree_lock); | 2329 | down_write(&nm_i->nat_tree_lock); |
2330 | while ((found = __gang_lookup_nat_cache(nm_i, | 2330 | while ((found = __gang_lookup_nat_cache(nm_i, |
2331 | nid, NATVEC_SIZE, natvec))) { | 2331 | nid, NATVEC_SIZE, natvec))) { |
2332 | unsigned idx; | 2332 | unsigned idx; |
@@ -2351,9 +2351,8 @@ void destroy_node_manager(struct f2fs_sb_info *sbi) | |||
2351 | kmem_cache_free(nat_entry_set_slab, setvec[idx]); | 2351 | kmem_cache_free(nat_entry_set_slab, setvec[idx]); |
2352 | } | 2352 | } |
2353 | } | 2353 | } |
2354 | percpu_up_write(&nm_i->nat_tree_lock); | 2354 | up_write(&nm_i->nat_tree_lock); |
2355 | 2355 | ||
2356 | percpu_free_rwsem(&nm_i->nat_tree_lock); | ||
2357 | kfree(nm_i->nat_bitmap); | 2356 | kfree(nm_i->nat_bitmap); |
2358 | sbi->nm_info = NULL; | 2357 | sbi->nm_info = NULL; |
2359 | kfree(nm_i); | 2358 | kfree(nm_i); |
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 1b86d3f638ef..7f863a645ab1 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -706,8 +706,6 @@ static void destroy_percpu_info(struct f2fs_sb_info *sbi) | |||
706 | percpu_counter_destroy(&sbi->nr_pages[i]); | 706 | percpu_counter_destroy(&sbi->nr_pages[i]); |
707 | percpu_counter_destroy(&sbi->alloc_valid_block_count); | 707 | percpu_counter_destroy(&sbi->alloc_valid_block_count); |
708 | percpu_counter_destroy(&sbi->total_valid_inode_count); | 708 | percpu_counter_destroy(&sbi->total_valid_inode_count); |
709 | |||
710 | percpu_free_rwsem(&sbi->cp_rwsem); | ||
711 | } | 709 | } |
712 | 710 | ||
713 | static void f2fs_put_super(struct super_block *sb) | 711 | static void f2fs_put_super(struct super_block *sb) |
@@ -1483,9 +1481,6 @@ static int init_percpu_info(struct f2fs_sb_info *sbi) | |||
1483 | { | 1481 | { |
1484 | int i, err; | 1482 | int i, err; |
1485 | 1483 | ||
1486 | if (percpu_init_rwsem(&sbi->cp_rwsem)) | ||
1487 | return -ENOMEM; | ||
1488 | |||
1489 | for (i = 0; i < NR_COUNT_TYPE; i++) { | 1484 | for (i = 0; i < NR_COUNT_TYPE; i++) { |
1490 | err = percpu_counter_init(&sbi->nr_pages[i], 0, GFP_KERNEL); | 1485 | err = percpu_counter_init(&sbi->nr_pages[i], 0, GFP_KERNEL); |
1491 | if (err) | 1486 | if (err) |
@@ -1686,6 +1681,7 @@ try_onemore: | |||
1686 | sbi->write_io[i].bio = NULL; | 1681 | sbi->write_io[i].bio = NULL; |
1687 | } | 1682 | } |
1688 | 1683 | ||
1684 | init_rwsem(&sbi->cp_rwsem); | ||
1689 | init_waitqueue_head(&sbi->cp_wait); | 1685 | init_waitqueue_head(&sbi->cp_wait); |
1690 | init_sb_info(sbi); | 1686 | init_sb_info(sbi); |
1691 | 1687 | ||