diff options
| author | Paul Moore <pmoore@redhat.com> | 2014-01-28 14:44:16 -0500 |
|---|---|---|
| committer | Paul Moore <pmoore@redhat.com> | 2014-02-05 10:39:48 -0500 |
| commit | 825e587af2e90e9b953849f3347a01d8f383d577 (patch) | |
| tree | e48942a05882da47544e179c6a0c920e00137a6a /fs/f2fs/data.c | |
| parent | 8ed814602876bec9bad2649ca17f34b499357a1c (diff) | |
| parent | d8ec26d7f8287f5788a494f56e8814210f0e64be (diff) | |
Merge tag 'v3.13' into stable-3.14
Linux 3.13
Conflicts:
security/selinux/hooks.c
Trivial merge issue in selinux_inet_conn_request() likely due to me
including patches that I sent to the stable folks in my next tree
resulting in the patch hitting twice (I think). Thankfully it was an
easy fix this time, but regardless, lesson learned, I will not do that
again.
Diffstat (limited to 'fs/f2fs/data.c')
| -rw-r--r-- | fs/f2fs/data.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 941f9b9ca3a5..aa3438c571fa 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
| @@ -68,9 +68,6 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
| 68 | struct buffer_head *bh_result) | 68 | struct buffer_head *bh_result) |
| 69 | { | 69 | { |
| 70 | struct f2fs_inode_info *fi = F2FS_I(inode); | 70 | struct f2fs_inode_info *fi = F2FS_I(inode); |
| 71 | #ifdef CONFIG_F2FS_STAT_FS | ||
| 72 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); | ||
| 73 | #endif | ||
| 74 | pgoff_t start_fofs, end_fofs; | 71 | pgoff_t start_fofs, end_fofs; |
| 75 | block_t start_blkaddr; | 72 | block_t start_blkaddr; |
| 76 | 73 | ||
| @@ -80,9 +77,8 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
| 80 | return 0; | 77 | return 0; |
| 81 | } | 78 | } |
| 82 | 79 | ||
| 83 | #ifdef CONFIG_F2FS_STAT_FS | 80 | stat_inc_total_hit(inode->i_sb); |
| 84 | sbi->total_hit_ext++; | 81 | |
| 85 | #endif | ||
| 86 | start_fofs = fi->ext.fofs; | 82 | start_fofs = fi->ext.fofs; |
| 87 | end_fofs = fi->ext.fofs + fi->ext.len - 1; | 83 | end_fofs = fi->ext.fofs + fi->ext.len - 1; |
| 88 | start_blkaddr = fi->ext.blk_addr; | 84 | start_blkaddr = fi->ext.blk_addr; |
| @@ -100,9 +96,7 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
| 100 | else | 96 | else |
| 101 | bh_result->b_size = UINT_MAX; | 97 | bh_result->b_size = UINT_MAX; |
| 102 | 98 | ||
| 103 | #ifdef CONFIG_F2FS_STAT_FS | 99 | stat_inc_read_hit(inode->i_sb); |
| 104 | sbi->read_hit_ext++; | ||
| 105 | #endif | ||
| 106 | read_unlock(&fi->ext.ext_lock); | 100 | read_unlock(&fi->ext.ext_lock); |
| 107 | return 1; | 101 | return 1; |
| 108 | } | 102 | } |
| @@ -116,7 +110,7 @@ void update_extent_cache(block_t blk_addr, struct dnode_of_data *dn) | |||
| 116 | pgoff_t fofs, start_fofs, end_fofs; | 110 | pgoff_t fofs, start_fofs, end_fofs; |
| 117 | block_t start_blkaddr, end_blkaddr; | 111 | block_t start_blkaddr, end_blkaddr; |
| 118 | 112 | ||
| 119 | BUG_ON(blk_addr == NEW_ADDR); | 113 | f2fs_bug_on(blk_addr == NEW_ADDR); |
| 120 | fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) + | 114 | fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) + |
| 121 | dn->ofs_in_node; | 115 | dn->ofs_in_node; |
| 122 | 116 | ||
| @@ -442,7 +436,7 @@ static int get_data_block_ro(struct inode *inode, sector_t iblock, | |||
| 442 | } | 436 | } |
| 443 | 437 | ||
| 444 | /* It does not support data allocation */ | 438 | /* It does not support data allocation */ |
| 445 | BUG_ON(create); | 439 | f2fs_bug_on(create); |
| 446 | 440 | ||
| 447 | if (dn.data_blkaddr != NEW_ADDR && dn.data_blkaddr != NULL_ADDR) { | 441 | if (dn.data_blkaddr != NEW_ADDR && dn.data_blkaddr != NULL_ADDR) { |
| 448 | int i; | 442 | int i; |
| @@ -560,9 +554,9 @@ write: | |||
| 560 | inode_dec_dirty_dents(inode); | 554 | inode_dec_dirty_dents(inode); |
| 561 | err = do_write_data_page(page); | 555 | err = do_write_data_page(page); |
| 562 | } else { | 556 | } else { |
| 563 | int ilock = mutex_lock_op(sbi); | 557 | f2fs_lock_op(sbi); |
| 564 | err = do_write_data_page(page); | 558 | err = do_write_data_page(page); |
| 565 | mutex_unlock_op(sbi, ilock); | 559 | f2fs_unlock_op(sbi); |
| 566 | need_balance_fs = true; | 560 | need_balance_fs = true; |
| 567 | } | 561 | } |
| 568 | if (err == -ENOENT) | 562 | if (err == -ENOENT) |
| @@ -641,7 +635,6 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping, | |||
| 641 | pgoff_t index = ((unsigned long long) pos) >> PAGE_CACHE_SHIFT; | 635 | pgoff_t index = ((unsigned long long) pos) >> PAGE_CACHE_SHIFT; |
| 642 | struct dnode_of_data dn; | 636 | struct dnode_of_data dn; |
| 643 | int err = 0; | 637 | int err = 0; |
| 644 | int ilock; | ||
| 645 | 638 | ||
| 646 | f2fs_balance_fs(sbi); | 639 | f2fs_balance_fs(sbi); |
| 647 | repeat: | 640 | repeat: |
| @@ -650,7 +643,7 @@ repeat: | |||
| 650 | return -ENOMEM; | 643 | return -ENOMEM; |
| 651 | *pagep = page; | 644 | *pagep = page; |
| 652 | 645 | ||
| 653 | ilock = mutex_lock_op(sbi); | 646 | f2fs_lock_op(sbi); |
| 654 | 647 | ||
| 655 | set_new_dnode(&dn, inode, NULL, NULL, 0); | 648 | set_new_dnode(&dn, inode, NULL, NULL, 0); |
| 656 | err = get_dnode_of_data(&dn, index, ALLOC_NODE); | 649 | err = get_dnode_of_data(&dn, index, ALLOC_NODE); |
| @@ -664,7 +657,7 @@ repeat: | |||
| 664 | if (err) | 657 | if (err) |
| 665 | goto err; | 658 | goto err; |
| 666 | 659 | ||
| 667 | mutex_unlock_op(sbi, ilock); | 660 | f2fs_unlock_op(sbi); |
| 668 | 661 | ||
| 669 | if ((len == PAGE_CACHE_SIZE) || PageUptodate(page)) | 662 | if ((len == PAGE_CACHE_SIZE) || PageUptodate(page)) |
| 670 | return 0; | 663 | return 0; |
| @@ -700,7 +693,7 @@ out: | |||
| 700 | return 0; | 693 | return 0; |
| 701 | 694 | ||
| 702 | err: | 695 | err: |
| 703 | mutex_unlock_op(sbi, ilock); | 696 | f2fs_unlock_op(sbi); |
| 704 | f2fs_put_page(page, 1); | 697 | f2fs_put_page(page, 1); |
| 705 | return err; | 698 | return err; |
| 706 | } | 699 | } |
| @@ -763,6 +756,8 @@ static int f2fs_set_data_page_dirty(struct page *page) | |||
| 763 | struct address_space *mapping = page->mapping; | 756 | struct address_space *mapping = page->mapping; |
| 764 | struct inode *inode = mapping->host; | 757 | struct inode *inode = mapping->host; |
| 765 | 758 | ||
| 759 | trace_f2fs_set_page_dirty(page, DATA); | ||
| 760 | |||
| 766 | SetPageUptodate(page); | 761 | SetPageUptodate(page); |
| 767 | if (!PageDirty(page)) { | 762 | if (!PageDirty(page)) { |
| 768 | __set_page_dirty_nobuffers(page); | 763 | __set_page_dirty_nobuffers(page); |
