]> www.infradead.org Git - mtd-utils.git/commitdiff
ubifs-utils: Adapt misc.h in libubifs
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 11 Nov 2024 09:00:55 +0000 (17:00 +0800)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Mon, 11 Nov 2024 09:32:45 +0000 (10:32 +0100)
Adapt misc.h in libubifs, compared with linux kernel implementations:
 1. Remove some functions(eg. ubifs_compr_name, ubifs_wake_up_bgt) which
    won't be used in fsck/mkfs.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubifs-utils/libubifs/misc.h

index 615878e884baa7bd135da62c44e26c889658308f..4b71806856f232ca13a01d2c777d84716c300393 100644 (file)
@@ -49,18 +49,6 @@ static inline int ubifs_zn_cow(const struct ubifs_znode *znode)
        return !!test_bit(COW_ZNODE, &znode->flags);
 }
 
-/**
- * ubifs_wake_up_bgt - wake up background thread.
- * @c: UBIFS file-system description object
- */
-static inline void ubifs_wake_up_bgt(struct ubifs_info *c)
-{
-       if (c->bgt && !c->need_bgt) {
-               c->need_bgt = 1;
-               wake_up_process(c->bgt);
-       }
-}
-
 /**
  * ubifs_tnc_find_child - find next child in znode.
  * @znode: znode to search at
@@ -81,42 +69,6 @@ ubifs_tnc_find_child(struct ubifs_znode *znode, int start)
        return NULL;
 }
 
-/**
- * ubifs_inode - get UBIFS inode information by VFS 'struct inode' object.
- * @inode: the VFS 'struct inode' pointer
- */
-static inline struct ubifs_inode *ubifs_inode(const struct inode *inode)
-{
-       return container_of(inode, struct ubifs_inode, vfs_inode);
-}
-
-/**
- * ubifs_compr_present - check if compressor was compiled in.
- * @compr_type: compressor type to check
- * @c: the UBIFS file-system description object
- *
- * This function returns %1 of compressor of type @compr_type is present, and
- * %0 if not.
- */
-static inline int ubifs_compr_present(struct ubifs_info *c, int compr_type)
-{
-       ubifs_assert(c, compr_type >= 0 && compr_type < UBIFS_COMPR_TYPES_CNT);
-       return !!ubifs_compressors[compr_type]->capi_name;
-}
-
-/**
- * ubifs_compr_name - get compressor name string by its type.
- * @compr_type: compressor type
- * @c: the UBIFS file-system description object
- *
- * This function returns compressor type string.
- */
-static inline const char *ubifs_compr_name(struct ubifs_info *c, int compr_type)
-{
-       ubifs_assert(c, compr_type >= 0 && compr_type < UBIFS_COMPR_TYPES_CNT);
-       return ubifs_compressors[compr_type]->name;
-}
-
 /**
  * ubifs_wbuf_sync - synchronize write-buffer.
  * @wbuf: write-buffer to synchronize
@@ -134,21 +86,6 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
        return err;
 }
 
-/**
- * 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)
-{
-       dev->new = cpu_to_le32(new_encode_dev(rdev));
-       return sizeof(dev->new);
-}
-
 /**
  * ubifs_add_dirt - add dirty space to LEB properties.
  * @c: the UBIFS file-system description object
@@ -209,7 +146,7 @@ struct ubifs_branch *ubifs_idx_branch(const struct ubifs_info *c,
  * @c: the UBIFS file-system description object
  * @idx: index node
  */
-static inline void *ubifs_idx_key(const struct ubifs_info *c,
+static inline void *ubifs_idx_key(__unused const struct ubifs_info *c,
                                  const struct ubifs_idx_node *idx)
 {
        return (void *)((struct ubifs_branch *)idx->branches)->key;
@@ -276,14 +213,4 @@ static inline int ubifs_next_log_lnum(const struct ubifs_info *c, int lnum)
        return lnum;
 }
 
-static inline int ubifs_xattr_max_cnt(struct ubifs_info *c)
-{
-       int max_xattrs = (c->leb_size / 2) / UBIFS_INO_NODE_SZ;
-
-       ubifs_assert(c, max_xattrs < c->max_orphans);
-       return max_xattrs;
-}
-
-const char *ubifs_assert_action_name(struct ubifs_info *c);
-
 #endif /* __UBIFS_MISC_H__ */