diff options
author | Richard Weinberger <richard@nod.at> | 2018-07-12 13:01:57 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-08-15 00:25:21 +0200 |
commit | 6eb61d587f4515e4be5669eff383c0185009954f (patch) | |
tree | a5d3183e104338319152a888e0ff980c2546e6e1 /fs/ubifs/misc.h | |
parent | ubifs: Turn two ubifs_assert() into a WARN_ON() (diff) | |
download | linux-6eb61d587f4515e4be5669eff383c0185009954f.tar.xz linux-6eb61d587f4515e4be5669eff383c0185009954f.zip |
ubifs: Pass struct ubifs_info to ubifs_assert()
This allows us to have more context in ubifs_assert()
and take different actions depending on the configuration.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/misc.h')
-rw-r--r-- | fs/ubifs/misc.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index caf83d68fb38..f5d180c0c52e 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h @@ -105,25 +105,27 @@ static inline struct ubifs_inode *ubifs_inode(const struct inode *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(int compr_type) +static inline int ubifs_compr_present(struct ubifs_info *c, int compr_type) { - ubifs_assert(compr_type >= 0 && compr_type < UBIFS_COMPR_TYPES_CNT); + 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(int compr_type) +static inline const char *ubifs_compr_name(struct ubifs_info *c, int compr_type) { - ubifs_assert(compr_type >= 0 && compr_type < UBIFS_COMPR_TYPES_CNT); + ubifs_assert(c, compr_type >= 0 && compr_type < UBIFS_COMPR_TYPES_CNT); return ubifs_compressors[compr_type]->name; } @@ -262,8 +264,8 @@ static inline void ubifs_get_lprops(struct ubifs_info *c) */ static inline void ubifs_release_lprops(struct ubifs_info *c) { - ubifs_assert(mutex_is_locked(&c->lp_mutex)); - ubifs_assert(c->lst.empty_lebs >= 0 && + ubifs_assert(c, mutex_is_locked(&c->lp_mutex)); + ubifs_assert(c, c->lst.empty_lebs >= 0 && c->lst.empty_lebs <= c->main_lebs); mutex_unlock(&c->lp_mutex); } |