summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/misc.h
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/misc.h
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/misc.h')
-rw-r--r--fs/ubifs/misc.h41
1 files changed, 2 insertions, 39 deletions
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
index c0597d04f2..4822dd3b92 100644
--- a/fs/ubifs/misc.h
+++ b/fs/ubifs/misc.h
@@ -133,27 +133,6 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
return err;
}
-#ifndef __BAREBOX__
-/**
- * ubifs_encode_dev - encode device node IDs.
- * @dev: UBIFS device node information
- * @rdev: device IDs to encode
- *
- * This is a helper function which encodes major/minor numbers of a device node
- * into UBIFS device node description. We use standard Linux "new" and "huge"
- * encodings.
- */
-static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
-{
- if (new_valid_dev(rdev)) {
- dev->new = cpu_to_le32(new_encode_dev(rdev));
- return sizeof(dev->new);
- } else {
- dev->huge = cpu_to_le64(huge_encode_dev(rdev));
- return sizeof(dev->huge);
- }
-}
-#endif
/**
* ubifs_add_dirt - add dirty space to LEB properties.
@@ -166,7 +145,7 @@ static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
*/
static inline int ubifs_add_dirt(struct ubifs_info *c, int lnum, int dirty)
{
- return ubifs_update_one_lp(c, lnum, LPROPS_NC, dirty, 0, 0);
+ return 0;
}
/**
@@ -180,8 +159,7 @@ static inline int ubifs_add_dirt(struct ubifs_info *c, int lnum, int dirty)
*/
static inline int ubifs_return_leb(struct ubifs_info *c, int lnum)
{
- return ubifs_change_one_lp(c, lnum, LPROPS_NC, LPROPS_NC, 0,
- LPROPS_TAKEN, 0);
+ return 0;
}
/**
@@ -217,27 +195,12 @@ struct ubifs_branch *ubifs_idx_branch(const struct ubifs_info *c,
static inline void *ubifs_idx_key(const struct ubifs_info *c,
const struct ubifs_idx_node *idx)
{
-#ifndef __BAREBOX__
- return (void *)((struct ubifs_branch *)idx->branches)->key;
-#else
struct ubifs_branch *tmp;
tmp = (struct ubifs_branch *)idx->branches;
return (void *)tmp->key;
-#endif
}
-#ifndef __BAREBOX__
-/**
- * ubifs_current_time - round current time to time granularity.
- * @inode: inode
- */
-static inline struct timespec ubifs_current_time(struct inode *inode)
-{
- return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
- current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
-}
-#endif
/**
* ubifs_tnc_lookup - look up a file-system node.