aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r--fs/f2fs/inline.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 3e8ecdf3742b..289f99e9a339 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -15,11 +15,10 @@
15 15
16bool f2fs_may_inline(struct inode *inode) 16bool f2fs_may_inline(struct inode *inode)
17{ 17{
18 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
19 block_t nr_blocks; 18 block_t nr_blocks;
20 loff_t i_size; 19 loff_t i_size;
21 20
22 if (!test_opt(sbi, INLINE_DATA)) 21 if (!test_opt(F2FS_I_SB(inode), INLINE_DATA))
23 return false; 22 return false;
24 23
25 nr_blocks = F2FS_I(inode)->i_xattr_nid ? 3 : 2; 24 nr_blocks = F2FS_I(inode)->i_xattr_nid ? 3 : 2;
@@ -35,7 +34,6 @@ bool f2fs_may_inline(struct inode *inode)
35 34
36int f2fs_read_inline_data(struct inode *inode, struct page *page) 35int f2fs_read_inline_data(struct inode *inode, struct page *page)
37{ 36{
38 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
39 struct page *ipage; 37 struct page *ipage;
40 void *src_addr, *dst_addr; 38 void *src_addr, *dst_addr;
41 39
@@ -44,7 +42,7 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
44 goto out; 42 goto out;
45 } 43 }
46 44
47 ipage = get_node_page(sbi, inode->i_ino); 45 ipage = get_node_page(F2FS_I_SB(inode), inode->i_ino);
48 if (IS_ERR(ipage)) { 46 if (IS_ERR(ipage)) {
49 unlock_page(page); 47 unlock_page(page);
50 return PTR_ERR(ipage); 48 return PTR_ERR(ipage);
@@ -73,7 +71,7 @@ static int __f2fs_convert_inline_data(struct inode *inode, struct page *page)
73 struct dnode_of_data dn; 71 struct dnode_of_data dn;
74 void *src_addr, *dst_addr; 72 void *src_addr, *dst_addr;
75 block_t new_blk_addr; 73 block_t new_blk_addr;
76 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 74 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
77 struct f2fs_io_info fio = { 75 struct f2fs_io_info fio = {
78 .type = DATA, 76 .type = DATA,
79 .rw = WRITE_SYNC | REQ_PRIO, 77 .rw = WRITE_SYNC | REQ_PRIO,
@@ -189,13 +187,12 @@ int f2fs_write_inline_data(struct inode *inode,
189 187
190void truncate_inline_data(struct inode *inode, u64 from) 188void truncate_inline_data(struct inode *inode, u64 from)
191{ 189{
192 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
193 struct page *ipage; 190 struct page *ipage;
194 191
195 if (from >= MAX_INLINE_DATA) 192 if (from >= MAX_INLINE_DATA)
196 return; 193 return;
197 194
198 ipage = get_node_page(sbi, inode->i_ino); 195 ipage = get_node_page(F2FS_I_SB(inode), inode->i_ino);
199 if (IS_ERR(ipage)) 196 if (IS_ERR(ipage))
200 return; 197 return;
201 198
@@ -209,7 +206,7 @@ void truncate_inline_data(struct inode *inode, u64 from)
209 206
210bool recover_inline_data(struct inode *inode, struct page *npage) 207bool recover_inline_data(struct inode *inode, struct page *npage)
211{ 208{
212 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 209 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
213 struct f2fs_inode *ri = NULL; 210 struct f2fs_inode *ri = NULL;
214 void *src_addr, *dst_addr; 211 void *src_addr, *dst_addr;
215 struct page *ipage; 212 struct page *ipage;