diff options
author | Adrian Hunter <ext-adrian.hunter@nokia.com> | 2008-09-04 16:26:00 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-09-30 11:12:56 +0300 |
commit | 2953e73f1ce4b3284b409aefb9d46bbde6515c37 (patch) | |
tree | 56126c6a589bd0450eb288db6a93946e50e5bc29 /fs/ubifs/tnc.c | |
parent | 4793e7c5e1c88382ead18db5ca072bac54467318 (diff) | |
download | op-kernel-dev-2953e73f1ce4b3284b409aefb9d46bbde6515c37.zip op-kernel-dev-2953e73f1ce4b3284b409aefb9d46bbde6515c37.tar.gz |
UBIFS: add no_chk_data_crc mount option
UBIFS read performance can be improved by skipping the CRC
check when data nodes are read. This option can be used if
the underlying media is considered to be highly reliable.
Note that CRCs are always checked for metadata.
Read speed on Arm platform with OneNAND goes from 19 MiB/s
to 27 MiB/s with data CRC checking disabled.
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Diffstat (limited to 'fs/ubifs/tnc.c')
-rw-r--r-- | fs/ubifs/tnc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index d279012..66dc571 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -470,6 +470,10 @@ static int try_read_node(const struct ubifs_info *c, void *buf, int type, if (node_len != len) return 0; + if (type == UBIFS_DATA_NODE && !c->always_chk_crc) + if (c->no_chk_data_crc) + return 0; + crc = crc32(UBIFS_CRC32_INIT, buf + 8, node_len - 8); node_crc = le32_to_cpu(ch->crc); if (crc != node_crc) @@ -1687,7 +1691,7 @@ static int validate_data_node(struct ubifs_info *c, void *buf, goto out_err; } - err = ubifs_check_node(c, buf, zbr->lnum, zbr->offs, 0); + err = ubifs_check_node(c, buf, zbr->lnum, zbr->offs, 0, 0); if (err) { ubifs_err("expected node type %d", UBIFS_DATA_NODE); goto out; |