checkpoint.c (87a9bd265678ec3cc8431b14bcb14c68d0f94032) checkpoint.c (7bd59381c82defe19875284c48b1ac9dacd16e8f)
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

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

221 list_for_each(this, head) {
222 orphan = list_entry(this, struct orphan_inode_entry, list);
223 if (orphan->ino == ino)
224 goto out;
225 if (orphan->ino > ino)
226 break;
227 orphan = NULL;
228 }
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

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

221 list_for_each(this, head) {
222 orphan = list_entry(this, struct orphan_inode_entry, list);
223 if (orphan->ino == ino)
224 goto out;
225 if (orphan->ino > ino)
226 break;
227 orphan = NULL;
228 }
229retry:
230 new = kmem_cache_alloc(orphan_entry_slab, GFP_ATOMIC);
231 if (!new) {
232 cond_resched();
233 goto retry;
234 }
229
230 new = f2fs_kmem_cache_alloc(orphan_entry_slab, GFP_ATOMIC);
235 new->ino = ino;
236
237 /* add new_oentry into list which is sorted by inode number */
238 if (orphan)
239 list_add(&new->list, this->prev);
240 else
241 list_add_tail(&new->list, head);
242out:

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

479
480void set_dirty_dir_page(struct inode *inode, struct page *page)
481{
482 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
483 struct dir_inode_entry *new;
484
485 if (!S_ISDIR(inode->i_mode))
486 return;
231 new->ino = ino;
232
233 /* add new_oentry into list which is sorted by inode number */
234 if (orphan)
235 list_add(&new->list, this->prev);
236 else
237 list_add_tail(&new->list, head);
238out:

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

475
476void set_dirty_dir_page(struct inode *inode, struct page *page)
477{
478 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
479 struct dir_inode_entry *new;
480
481 if (!S_ISDIR(inode->i_mode))
482 return;
487retry:
488 new = kmem_cache_alloc(inode_entry_slab, GFP_NOFS);
489 if (!new) {
490 cond_resched();
491 goto retry;
492 }
483
484 new = f2fs_kmem_cache_alloc(inode_entry_slab, GFP_NOFS);
493 new->inode = inode;
494 INIT_LIST_HEAD(&new->list);
495
496 spin_lock(&sbi->dir_inode_lock);
497 if (__add_dirty_inode(inode, new))
498 kmem_cache_free(inode_entry_slab, new);
499
500 inc_page_count(sbi, F2FS_DIRTY_DENTS);
501 inode_inc_dirty_dents(inode);
502 SetPagePrivate(page);
503 spin_unlock(&sbi->dir_inode_lock);
504}
505
506void add_dirty_dir_inode(struct inode *inode)
507{
508 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
485 new->inode = inode;
486 INIT_LIST_HEAD(&new->list);
487
488 spin_lock(&sbi->dir_inode_lock);
489 if (__add_dirty_inode(inode, new))
490 kmem_cache_free(inode_entry_slab, new);
491
492 inc_page_count(sbi, F2FS_DIRTY_DENTS);
493 inode_inc_dirty_dents(inode);
494 SetPagePrivate(page);
495 spin_unlock(&sbi->dir_inode_lock);
496}
497
498void add_dirty_dir_inode(struct inode *inode)
499{
500 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
509 struct dir_inode_entry *new;
510retry:
511 new = kmem_cache_alloc(inode_entry_slab, GFP_NOFS);
512 if (!new) {
513 cond_resched();
514 goto retry;
515 }
501 struct dir_inode_entry *new =
502 f2fs_kmem_cache_alloc(inode_entry_slab, GFP_NOFS);
503
516 new->inode = inode;
517 INIT_LIST_HEAD(&new->list);
518
519 spin_lock(&sbi->dir_inode_lock);
520 if (__add_dirty_inode(inode, new))
521 kmem_cache_free(inode_entry_slab, new);
522 spin_unlock(&sbi->dir_inode_lock);
523}

--- 329 unchanged lines hidden ---
504 new->inode = inode;
505 INIT_LIST_HEAD(&new->list);
506
507 spin_lock(&sbi->dir_inode_lock);
508 if (__add_dirty_inode(inode, new))
509 kmem_cache_free(inode_entry_slab, new);
510 spin_unlock(&sbi->dir_inode_lock);
511}

--- 329 unchanged lines hidden ---