summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/master.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-09-28 09:21:32 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-10-08 08:36:58 +0200
commitd4b75d34fc40268535432ec65ae6d0ecb6551453 (patch)
tree6a5785bfb30940d3d79ddc13bc478a3433807a51 /fs/ubifs/master.c
parent35197571a859dc268671341530c4e8606cebf901 (diff)
downloadbarebox-d4b75d34fc40268535432ec65ae6d0ecb6551453.tar.gz
barebox-d4b75d34fc40268535432ec65ae6d0ecb6551453.tar.xz
fs: ubifs: remove not needed code
This patch aggressively removes stuff that we do not need in a readonly implementation: - write buffering support - lpt/ltab code - garbage collector - everything under #ifndef __BAREBOX__ This decreases the binary size by about 5k on ARM, but the main reason for doing this is the idea that things that are not there don't need to be synced with upstream ubifs code. The __BAREBOX__ ifdeffery makes the code very hard to read and is a maintenance burden by itself, so it is removed here aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/ubifs/master.c')
-rw-r--r--fs/ubifs/master.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/fs/ubifs/master.c b/fs/ubifs/master.c
index 40d9ab4f35..3bf37c2b12 100644
--- a/fs/ubifs/master.c
+++ b/fs/ubifs/master.c
@@ -12,9 +12,7 @@
/* This file implements reading and writing the master node */
#include "ubifs.h"
-#ifdef __BAREBOX__
#include <linux/err.h>
-#endif
/**
* scan_for_master - search the valid master node.
@@ -335,57 +333,7 @@ int ubifs_read_master(struct ubifs_info *c)
if (err)
return err;
-#ifndef __BAREBOX__
- err = dbg_old_index_check_init(c, &c->zroot);
-#endif
return err;
}
-#ifndef __BAREBOX__
-/**
- * ubifs_write_master - write master node.
- * @c: UBIFS file-system description object
- *
- * This function writes the master node. Returns zero in case of success and a
- * negative error code in case of failure. The master node is written twice to
- * enable recovery.
- */
-int ubifs_write_master(struct ubifs_info *c)
-{
- int err, lnum, offs, len;
-
- ubifs_assert(!c->ro_media && !c->ro_mount);
- if (c->ro_error)
- return -EROFS;
-
- lnum = UBIFS_MST_LNUM;
- offs = c->mst_offs + c->mst_node_alsz;
- len = UBIFS_MST_NODE_SZ;
-
- if (offs + UBIFS_MST_NODE_SZ > c->leb_size) {
- err = ubifs_leb_unmap(c, lnum);
- if (err)
- return err;
- offs = 0;
- }
-
- c->mst_offs = offs;
- c->mst_node->highest_inum = cpu_to_le64(c->highest_inum);
-
- err = ubifs_write_node(c, c->mst_node, len, lnum, offs);
- if (err)
- return err;
-
- lnum += 1;
-
- if (offs == 0) {
- err = ubifs_leb_unmap(c, lnum);
- if (err)
- return err;
- }
- err = ubifs_write_node(c, c->mst_node, len, lnum, offs);
-
- return err;
-}
-#endif