diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 04:26:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 04:26:47 -0400 |
| commit | ab34c02afeafd047a831e6fe2a4dd875ce86bee0 (patch) | |
| tree | 833e385e8387e3d4d4531ade23c1d92fba8ed075 /fs/nilfs2/gcdat.c | |
| parent | 7f3883962870dd28b5f2322ac44a9d03640ef448 (diff) | |
| parent | 6b81e14e645016597c81e71cd27ee5c57c3a3c36 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (36 commits)
nilfs2: eliminate sparse warning - "context imbalance"
nilfs2: eliminate sparse warnings - "symbol not declared"
nilfs2: get rid of bdi from nilfs object
nilfs2: change license of exported header file
nilfs2: add bdev freeze/thaw support
nilfs2: accept 64-bit checkpoint numbers in cp mount option
nilfs2: remove own inode allocator and destructor for metadata files
nilfs2: get rid of back pointer to writable sb instance
nilfs2: get rid of mi_nilfs back pointer to nilfs object
nilfs2: see state of root dentry for mount check of snapshots
nilfs2: use iget for all metadata files
nilfs2: get rid of GCDAT inode
nilfs2: add routines to redirect access to buffers of DAT file
nilfs2: add routines to roll back state of DAT file
nilfs2: add routines to save and restore bmap state
nilfs2: do not allocate nilfs_mdt_info structure to gc-inodes
nilfs2: allow nilfs_clear_inode to clear metadata file inodes
nilfs2: get rid of snapshot mount flag
nilfs2: simplify life cycle management of nilfs object
nilfs2: do not allocate multiple super block instances for a device
...
Diffstat (limited to 'fs/nilfs2/gcdat.c')
| -rw-r--r-- | fs/nilfs2/gcdat.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/fs/nilfs2/gcdat.c b/fs/nilfs2/gcdat.c deleted file mode 100644 index 84a45d1d5464..000000000000 --- a/fs/nilfs2/gcdat.c +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * gcdat.c - NILFS shadow DAT inode for GC | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005-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 | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | * | ||
| 20 | * Written by Seiji Kihara <kihara@osrg.net>, Amagai Yoshiji <amagai@osrg.net>, | ||
| 21 | * and Ryusuke Konishi <ryusuke@osrg.net>. | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include <linux/buffer_head.h> | ||
| 26 | #include "nilfs.h" | ||
| 27 | #include "page.h" | ||
| 28 | #include "mdt.h" | ||
| 29 | |||
| 30 | int nilfs_init_gcdat_inode(struct the_nilfs *nilfs) | ||
| 31 | { | ||
| 32 | struct inode *dat = nilfs->ns_dat, *gcdat = nilfs->ns_gc_dat; | ||
| 33 | struct nilfs_inode_info *dii = NILFS_I(dat), *gii = NILFS_I(gcdat); | ||
| 34 | int err; | ||
| 35 | |||
| 36 | gcdat->i_state = 0; | ||
| 37 | gcdat->i_blocks = dat->i_blocks; | ||
| 38 | gii->i_flags = dii->i_flags; | ||
| 39 | gii->i_state = dii->i_state | (1 << NILFS_I_GCDAT); | ||
| 40 | gii->i_cno = 0; | ||
| 41 | nilfs_bmap_init_gcdat(gii->i_bmap, dii->i_bmap); | ||
| 42 | err = nilfs_copy_dirty_pages(gcdat->i_mapping, dat->i_mapping); | ||
| 43 | if (unlikely(err)) | ||
| 44 | return err; | ||
| 45 | |||
| 46 | return nilfs_copy_dirty_pages(&gii->i_btnode_cache, | ||
| 47 | &dii->i_btnode_cache); | ||
| 48 | } | ||
| 49 | |||
| 50 | void nilfs_commit_gcdat_inode(struct the_nilfs *nilfs) | ||
| 51 | { | ||
| 52 | struct inode *dat = nilfs->ns_dat, *gcdat = nilfs->ns_gc_dat; | ||
| 53 | struct nilfs_inode_info *dii = NILFS_I(dat), *gii = NILFS_I(gcdat); | ||
| 54 | struct address_space *mapping = dat->i_mapping; | ||
| 55 | struct address_space *gmapping = gcdat->i_mapping; | ||
| 56 | |||
| 57 | down_write(&NILFS_MDT(dat)->mi_sem); | ||
| 58 | dat->i_blocks = gcdat->i_blocks; | ||
| 59 | dii->i_flags = gii->i_flags; | ||
| 60 | dii->i_state = gii->i_state & ~(1 << NILFS_I_GCDAT); | ||
| 61 | |||
| 62 | nilfs_bmap_commit_gcdat(gii->i_bmap, dii->i_bmap); | ||
| 63 | |||
| 64 | nilfs_palloc_clear_cache(dat); | ||
| 65 | nilfs_palloc_clear_cache(gcdat); | ||
| 66 | nilfs_clear_dirty_pages(mapping); | ||
| 67 | nilfs_copy_back_pages(mapping, gmapping); | ||
| 68 | /* note: mdt dirty flags should be cleared by segctor. */ | ||
| 69 | |||
| 70 | nilfs_clear_dirty_pages(&dii->i_btnode_cache); | ||
| 71 | nilfs_copy_back_pages(&dii->i_btnode_cache, &gii->i_btnode_cache); | ||
| 72 | |||
| 73 | up_write(&NILFS_MDT(dat)->mi_sem); | ||
| 74 | } | ||
| 75 | |||
| 76 | void nilfs_clear_gcdat_inode(struct the_nilfs *nilfs) | ||
| 77 | { | ||
| 78 | struct inode *gcdat = nilfs->ns_gc_dat; | ||
| 79 | struct nilfs_inode_info *gii = NILFS_I(gcdat); | ||
| 80 | |||
| 81 | gcdat->i_state = I_FREEING | I_CLEAR; | ||
| 82 | gii->i_flags = 0; | ||
| 83 | |||
| 84 | nilfs_palloc_clear_cache(gcdat); | ||
| 85 | truncate_inode_pages(gcdat->i_mapping, 0); | ||
| 86 | truncate_inode_pages(&gii->i_btnode_cache, 0); | ||
| 87 | } | ||
