Commit e0e3d32b authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds

befs: don't pass huge structs by value

'struct befs_disk_data_stream' is huge (~144 bytes) and it's being passed
by value in fs/befs/endian.h::cpu_to_fsrun().

It would be better to pass a pointer.
Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Cc: Will Dyson <will_dyson@pobox.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 25f959d6
...@@ -102,22 +102,22 @@ cpu_to_fsrun(const struct super_block *sb, befs_block_run n) ...@@ -102,22 +102,22 @@ cpu_to_fsrun(const struct super_block *sb, befs_block_run n)
} }
static inline befs_data_stream static inline befs_data_stream
fsds_to_cpu(const struct super_block *sb, befs_disk_data_stream n) fsds_to_cpu(const struct super_block *sb, const befs_disk_data_stream *n)
{ {
befs_data_stream data; befs_data_stream data;
int i; int i;
for (i = 0; i < BEFS_NUM_DIRECT_BLOCKS; ++i) for (i = 0; i < BEFS_NUM_DIRECT_BLOCKS; ++i)
data.direct[i] = fsrun_to_cpu(sb, n.direct[i]); data.direct[i] = fsrun_to_cpu(sb, n->direct[i]);
data.max_direct_range = fs64_to_cpu(sb, n.max_direct_range); data.max_direct_range = fs64_to_cpu(sb, n->max_direct_range);
data.indirect = fsrun_to_cpu(sb, n.indirect); data.indirect = fsrun_to_cpu(sb, n->indirect);
data.max_indirect_range = fs64_to_cpu(sb, n.max_indirect_range); data.max_indirect_range = fs64_to_cpu(sb, n->max_indirect_range);
data.double_indirect = fsrun_to_cpu(sb, n.double_indirect); data.double_indirect = fsrun_to_cpu(sb, n->double_indirect);
data.max_double_indirect_range = fs64_to_cpu(sb, data.max_double_indirect_range = fs64_to_cpu(sb,
n. n->
max_double_indirect_range); max_double_indirect_range);
data.size = fs64_to_cpu(sb, n.size); data.size = fs64_to_cpu(sb, n->size);
return data; return data;
} }
......
...@@ -390,7 +390,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) ...@@ -390,7 +390,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
int num_blks; int num_blks;
befs_ino->i_data.ds = befs_ino->i_data.ds =
fsds_to_cpu(sb, raw_inode->data.datastream); fsds_to_cpu(sb, &raw_inode->data.datastream);
num_blks = befs_count_blocks(sb, &befs_ino->i_data.ds); num_blks = befs_count_blocks(sb, &befs_ino->i_data.ds);
inode->i_blocks = inode->i_blocks =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment