checkpoint.c (734d1ece37fbf3d2ddfc71bc6c69e0fe35f02542) checkpoint.c (6e6093a8f144414d904575da5fdea40cf14fb63e)
1/*
2 * fs/f2fs/checkpoint.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 200 unchanged lines hidden (view full) ---

209 }
210retry:
211 new = kmem_cache_alloc(orphan_entry_slab, GFP_ATOMIC);
212 if (!new) {
213 cond_resched();
214 goto retry;
215 }
216 new->ino = ino;
1/*
2 * fs/f2fs/checkpoint.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 200 unchanged lines hidden (view full) ---

209 }
210retry:
211 new = kmem_cache_alloc(orphan_entry_slab, GFP_ATOMIC);
212 if (!new) {
213 cond_resched();
214 goto retry;
215 }
216 new->ino = ino;
217 INIT_LIST_HEAD(&new->list);
218
219 /* add new_oentry into list which is sorted by inode number */
220 if (orphan) {
221 struct orphan_inode_entry *prev;
222
223 /* get previous entry */
224 prev = list_entry(orphan->list.prev, typeof(*prev), list);
225 if (&prev->list != head)

--- 541 unchanged lines hidden (view full) ---

767
768void init_orphan_info(struct f2fs_sb_info *sbi)
769{
770 mutex_init(&sbi->orphan_inode_mutex);
771 INIT_LIST_HEAD(&sbi->orphan_inode_list);
772 sbi->n_orphans = 0;
773}
774
217
218 /* add new_oentry into list which is sorted by inode number */
219 if (orphan) {
220 struct orphan_inode_entry *prev;
221
222 /* get previous entry */
223 prev = list_entry(orphan->list.prev, typeof(*prev), list);
224 if (&prev->list != head)

--- 541 unchanged lines hidden (view full) ---

766
767void init_orphan_info(struct f2fs_sb_info *sbi)
768{
769 mutex_init(&sbi->orphan_inode_mutex);
770 INIT_LIST_HEAD(&sbi->orphan_inode_list);
771 sbi->n_orphans = 0;
772}
773
775int create_checkpoint_caches(void)
774int __init create_checkpoint_caches(void)
776{
777 orphan_entry_slab = f2fs_kmem_cache_create("f2fs_orphan_entry",
778 sizeof(struct orphan_inode_entry), NULL);
779 if (unlikely(!orphan_entry_slab))
780 return -ENOMEM;
781 inode_entry_slab = f2fs_kmem_cache_create("f2fs_dirty_dir_entry",
782 sizeof(struct dir_inode_entry), NULL);
783 if (unlikely(!inode_entry_slab)) {
784 kmem_cache_destroy(orphan_entry_slab);
785 return -ENOMEM;
786 }
787 return 0;
788}
789
790void destroy_checkpoint_caches(void)
791{
792 kmem_cache_destroy(orphan_entry_slab);
793 kmem_cache_destroy(inode_entry_slab);
794}
775{
776 orphan_entry_slab = f2fs_kmem_cache_create("f2fs_orphan_entry",
777 sizeof(struct orphan_inode_entry), NULL);
778 if (unlikely(!orphan_entry_slab))
779 return -ENOMEM;
780 inode_entry_slab = f2fs_kmem_cache_create("f2fs_dirty_dir_entry",
781 sizeof(struct dir_inode_entry), NULL);
782 if (unlikely(!inode_entry_slab)) {
783 kmem_cache_destroy(orphan_entry_slab);
784 return -ENOMEM;
785 }
786 return 0;
787}
788
789void destroy_checkpoint_caches(void)
790{
791 kmem_cache_destroy(orphan_entry_slab);
792 kmem_cache_destroy(inode_entry_slab);
793}