aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 0be198339c3b..053361ace0ec 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1246,6 +1246,7 @@ enum {
1246 FI_FIRST_BLOCK_WRITTEN, /* indicate #0 data block was written */ 1246 FI_FIRST_BLOCK_WRITTEN, /* indicate #0 data block was written */
1247 FI_DROP_CACHE, /* drop dirty page cache */ 1247 FI_DROP_CACHE, /* drop dirty page cache */
1248 FI_DATA_EXIST, /* indicate data exists */ 1248 FI_DATA_EXIST, /* indicate data exists */
1249 FI_INLINE_DOTS, /* indicate inline dot dentries */
1249}; 1250};
1250 1251
1251static inline void set_inode_flag(struct f2fs_inode_info *fi, int flag) 1252static inline void set_inode_flag(struct f2fs_inode_info *fi, int flag)
@@ -1282,6 +1283,8 @@ static inline void get_inline_info(struct f2fs_inode_info *fi,
1282 set_inode_flag(fi, FI_INLINE_DENTRY); 1283 set_inode_flag(fi, FI_INLINE_DENTRY);
1283 if (ri->i_inline & F2FS_DATA_EXIST) 1284 if (ri->i_inline & F2FS_DATA_EXIST)
1284 set_inode_flag(fi, FI_DATA_EXIST); 1285 set_inode_flag(fi, FI_DATA_EXIST);
1286 if (ri->i_inline & F2FS_INLINE_DOTS)
1287 set_inode_flag(fi, FI_INLINE_DOTS);
1285} 1288}
1286 1289
1287static inline void set_raw_inline(struct f2fs_inode_info *fi, 1290static inline void set_raw_inline(struct f2fs_inode_info *fi,
@@ -1297,6 +1300,8 @@ static inline void set_raw_inline(struct f2fs_inode_info *fi,
1297 ri->i_inline |= F2FS_INLINE_DENTRY; 1300 ri->i_inline |= F2FS_INLINE_DENTRY;
1298 if (is_inode_flag_set(fi, FI_DATA_EXIST)) 1301 if (is_inode_flag_set(fi, FI_DATA_EXIST))
1299 ri->i_inline |= F2FS_DATA_EXIST; 1302 ri->i_inline |= F2FS_DATA_EXIST;
1303 if (is_inode_flag_set(fi, FI_INLINE_DOTS))
1304 ri->i_inline |= F2FS_INLINE_DOTS;
1300} 1305}
1301 1306
1302static inline int f2fs_has_inline_xattr(struct inode *inode) 1307static inline int f2fs_has_inline_xattr(struct inode *inode)
@@ -1342,6 +1347,11 @@ static inline int f2fs_exist_data(struct inode *inode)
1342 return is_inode_flag_set(F2FS_I(inode), FI_DATA_EXIST); 1347 return is_inode_flag_set(F2FS_I(inode), FI_DATA_EXIST);
1343} 1348}
1344 1349
1350static inline int f2fs_has_inline_dots(struct inode *inode)
1351{
1352 return is_inode_flag_set(F2FS_I(inode), FI_INLINE_DOTS);
1353}
1354
1345static inline bool f2fs_is_atomic_file(struct inode *inode) 1355static inline bool f2fs_is_atomic_file(struct inode *inode)
1346{ 1356{
1347 return is_inode_flag_set(F2FS_I(inode), FI_ATOMIC_FILE); 1357 return is_inode_flag_set(F2FS_I(inode), FI_ATOMIC_FILE);
@@ -1440,7 +1450,7 @@ struct dentry *f2fs_get_parent(struct dentry *child);
1440 * dir.c 1450 * dir.c
1441 */ 1451 */
1442extern unsigned char f2fs_filetype_table[F2FS_FT_MAX]; 1452extern unsigned char f2fs_filetype_table[F2FS_FT_MAX];
1443void set_de_type(struct f2fs_dir_entry *, struct inode *); 1453void set_de_type(struct f2fs_dir_entry *, umode_t);
1444struct f2fs_dir_entry *find_target_dentry(struct qstr *, int *, 1454struct f2fs_dir_entry *find_target_dentry(struct qstr *, int *,
1445 struct f2fs_dentry_ptr *); 1455 struct f2fs_dentry_ptr *);
1446bool f2fs_fill_dentries(struct dir_context *, struct f2fs_dentry_ptr *, 1456bool f2fs_fill_dentries(struct dir_context *, struct f2fs_dentry_ptr *,
@@ -1459,9 +1469,10 @@ ino_t f2fs_inode_by_name(struct inode *, struct qstr *);
1459void f2fs_set_link(struct inode *, struct f2fs_dir_entry *, 1469void f2fs_set_link(struct inode *, struct f2fs_dir_entry *,
1460 struct page *, struct inode *); 1470 struct page *, struct inode *);
1461int update_dent_inode(struct inode *, const struct qstr *); 1471int update_dent_inode(struct inode *, const struct qstr *);
1462void f2fs_update_dentry(struct inode *, struct f2fs_dentry_ptr *, 1472void f2fs_update_dentry(nid_t ino, umode_t mode, struct f2fs_dentry_ptr *,
1463 const struct qstr *, f2fs_hash_t , unsigned int); 1473 const struct qstr *, f2fs_hash_t , unsigned int);
1464int __f2fs_add_link(struct inode *, const struct qstr *, struct inode *); 1474int __f2fs_add_link(struct inode *, const struct qstr *, struct inode *, nid_t,
1475 umode_t);
1465void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *, 1476void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *,
1466 struct inode *); 1477 struct inode *);
1467int f2fs_do_tmpfile(struct inode *, struct inode *); 1478int f2fs_do_tmpfile(struct inode *, struct inode *);
@@ -1471,7 +1482,7 @@ bool f2fs_empty_dir(struct inode *);
1471static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode) 1482static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode)
1472{ 1483{
1473 return __f2fs_add_link(dentry->d_parent->d_inode, &dentry->d_name, 1484 return __f2fs_add_link(dentry->d_parent->d_inode, &dentry->d_name,
1474 inode); 1485 inode, inode->i_ino, inode->i_mode);
1475} 1486}
1476 1487
1477/* 1488/*
@@ -1792,7 +1803,8 @@ struct f2fs_dir_entry *find_in_inline_dir(struct inode *, struct qstr *,
1792 struct page **); 1803 struct page **);
1793struct f2fs_dir_entry *f2fs_parent_inline_dir(struct inode *, struct page **); 1804struct f2fs_dir_entry *f2fs_parent_inline_dir(struct inode *, struct page **);
1794int make_empty_inline_dir(struct inode *inode, struct inode *, struct page *); 1805int make_empty_inline_dir(struct inode *inode, struct inode *, struct page *);
1795int f2fs_add_inline_entry(struct inode *, const struct qstr *, struct inode *); 1806int f2fs_add_inline_entry(struct inode *, const struct qstr *, struct inode *,
1807 nid_t, umode_t);
1796void f2fs_delete_inline_entry(struct f2fs_dir_entry *, struct page *, 1808void f2fs_delete_inline_entry(struct f2fs_dir_entry *, struct page *,
1797 struct inode *, struct inode *); 1809 struct inode *, struct inode *);
1798bool f2fs_empty_inline_dir(struct inode *); 1810bool f2fs_empty_inline_dir(struct inode *);