From c7b5bb0beb80e5ee993118ae82d0b8264526b6bf Mon Sep 17 00:00:00 2001 From: hujianyang Date: Tue, 24 Jun 2014 11:46:36 +0800 Subject: [PATCH] UBIFS: remove useless @ecc in struct ubifs_scan_leb We set @ecc in ubifs_scan_leb only if leb_read returns EBADMSG and do not use it any more. This patch removes this variable and adds comments about EBADMSG handling. Artem: re-phrase commentaries Signed-off-by: hujianyang Signed-off-by: Artem Bityutskiy --- fs/ubifs/scan.c | 7 ++++--- fs/ubifs/ubifs.h | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 58aa05df2bb6..e5b7c591841b 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -157,9 +157,10 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, return ERR_PTR(err); } - if (err == -EBADMSG) - sleb->ecc = 1; - + /* + * Note, we ignore integrity errors (EBASMSG) because all the nodes are + * protected by CRC checksums. + */ return sleb; } diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index c1f71fe17cc0..977a01bf1720 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -314,7 +314,6 @@ struct ubifs_scan_node { * @nodes_cnt: number of nodes scanned * @nodes: list of struct ubifs_scan_node * @endpt: end point (and therefore the start of empty space) - * @ecc: read returned -EBADMSG * @buf: buffer containing entire LEB scanned */ struct ubifs_scan_leb { @@ -322,7 +321,6 @@ struct ubifs_scan_leb { int nodes_cnt; struct list_head nodes; int endpt; - int ecc; void *buf; }; -- 2.34.1