bcachefs: kill redundant is_vmalloc_addr()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-09-01 15:09:11 -04:00
parent af05633d40
commit da2d20c98d

View File

@ -117,14 +117,10 @@ static inline int do_encrypt(struct crypto_sync_skcipher *tfm,
void *buf, size_t len) void *buf, size_t len)
{ {
if (!is_vmalloc_addr(buf)) { if (!is_vmalloc_addr(buf)) {
struct scatterlist sg; struct scatterlist sg = {};
sg_init_table(&sg, 1); sg_mark_end(&sg);
sg_set_page(&sg, sg_set_page(&sg, virt_to_page(buf), len, offset_in_page(buf));
is_vmalloc_addr(buf)
? vmalloc_to_page(buf)
: virt_to_page(buf),
len, offset_in_page(buf));
return do_encrypt_sg(tfm, nonce, &sg, len); return do_encrypt_sg(tfm, nonce, &sg, len);
} else { } else {
DARRAY_PREALLOCATED(struct scatterlist, 4) sgl; DARRAY_PREALLOCATED(struct scatterlist, 4) sgl;