alloc.c (141bbdba9c2c1592d56b019277774099a5412aea) alloc.c (db38d5ad323362bfca118b52fe5906f97a69fb45)
1/*
2 * alloc.c - NILFS dat/inode allocator
3 *
4 * Copyright (C) 2006-2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

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

486 nilfs_mdt_mark_buffer_dirty(bitmap_bh);
487 nilfs_mdt_mark_dirty(inode);
488
489 brelse(bitmap_bh);
490 brelse(desc_bh);
491 }
492 return 0;
493}
1/*
2 * alloc.c - NILFS dat/inode allocator
3 *
4 * Copyright (C) 2006-2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

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

486 nilfs_mdt_mark_buffer_dirty(bitmap_bh);
487 nilfs_mdt_mark_dirty(inode);
488
489 brelse(bitmap_bh);
490 brelse(desc_bh);
491 }
492 return 0;
493}
494
495void nilfs_palloc_setup_cache(struct inode *inode,
496 struct nilfs_palloc_cache *cache)
497{
498 NILFS_MDT(inode)->mi_palloc_cache = cache;
499 spin_lock_init(&cache->lock);
500}
501
502void nilfs_palloc_clear_cache(struct inode *inode)
503{
504 struct nilfs_palloc_cache *cache = NILFS_MDT(inode)->mi_palloc_cache;
505
506 spin_lock(&cache->lock);
507 brelse(cache->prev_desc.bh);
508 brelse(cache->prev_bitmap.bh);
509 brelse(cache->prev_entry.bh);
510 cache->prev_desc.bh = NULL;
511 cache->prev_bitmap.bh = NULL;
512 cache->prev_entry.bh = NULL;
513 spin_unlock(&cache->lock);
514}
515
516void nilfs_palloc_destroy_cache(struct inode *inode)
517{
518 nilfs_palloc_clear_cache(inode);
519 NILFS_MDT(inode)->mi_palloc_cache = NULL;
520}