aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.h
diff options
context:
space:
mode:
authorAdrian Hunter <ext-adrian.hunter@nokia.com>2008-09-02 09:29:46 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-09-30 04:12:56 -0400
commit4793e7c5e1c88382ead18db5ca072bac54467318 (patch)
tree07e5e99d988b28fed07d5a01141169362c5a007d /fs/ubifs/ubifs.h
parenta70948b564e9f6cb81115c606d46f5b74a77b7c2 (diff)
UBIFS: add bulk-read facility
Some flash media are capable of reading sequentially at faster rates. UBIFS bulk-read facility is designed to take advantage of that, by reading in one go consecutive data nodes that are also located consecutively in the same LEB. Read speed on Arm platform with OneNAND goes from 17 MiB/s to 19 MiB/s. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r--fs/ubifs/ubifs.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index ce8654928aad..8513239ea8a0 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -142,6 +142,9 @@
142/* Maximum expected tree height for use by bottom_up_buf */ 142/* Maximum expected tree height for use by bottom_up_buf */
143#define BOTTOM_UP_HEIGHT 64 143#define BOTTOM_UP_HEIGHT 64
144 144
145/* Maximum number of data nodes to bulk-read */
146#define UBIFS_MAX_BULK_READ 32
147
145/* 148/*
146 * Lockdep classes for UBIFS inode @ui_mutex. 149 * Lockdep classes for UBIFS inode @ui_mutex.
147 */ 150 */
@@ -329,8 +332,8 @@ struct ubifs_gced_idx_leb {
329 * @dirty: non-zero if the inode is dirty 332 * @dirty: non-zero if the inode is dirty
330 * @xattr: non-zero if this is an extended attribute inode 333 * @xattr: non-zero if this is an extended attribute inode
331 * @ui_mutex: serializes inode write-back with the rest of VFS operations, 334 * @ui_mutex: serializes inode write-back with the rest of VFS operations,
332 * serializes "clean <-> dirty" state changes, protects @dirty, 335 * serializes "clean <-> dirty" state changes, serializes bulk-read,
333 * @ui_size, and @xattr_size 336 * protects @dirty, @ui_size, and @xattr_size
334 * @ui_lock: protects @synced_i_size 337 * @ui_lock: protects @synced_i_size
335 * @synced_i_size: synchronized size of inode, i.e. the value of inode size 338 * @synced_i_size: synchronized size of inode, i.e. the value of inode size
336 * currently stored on the flash; used only for regular file 339 * currently stored on the flash; used only for regular file
@@ -338,6 +341,9 @@ struct ubifs_gced_idx_leb {
338 * @ui_size: inode size used by UBIFS when writing to flash 341 * @ui_size: inode size used by UBIFS when writing to flash
339 * @flags: inode flags (@UBIFS_COMPR_FL, etc) 342 * @flags: inode flags (@UBIFS_COMPR_FL, etc)
340 * @compr_type: default compression type used for this inode 343 * @compr_type: default compression type used for this inode
344 * @last_page_read: page number of last page read (for bulk read)
345 * @read_in_a_row: number of consecutive pages read in a row (for bulk read)
346 * @bulk_read: indicates whether bulk-read should be used
341 * @data_len: length of the data attached to the inode 347 * @data_len: length of the data attached to the inode
342 * @data: inode's data 348 * @data: inode's data
343 * 349 *
@@ -385,6 +391,9 @@ struct ubifs_inode {
385 loff_t ui_size; 391 loff_t ui_size;
386 int flags; 392 int flags;
387 int compr_type; 393 int compr_type;
394 pgoff_t last_page_read;
395 pgoff_t read_in_a_row;
396 int bulk_read;
388 int data_len; 397 int data_len;
389 void *data; 398 void *data;
390}; 399};
@@ -744,6 +753,28 @@ struct ubifs_znode {
744}; 753};
745 754
746/** 755/**
756 * struct bu_info - bulk-read information
757 * @key: first data node key
758 * @zbranch: zbranches of data nodes to bulk read
759 * @buf: buffer to read into
760 * @buf_len: buffer length
761 * @gc_seq: GC sequence number to detect races with GC
762 * @cnt: number of data nodes for bulk read
763 * @blk_cnt: number of data blocks including holes
764 * @oef: end of file reached
765 */
766struct bu_info {
767 union ubifs_key key;
768 struct ubifs_zbranch zbranch[UBIFS_MAX_BULK_READ];
769 void *buf;
770 int buf_len;
771 int gc_seq;
772 int cnt;
773 int blk_cnt;
774 int eof;
775};
776
777/**
747 * struct ubifs_node_range - node length range description data structure. 778 * struct ubifs_node_range - node length range description data structure.
748 * @len: fixed node length 779 * @len: fixed node length
749 * @min_len: minimum possible node length 780 * @min_len: minimum possible node length
@@ -862,9 +893,11 @@ struct ubifs_orphan {
862/** 893/**
863 * struct ubifs_mount_opts - UBIFS-specific mount options information. 894 * struct ubifs_mount_opts - UBIFS-specific mount options information.
864 * @unmount_mode: selected unmount mode (%0 default, %1 normal, %2 fast) 895 * @unmount_mode: selected unmount mode (%0 default, %1 normal, %2 fast)
896 * @bulk_read: enable bulk-reads
865 */ 897 */
866struct ubifs_mount_opts { 898struct ubifs_mount_opts {
867 unsigned int unmount_mode:2; 899 unsigned int unmount_mode:2;
900 unsigned int bulk_read:2;
868}; 901};
869 902
870/** 903/**
@@ -965,6 +998,9 @@ struct ubifs_mount_opts {
965 * @old_leb_cnt: count of logical eraseblocks before re-size 998 * @old_leb_cnt: count of logical eraseblocks before re-size
966 * @ro_media: the underlying UBI volume is read-only 999 * @ro_media: the underlying UBI volume is read-only
967 * 1000 *
1001 * @bulk_read: enable bulk-reads
1002 * @bulk_read_buf_size: buffer size for bulk-reads
1003 *
968 * @dirty_pg_cnt: number of dirty pages (not used) 1004 * @dirty_pg_cnt: number of dirty pages (not used)
969 * @dirty_zn_cnt: number of dirty znodes 1005 * @dirty_zn_cnt: number of dirty znodes
970 * @clean_zn_cnt: number of clean znodes 1006 * @clean_zn_cnt: number of clean znodes
@@ -1205,6 +1241,9 @@ struct ubifs_info {
1205 int old_leb_cnt; 1241 int old_leb_cnt;
1206 int ro_media; 1242 int ro_media;
1207 1243
1244 int bulk_read;
1245 int bulk_read_buf_size;
1246
1208 atomic_long_t dirty_pg_cnt; 1247 atomic_long_t dirty_pg_cnt;
1209 atomic_long_t dirty_zn_cnt; 1248 atomic_long_t dirty_zn_cnt;
1210 atomic_long_t clean_zn_cnt; 1249 atomic_long_t clean_zn_cnt;
@@ -1490,6 +1529,8 @@ void destroy_old_idx(struct ubifs_info *c);
1490int is_idx_node_in_tnc(struct ubifs_info *c, union ubifs_key *key, int level, 1529int is_idx_node_in_tnc(struct ubifs_info *c, union ubifs_key *key, int level,
1491 int lnum, int offs); 1530 int lnum, int offs);
1492int insert_old_idx_znode(struct ubifs_info *c, struct ubifs_znode *znode); 1531int insert_old_idx_znode(struct ubifs_info *c, struct ubifs_znode *znode);
1532int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu);
1533int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu);
1493 1534
1494/* tnc_misc.c */ 1535/* tnc_misc.c */
1495struct ubifs_znode *ubifs_tnc_levelorder_next(struct ubifs_znode *zr, 1536struct ubifs_znode *ubifs_tnc_levelorder_next(struct ubifs_znode *zr,