aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r--fs/ubifs/ubifs.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index e4f89f271827..d7f706f7a302 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -20,8 +20,6 @@
20 * Adrian Hunter 20 * Adrian Hunter
21 */ 21 */
22 22
23/* Implementation version 0.7 */
24
25#ifndef __UBIFS_H__ 23#ifndef __UBIFS_H__
26#define __UBIFS_H__ 24#define __UBIFS_H__
27 25
@@ -322,6 +320,8 @@ struct ubifs_gced_idx_leb {
322 * struct ubifs_inode - UBIFS in-memory inode description. 320 * struct ubifs_inode - UBIFS in-memory inode description.
323 * @vfs_inode: VFS inode description object 321 * @vfs_inode: VFS inode description object
324 * @creat_sqnum: sequence number at time of creation 322 * @creat_sqnum: sequence number at time of creation
323 * @del_cmtno: commit number corresponding to the time the inode was deleted,
324 * protected by @c->commit_sem;
325 * @xattr_size: summarized size of all extended attributes in bytes 325 * @xattr_size: summarized size of all extended attributes in bytes
326 * @xattr_cnt: count of extended attributes this inode has 326 * @xattr_cnt: count of extended attributes this inode has
327 * @xattr_names: sum of lengths of all extended attribute names belonging to 327 * @xattr_names: sum of lengths of all extended attribute names belonging to
@@ -373,6 +373,7 @@ struct ubifs_gced_idx_leb {
373struct ubifs_inode { 373struct ubifs_inode {
374 struct inode vfs_inode; 374 struct inode vfs_inode;
375 unsigned long long creat_sqnum; 375 unsigned long long creat_sqnum;
376 unsigned long long del_cmtno;
376 unsigned int xattr_size; 377 unsigned int xattr_size;
377 unsigned int xattr_cnt; 378 unsigned int xattr_cnt;
378 unsigned int xattr_names; 379 unsigned int xattr_names;
@@ -779,7 +780,7 @@ struct ubifs_compressor {
779/** 780/**
780 * struct ubifs_budget_req - budget requirements of an operation. 781 * struct ubifs_budget_req - budget requirements of an operation.
781 * 782 *
782 * @fast: non-zero if the budgeting should try to aquire budget quickly and 783 * @fast: non-zero if the budgeting should try to acquire budget quickly and
783 * should not try to call write-back 784 * should not try to call write-back
784 * @recalculate: non-zero if @idx_growth, @data_growth, and @dd_growth fields 785 * @recalculate: non-zero if @idx_growth, @data_growth, and @dd_growth fields
785 * have to be re-calculated 786 * have to be re-calculated
@@ -805,21 +806,31 @@ struct ubifs_compressor {
805 * An inode may contain 4KiB of data at max., thus the widths of @new_ino_d 806 * An inode may contain 4KiB of data at max., thus the widths of @new_ino_d
806 * is 13 bits, and @dirtied_ino_d - 15, because up to 4 inodes may be made 807 * is 13 bits, and @dirtied_ino_d - 15, because up to 4 inodes may be made
807 * dirty by the re-name operation. 808 * dirty by the re-name operation.
809 *
810 * Note, UBIFS aligns node lengths to 8-bytes boundary, so the requester has to
811 * make sure the amount of inode data which contribute to @new_ino_d and
812 * @dirtied_ino_d fields are aligned.
808 */ 813 */
809struct ubifs_budget_req { 814struct ubifs_budget_req {
810 unsigned int fast:1; 815 unsigned int fast:1;
811 unsigned int recalculate:1; 816 unsigned int recalculate:1;
817#ifndef UBIFS_DEBUG
812 unsigned int new_page:1; 818 unsigned int new_page:1;
813 unsigned int dirtied_page:1; 819 unsigned int dirtied_page:1;
814 unsigned int new_dent:1; 820 unsigned int new_dent:1;
815 unsigned int mod_dent:1; 821 unsigned int mod_dent:1;
816 unsigned int new_ino:1; 822 unsigned int new_ino:1;
817 unsigned int new_ino_d:13; 823 unsigned int new_ino_d:13;
818#ifndef UBIFS_DEBUG
819 unsigned int dirtied_ino:4; 824 unsigned int dirtied_ino:4;
820 unsigned int dirtied_ino_d:15; 825 unsigned int dirtied_ino_d:15;
821#else 826#else
822 /* Not bit-fields to check for overflows */ 827 /* Not bit-fields to check for overflows */
828 unsigned int new_page;
829 unsigned int dirtied_page;
830 unsigned int new_dent;
831 unsigned int mod_dent;
832 unsigned int new_ino;
833 unsigned int new_ino_d;
823 unsigned int dirtied_ino; 834 unsigned int dirtied_ino;
824 unsigned int dirtied_ino_d; 835 unsigned int dirtied_ino_d;
825#endif 836#endif
@@ -860,13 +871,13 @@ struct ubifs_mount_opts {
860 * struct ubifs_info - UBIFS file-system description data structure 871 * struct ubifs_info - UBIFS file-system description data structure
861 * (per-superblock). 872 * (per-superblock).
862 * @vfs_sb: VFS @struct super_block object 873 * @vfs_sb: VFS @struct super_block object
863 * @bdi: backing device info object to make VFS happy and disable readahead 874 * @bdi: backing device info object to make VFS happy and disable read-ahead
864 * 875 *
865 * @highest_inum: highest used inode number 876 * @highest_inum: highest used inode number
866 * @vfs_gen: VFS inode generation counter
867 * @max_sqnum: current global sequence number 877 * @max_sqnum: current global sequence number
868 * @cmt_no: commit number (last successfully completed commit) 878 * @cmt_no: commit number of the last successfully completed commit, protected
869 * @cnt_lock: protects @highest_inum, @vfs_gen, and @max_sqnum counters 879 * by @commit_sem
880 * @cnt_lock: protects @highest_inum and @max_sqnum counters
870 * @fmt_version: UBIFS on-flash format version 881 * @fmt_version: UBIFS on-flash format version
871 * @uuid: UUID from super block 882 * @uuid: UUID from super block
872 * 883 *
@@ -1103,7 +1114,6 @@ struct ubifs_info {
1103 struct backing_dev_info bdi; 1114 struct backing_dev_info bdi;
1104 1115
1105 ino_t highest_inum; 1116 ino_t highest_inum;
1106 unsigned int vfs_gen;
1107 unsigned long long max_sqnum; 1117 unsigned long long max_sqnum;
1108 unsigned long long cmt_no; 1118 unsigned long long cmt_no;
1109 spinlock_t cnt_lock; 1119 spinlock_t cnt_lock;
@@ -1346,6 +1356,7 @@ extern struct backing_dev_info ubifs_backing_dev_info;
1346extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT]; 1356extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
1347 1357
1348/* io.c */ 1358/* io.c */
1359void ubifs_ro_mode(struct ubifs_info *c, int err);
1349int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len); 1360int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len);
1350int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs, 1361int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs,
1351 int dtype); 1362 int dtype);
@@ -1399,8 +1410,8 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
1399 int deletion, int xent); 1410 int deletion, int xent);
1400int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode, 1411int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode,
1401 const union ubifs_key *key, const void *buf, int len); 1412 const union ubifs_key *key, const void *buf, int len);
1402int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode, 1413int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode);
1403 int last_reference); 1414int ubifs_jnl_delete_inode(struct ubifs_info *c, const struct inode *inode);
1404int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir, 1415int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
1405 const struct dentry *old_dentry, 1416 const struct dentry *old_dentry,
1406 const struct inode *new_dir, 1417 const struct inode *new_dir,