Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0125262 authored by Manish Sharma's avatar Manish Sharma Committed by Phillip Lougher
Browse files

Squashfs: Optimized uncompressed buffer loop



Merged the two for loops. We might get a little gain by overlapping
wait_on_bh and the memcpy operations.

Signed-off-by: default avatarManish Sharma <manishrma@gmail.com>
Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
parent 28d7b568
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -167,17 +167,14 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
		/*
		 * Block is uncompressed.
		 */
		int i, in, pg_offset = 0;

		for (i = 0; i < b; i++) {
			wait_on_buffer(bh[i]);
			if (!buffer_uptodate(bh[i]))
				goto block_release;
		}
		int in, pg_offset = 0;

		for (bytes = length; k < b; k++) {
			in = min(bytes, msblk->devblksize - offset);
			bytes -= in;
			wait_on_buffer(bh[k]);
			if (!buffer_uptodate(bh[k]))
				goto block_release;
			while (in) {
				if (pg_offset == PAGE_CACHE_SIZE) {
					page++;