diff options
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/btnode.c | 6 | ||||
-rw-r--r-- | fs/nilfs2/btnode.h | 1 | ||||
-rw-r--r-- | fs/nilfs2/mdt.c | 4 | ||||
-rw-r--r-- | fs/nilfs2/nilfs.h | 6 | ||||
-rw-r--r-- | fs/nilfs2/page.c | 13 | ||||
-rw-r--r-- | fs/nilfs2/page.h | 2 | ||||
-rw-r--r-- | fs/nilfs2/segment.c | 16 | ||||
-rw-r--r-- | fs/nilfs2/super.c | 2 |
8 files changed, 14 insertions, 36 deletions
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index 481756042423..c353e4fa600c 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c | |||
@@ -34,12 +34,6 @@ | |||
34 | #include "page.h" | 34 | #include "page.h" |
35 | #include "btnode.h" | 35 | #include "btnode.h" |
36 | 36 | ||
37 | void nilfs_btnode_cache_init(struct address_space *btnc, | ||
38 | struct backing_dev_info *bdi) | ||
39 | { | ||
40 | nilfs_mapping_init(btnc, bdi); | ||
41 | } | ||
42 | |||
43 | void nilfs_btnode_cache_clear(struct address_space *btnc) | 37 | void nilfs_btnode_cache_clear(struct address_space *btnc) |
44 | { | 38 | { |
45 | invalidate_mapping_pages(btnc, 0, -1); | 39 | invalidate_mapping_pages(btnc, 0, -1); |
diff --git a/fs/nilfs2/btnode.h b/fs/nilfs2/btnode.h index 1b8ebd888c28..7de449c2e2a3 100644 --- a/fs/nilfs2/btnode.h +++ b/fs/nilfs2/btnode.h | |||
@@ -37,7 +37,6 @@ struct nilfs_btnode_chkey_ctxt { | |||
37 | struct buffer_head *newbh; | 37 | struct buffer_head *newbh; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *); | ||
41 | void nilfs_btnode_cache_clear(struct address_space *); | 40 | void nilfs_btnode_cache_clear(struct address_space *); |
42 | struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc, | 41 | struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc, |
43 | __u64 blocknr); | 42 | __u64 blocknr); |
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index a649b05f7069..6790ca689c17 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c | |||
@@ -450,9 +450,9 @@ int nilfs_mdt_setup_shadow_map(struct inode *inode, | |||
450 | 450 | ||
451 | INIT_LIST_HEAD(&shadow->frozen_buffers); | 451 | INIT_LIST_HEAD(&shadow->frozen_buffers); |
452 | address_space_init_once(&shadow->frozen_data); | 452 | address_space_init_once(&shadow->frozen_data); |
453 | nilfs_mapping_init(&shadow->frozen_data, bdi); | 453 | nilfs_mapping_init(&shadow->frozen_data, inode, bdi); |
454 | address_space_init_once(&shadow->frozen_btnodes); | 454 | address_space_init_once(&shadow->frozen_btnodes); |
455 | nilfs_mapping_init(&shadow->frozen_btnodes, bdi); | 455 | nilfs_mapping_init(&shadow->frozen_btnodes, inode, bdi); |
456 | mi->mi_shadow = shadow; | 456 | mi->mi_shadow = shadow; |
457 | return 0; | 457 | return 0; |
458 | } | 458 | } |
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index 09af00999ec0..a9c6a531f80c 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h | |||
@@ -80,12 +80,6 @@ static inline struct inode *NILFS_BTNC_I(struct address_space *btnc) | |||
80 | return &ii->vfs_inode; | 80 | return &ii->vfs_inode; |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline struct inode *NILFS_AS_I(struct address_space *mapping) | ||
84 | { | ||
85 | return (mapping->host) ? : | ||
86 | container_of(mapping, struct inode, i_data); | ||
87 | } | ||
88 | |||
89 | /* | 83 | /* |
90 | * Dynamic state flags of NILFS on-memory inode (i_state) | 84 | * Dynamic state flags of NILFS on-memory inode (i_state) |
91 | */ | 85 | */ |
diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index b3b988c2018f..3f18f5c076e8 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c | |||
@@ -182,7 +182,7 @@ int nilfs_page_buffers_clean(struct page *page) | |||
182 | void nilfs_page_bug(struct page *page) | 182 | void nilfs_page_bug(struct page *page) |
183 | { | 183 | { |
184 | struct address_space *m; | 184 | struct address_space *m; |
185 | unsigned long ino = 0; | 185 | unsigned long ino; |
186 | 186 | ||
187 | if (unlikely(!page)) { | 187 | if (unlikely(!page)) { |
188 | printk(KERN_CRIT "NILFS_PAGE_BUG(NULL)\n"); | 188 | printk(KERN_CRIT "NILFS_PAGE_BUG(NULL)\n"); |
@@ -190,11 +190,8 @@ void nilfs_page_bug(struct page *page) | |||
190 | } | 190 | } |
191 | 191 | ||
192 | m = page->mapping; | 192 | m = page->mapping; |
193 | if (m) { | 193 | ino = m ? m->host->i_ino : 0; |
194 | struct inode *inode = NILFS_AS_I(m); | 194 | |
195 | if (inode != NULL) | ||
196 | ino = inode->i_ino; | ||
197 | } | ||
198 | printk(KERN_CRIT "NILFS_PAGE_BUG(%p): cnt=%d index#=%llu flags=0x%lx " | 195 | printk(KERN_CRIT "NILFS_PAGE_BUG(%p): cnt=%d index#=%llu flags=0x%lx " |
199 | "mapping=%p ino=%lu\n", | 196 | "mapping=%p ino=%lu\n", |
200 | page, atomic_read(&page->_count), | 197 | page, atomic_read(&page->_count), |
@@ -441,10 +438,10 @@ unsigned nilfs_page_count_clean_buffers(struct page *page, | |||
441 | return nc; | 438 | return nc; |
442 | } | 439 | } |
443 | 440 | ||
444 | void nilfs_mapping_init(struct address_space *mapping, | 441 | void nilfs_mapping_init(struct address_space *mapping, struct inode *inode, |
445 | struct backing_dev_info *bdi) | 442 | struct backing_dev_info *bdi) |
446 | { | 443 | { |
447 | mapping->host = NULL; | 444 | mapping->host = inode; |
448 | mapping->flags = 0; | 445 | mapping->flags = 0; |
449 | mapping_set_gfp_mask(mapping, GFP_NOFS); | 446 | mapping_set_gfp_mask(mapping, GFP_NOFS); |
450 | mapping->assoc_mapping = NULL; | 447 | mapping->assoc_mapping = NULL; |
diff --git a/fs/nilfs2/page.h b/fs/nilfs2/page.h index f827afabd548..e301e5661c36 100644 --- a/fs/nilfs2/page.h +++ b/fs/nilfs2/page.h | |||
@@ -57,7 +57,7 @@ void nilfs_page_bug(struct page *); | |||
57 | int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); | 57 | int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); |
58 | void nilfs_copy_back_pages(struct address_space *, struct address_space *); | 58 | void nilfs_copy_back_pages(struct address_space *, struct address_space *); |
59 | void nilfs_clear_dirty_pages(struct address_space *); | 59 | void nilfs_clear_dirty_pages(struct address_space *); |
60 | void nilfs_mapping_init(struct address_space *mapping, | 60 | void nilfs_mapping_init(struct address_space *mapping, struct inode *inode, |
61 | struct backing_dev_info *bdi); | 61 | struct backing_dev_info *bdi); |
62 | unsigned nilfs_page_count_clean_buffers(struct page *, unsigned, unsigned); | 62 | unsigned nilfs_page_count_clean_buffers(struct page *, unsigned, unsigned); |
63 | unsigned long nilfs_find_uncommitted_extent(struct inode *inode, | 63 | unsigned long nilfs_find_uncommitted_extent(struct inode *inode, |
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 186cabbe54d7..eeb1bc2c76ca 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -655,13 +655,10 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode, | |||
655 | if (unlikely(page->index > last)) | 655 | if (unlikely(page->index > last)) |
656 | break; | 656 | break; |
657 | 657 | ||
658 | if (mapping->host) { | 658 | lock_page(page); |
659 | lock_page(page); | 659 | if (!page_has_buffers(page)) |
660 | if (!page_has_buffers(page)) | 660 | create_empty_buffers(page, 1 << inode->i_blkbits, 0); |
661 | create_empty_buffers(page, | 661 | unlock_page(page); |
662 | 1 << inode->i_blkbits, 0); | ||
663 | unlock_page(page); | ||
664 | } | ||
665 | 662 | ||
666 | bh = head = page_buffers(page); | 663 | bh = head = page_buffers(page); |
667 | do { | 664 | do { |
@@ -1503,10 +1500,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci, | |||
1503 | nblocks = le32_to_cpu(finfo->fi_nblocks); | 1500 | nblocks = le32_to_cpu(finfo->fi_nblocks); |
1504 | ndatablk = le32_to_cpu(finfo->fi_ndatablk); | 1501 | ndatablk = le32_to_cpu(finfo->fi_ndatablk); |
1505 | 1502 | ||
1506 | if (buffer_nilfs_node(bh)) | 1503 | inode = bh->b_page->mapping->host; |
1507 | inode = NILFS_BTNC_I(bh->b_page->mapping); | ||
1508 | else | ||
1509 | inode = NILFS_AS_I(bh->b_page->mapping); | ||
1510 | 1504 | ||
1511 | if (mode == SC_LSEG_DSYNC) | 1505 | if (mode == SC_LSEG_DSYNC) |
1512 | sc_op = &nilfs_sc_dsync_ops; | 1506 | sc_op = &nilfs_sc_dsync_ops; |
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 2846491071ce..8351c44a7320 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -166,7 +166,7 @@ struct inode *nilfs_alloc_inode(struct super_block *sb) | |||
166 | ii->i_state = 0; | 166 | ii->i_state = 0; |
167 | ii->i_cno = 0; | 167 | ii->i_cno = 0; |
168 | ii->vfs_inode.i_version = 1; | 168 | ii->vfs_inode.i_version = 1; |
169 | nilfs_btnode_cache_init(&ii->i_btnode_cache, sb->s_bdi); | 169 | nilfs_mapping_init(&ii->i_btnode_cache, &ii->vfs_inode, sb->s_bdi); |
170 | return &ii->vfs_inode; | 170 | return &ii->vfs_inode; |
171 | } | 171 | } |
172 | 172 | ||