LOWEST_BIT_SET() is never used.
PO2_ROUNDUP_TYPED() has the same function as 'round_up()'.
osd_roundup2blocksz() can be further simplified using
DIV_ROUND_UP_ULL().
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I075328ec935eef49d3aeaf5ea1b79b943aadfa2e
Reviewed-on: https://review.whamcloud.com/40859
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
#define LIBCFS_VERSION "0.7.1"
-#define PO2_ROUNDUP_TYPED(x, po2, type) (-(-(type)(x) & -(type)(po2)))
-#define LOWEST_BIT_SET(x) ((x) & ~((x) - 1))
-
/* Sparse annotations */
#if !defined(__must_hold)
# ifdef __CHECKER__
size += offset % blksz;
if (likely(is_power_of_2(blksz)))
- return PO2_ROUNDUP_TYPED(size, blksz, uint64_t);
-
- size += blksz - 1;
- do_div(size, blksz);
- return size * blksz;
+ return round_up(size, blksz);
+ else
+ return DIV_ROUND_UP_ULL(size, blksz) * blksz;
}
static int osd_declare_write_commit(const struct lu_env *env,