aboutsummaryrefslogtreecommitdiff
path: root/fs/ubifs/sb.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-11-01 14:57:49 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-03 13:14:05 +0200
commit553dea4dd531562688ba01c641c7f8fc7abaaf8c (patch)
tree823d2cb0b8684e7975ca3193a9fec2a53e3995b1 /fs/ubifs/sb.c
parenta1dc080c27ec8ea7ca1c8a9b499362a71ebff792 (diff)
UBIFS: introduce compression mount options
It is very handy to be able to change default UBIFS compressor via mount options. Introduce -o compr=<name> mount option support. Currently only "none", "lzo" and "zlib" compressors are supported. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/sb.c')
-rw-r--r--fs/ubifs/sb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c
index 0f392351dc5..c5da201ab54 100644
--- a/fs/ubifs/sb.c
+++ b/fs/ubifs/sb.c
@@ -179,8 +179,11 @@ static int create_default_filesystem(struct ubifs_info *c)
sup->fanout = cpu_to_le32(DEFAULT_FANOUT);
sup->lsave_cnt = cpu_to_le32(c->lsave_cnt);
sup->fmt_version = cpu_to_le32(UBIFS_FORMAT_VERSION);
- sup->default_compr = cpu_to_le16(UBIFS_COMPR_LZO);
sup->time_gran = cpu_to_le32(DEFAULT_TIME_GRAN);
+ if (c->mount_opts.override_compr)
+ sup->default_compr = cpu_to_le16(c->mount_opts.compr_type);
+ else
+ sup->default_compr = cpu_to_le16(UBIFS_COMPR_LZO);
generate_random_uuid(sup->uuid);
@@ -582,16 +585,15 @@ int ubifs_read_superblock(struct ubifs_info *c)
c->jhead_cnt = le32_to_cpu(sup->jhead_cnt) + NONDATA_JHEADS_CNT;
c->fanout = le32_to_cpu(sup->fanout);
c->lsave_cnt = le32_to_cpu(sup->lsave_cnt);
- c->default_compr = le16_to_cpu(sup->default_compr);
c->rp_size = le64_to_cpu(sup->rp_size);
c->rp_uid = le32_to_cpu(sup->rp_uid);
c->rp_gid = le32_to_cpu(sup->rp_gid);
sup_flags = le32_to_cpu(sup->flags);
+ if (!c->mount_opts.override_compr)
+ c->default_compr = le16_to_cpu(sup->default_compr);
c->vfs_sb->s_time_gran = le32_to_cpu(sup->time_gran);
-
memcpy(&c->uuid, &sup->uuid, 16);
-
c->big_lpt = !!(sup_flags & UBIFS_FLG_BIGLPT);
/* Automatically increase file system size to the maximum size */