diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-26 00:41:21 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-26 00:41:21 +0100 |
commit | ae1d3b974e091b5fc9008bd41bcbdaac68110b62 (patch) | |
tree | 82e50a66925ced79f59ed4504f6e073ef55edee3 /fs/ubifs/misc.h | |
parent | 586893ebc42943008010b4c210cfc9167df615e5 (diff) | |
parent | 7a2207a0e1142a9b214b323e43ab2ecc592e5b0e (diff) |
Merge branch 'for-rmk' of git://github.com/at91linux/linux-2.6-at91 into devel-stable
Diffstat (limited to 'fs/ubifs/misc.h')
-rw-r--r-- | fs/ubifs/misc.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index c3de04dc952a..0b5296a9a4c5 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h @@ -340,4 +340,21 @@ static inline void ubifs_release_lprops(struct ubifs_info *c) mutex_unlock(&c->lp_mutex); } +/** + * ubifs_next_log_lnum - switch to the next log LEB. + * @c: UBIFS file-system description object + * @lnum: current log LEB + * + * This helper function returns the log LEB number which goes next after LEB + * 'lnum'. + */ +static inline int ubifs_next_log_lnum(const struct ubifs_info *c, int lnum) +{ + lnum += 1; + if (lnum > c->log_last) + lnum = UBIFS_LOG_LNUM; + + return lnum; +} + #endif /* __UBIFS_MISC_H__ */ |