aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-11-18 13:20:05 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-11-21 11:59:25 -0500
commit6c0c42cdfd73fb161417403d8d077cb136e10bbf (patch)
tree343de0cb98df07295bc3e03eee083012ac12bae7 /fs/ubifs/ubifs.h
parent39ce81ce7168aa7226fb9f182c3a2b57060d0905 (diff)
UBIFS: do not allocate too much
Bulk-read allocates 128KiB or more using kmalloc. The allocation starts failing often when the memory gets fragmented. UBIFS still works fine in this case, because it falls-back to standard (non-optimized) read method, though. This patch teaches bulk-read to allocate exactly the amount of memory it needs, instead of allocating 128KiB every time. This patch is also a preparation to the further fix where we'll have a pre-allocated bulk-read buffer as well. For example, now the @bu object is prepared in 'ubifs_bulk_read()', so we could path either pre-allocated or allocated information to 'ubifs_do_bulk_read()' later. Or teaching 'ubifs_do_bulk_read()' not to allocate 'bu->buf' if it is already there. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r--fs/ubifs/ubifs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 06ba51efd65d..870b5c479e95 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -969,7 +969,7 @@ struct ubifs_mount_opts {
969 * @mst_node: master node 969 * @mst_node: master node
970 * @mst_offs: offset of valid master node 970 * @mst_offs: offset of valid master node
971 * @mst_mutex: protects the master node area, @mst_node, and @mst_offs 971 * @mst_mutex: protects the master node area, @mst_node, and @mst_offs
972 * @bulk_read_buf_size: buffer size for bulk-reads 972 * @max_bu_buf_len: maximum bulk-read buffer length
973 * 973 *
974 * @log_lebs: number of logical eraseblocks in the log 974 * @log_lebs: number of logical eraseblocks in the log
975 * @log_bytes: log size in bytes 975 * @log_bytes: log size in bytes
@@ -1217,7 +1217,7 @@ struct ubifs_info {
1217 struct ubifs_mst_node *mst_node; 1217 struct ubifs_mst_node *mst_node;
1218 int mst_offs; 1218 int mst_offs;
1219 struct mutex mst_mutex; 1219 struct mutex mst_mutex;
1220 int bulk_read_buf_size; 1220 int max_bu_buf_len;
1221 1221
1222 int log_lebs; 1222 int log_lebs;
1223 long long log_bytes; 1223 long long log_bytes;