aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-08-07 19:57:17 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-08-19 13:01:33 -0400
commit0342fd301a9a940210f59fd094f766e7a0671987 (patch)
treee3ac0ea51a32a8c1dada1238ad252077ef992367
parentb067ba1f1b3fa7ec798d35e12aed6cdba9cea905 (diff)
f2fs: make clear on test condition and return types
This patch adds a parentheses to make clear for condition check. And also it changes the return type for better meanings. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/f2fs.h2
-rw-r--r--fs/f2fs/inline.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index c8288c9a4e1e..2e4aa3a51b0d 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1442,5 +1442,5 @@ int f2fs_read_inline_data(struct inode *, struct page *);
1442int f2fs_convert_inline_data(struct inode *, pgoff_t, struct page *); 1442int f2fs_convert_inline_data(struct inode *, pgoff_t, struct page *);
1443int f2fs_write_inline_data(struct inode *, struct page *, unsigned int); 1443int f2fs_write_inline_data(struct inode *, struct page *, unsigned int);
1444void truncate_inline_data(struct inode *, u64); 1444void truncate_inline_data(struct inode *, u64);
1445int recover_inline_data(struct inode *, struct page *); 1445bool recover_inline_data(struct inode *, struct page *);
1446#endif 1446#endif
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 1ec512d0bed3..520758b91999 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -203,7 +203,7 @@ void truncate_inline_data(struct inode *inode, u64 from)
203 f2fs_put_page(ipage, 1); 203 f2fs_put_page(ipage, 1);
204} 204}
205 205
206int recover_inline_data(struct inode *inode, struct page *npage) 206bool recover_inline_data(struct inode *inode, struct page *npage)
207{ 207{
208 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 208 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
209 struct f2fs_inode *ri = NULL; 209 struct f2fs_inode *ri = NULL;
@@ -222,7 +222,7 @@ int recover_inline_data(struct inode *inode, struct page *npage)
222 ri = F2FS_INODE(npage); 222 ri = F2FS_INODE(npage);
223 223
224 if (f2fs_has_inline_data(inode) && 224 if (f2fs_has_inline_data(inode) &&
225 ri && ri->i_inline & F2FS_INLINE_DATA) { 225 ri && (ri->i_inline & F2FS_INLINE_DATA)) {
226process_inline: 226process_inline:
227 ipage = get_node_page(sbi, inode->i_ino); 227 ipage = get_node_page(sbi, inode->i_ino);
228 f2fs_bug_on(IS_ERR(ipage)); 228 f2fs_bug_on(IS_ERR(ipage));
@@ -234,7 +234,7 @@ process_inline:
234 memcpy(dst_addr, src_addr, MAX_INLINE_DATA); 234 memcpy(dst_addr, src_addr, MAX_INLINE_DATA);
235 update_inode(inode, ipage); 235 update_inode(inode, ipage);
236 f2fs_put_page(ipage, 1); 236 f2fs_put_page(ipage, 1);
237 return -1; 237 return true;
238 } 238 }
239 239
240 if (f2fs_has_inline_data(inode)) { 240 if (f2fs_has_inline_data(inode)) {
@@ -246,10 +246,10 @@ process_inline:
246 clear_inode_flag(F2FS_I(inode), FI_INLINE_DATA); 246 clear_inode_flag(F2FS_I(inode), FI_INLINE_DATA);
247 update_inode(inode, ipage); 247 update_inode(inode, ipage);
248 f2fs_put_page(ipage, 1); 248 f2fs_put_page(ipage, 1);
249 } else if (ri && ri->i_inline & F2FS_INLINE_DATA) { 249 } else if (ri && (ri->i_inline & F2FS_INLINE_DATA)) {
250 truncate_blocks(inode, 0); 250 truncate_blocks(inode, 0);
251 set_inode_flag(F2FS_I(inode), FI_INLINE_DATA); 251 set_inode_flag(F2FS_I(inode), FI_INLINE_DATA);
252 goto process_inline; 252 goto process_inline;
253 } 253 }
254 return 0; 254 return false;
255} 255}