aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 060aee65aee8..411f053720c2 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -33,7 +33,7 @@ static int f2fs_vm_page_mkwrite(struct vm_area_struct *vma,
33{ 33{
34 struct page *page = vmf->page; 34 struct page *page = vmf->page;
35 struct inode *inode = file_inode(vma->vm_file); 35 struct inode *inode = file_inode(vma->vm_file);
36 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 36 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
37 struct dnode_of_data dn; 37 struct dnode_of_data dn;
38 int err; 38 int err;
39 39
@@ -117,7 +117,7 @@ static int get_parent_ino(struct inode *inode, nid_t *pino)
117 117
118static inline bool need_do_checkpoint(struct inode *inode) 118static inline bool need_do_checkpoint(struct inode *inode)
119{ 119{
120 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 120 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
121 bool need_cp = false; 121 bool need_cp = false;
122 122
123 if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1) 123 if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1)
@@ -138,7 +138,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
138{ 138{
139 struct inode *inode = file->f_mapping->host; 139 struct inode *inode = file->f_mapping->host;
140 struct f2fs_inode_info *fi = F2FS_I(inode); 140 struct f2fs_inode_info *fi = F2FS_I(inode);
141 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 141 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
142 int ret = 0; 142 int ret = 0;
143 bool need_cp = false; 143 bool need_cp = false;
144 struct writeback_control wbc = { 144 struct writeback_control wbc = {
@@ -226,7 +226,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
226flush_out: 226flush_out:
227 remove_dirty_inode(sbi, inode->i_ino, UPDATE_INO); 227 remove_dirty_inode(sbi, inode->i_ino, UPDATE_INO);
228 clear_inode_flag(fi, FI_UPDATE_WRITE); 228 clear_inode_flag(fi, FI_UPDATE_WRITE);
229 ret = f2fs_issue_flush(F2FS_SB(inode->i_sb)); 229 ret = f2fs_issue_flush(F2FS_I_SB(inode));
230 } 230 }
231out: 231out:
232 trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret); 232 trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret);
@@ -369,7 +369,7 @@ static int f2fs_file_mmap(struct file *file, struct vm_area_struct *vma)
369int truncate_data_blocks_range(struct dnode_of_data *dn, int count) 369int truncate_data_blocks_range(struct dnode_of_data *dn, int count)
370{ 370{
371 int nr_free = 0, ofs = dn->ofs_in_node; 371 int nr_free = 0, ofs = dn->ofs_in_node;
372 struct f2fs_sb_info *sbi = F2FS_SB(dn->inode->i_sb); 372 struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode);
373 struct f2fs_node *raw_node; 373 struct f2fs_node *raw_node;
374 __le32 *addr; 374 __le32 *addr;
375 375
@@ -432,7 +432,7 @@ out:
432 432
433int truncate_blocks(struct inode *inode, u64 from, bool lock) 433int truncate_blocks(struct inode *inode, u64 from, bool lock)
434{ 434{
435 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 435 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
436 unsigned int blocksize = inode->i_sb->s_blocksize; 436 unsigned int blocksize = inode->i_sb->s_blocksize;
437 struct dnode_of_data dn; 437 struct dnode_of_data dn;
438 pgoff_t free_from; 438 pgoff_t free_from;
@@ -555,7 +555,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
555 555
556 truncate_setsize(inode, attr->ia_size); 556 truncate_setsize(inode, attr->ia_size);
557 f2fs_truncate(inode); 557 f2fs_truncate(inode);
558 f2fs_balance_fs(F2FS_SB(inode->i_sb)); 558 f2fs_balance_fs(F2FS_I_SB(inode));
559 } 559 }
560 560
561 __setattr_copy(inode, attr); 561 __setattr_copy(inode, attr);
@@ -589,7 +589,7 @@ const struct inode_operations f2fs_file_inode_operations = {
589static void fill_zero(struct inode *inode, pgoff_t index, 589static void fill_zero(struct inode *inode, pgoff_t index,
590 loff_t start, loff_t len) 590 loff_t start, loff_t len)
591{ 591{
592 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 592 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
593 struct page *page; 593 struct page *page;
594 594
595 if (!len) 595 if (!len)
@@ -661,7 +661,7 @@ static int punch_hole(struct inode *inode, loff_t offset, loff_t len)
661 if (pg_start < pg_end) { 661 if (pg_start < pg_end) {
662 struct address_space *mapping = inode->i_mapping; 662 struct address_space *mapping = inode->i_mapping;
663 loff_t blk_start, blk_end; 663 loff_t blk_start, blk_end;
664 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 664 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
665 665
666 f2fs_balance_fs(sbi); 666 f2fs_balance_fs(sbi);
667 667
@@ -682,7 +682,7 @@ static int punch_hole(struct inode *inode, loff_t offset, loff_t len)
682static int expand_inode_data(struct inode *inode, loff_t offset, 682static int expand_inode_data(struct inode *inode, loff_t offset,
683 loff_t len, int mode) 683 loff_t len, int mode)
684{ 684{
685 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 685 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
686 pgoff_t index, pg_start, pg_end; 686 pgoff_t index, pg_start, pg_end;
687 loff_t new_size = i_size_read(inode); 687 loff_t new_size = i_size_read(inode);
688 loff_t off_start, off_end; 688 loff_t off_start, off_end;