Re: [PATCH 1/6] fs/bio-integrity: remove duplicate code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static int bio_integrity_generate_verify(struct bio *bio, int operate)
>  {

> +	if (operate)
> +		sector = bio->bi_iter.bi_sector;
> +	else
> +		sector = bio->bi_integrity->bip_iter.bi_sector;

> +		if (operate) {
> +			bi->generate_fn(&bix);
> +		} else {
> +			ret = bi->verify_fn(&bix);
> +			if (ret) {
> +				kunmap_atomic(kaddr);
> +				return ret;
> +			}
> +		}

I was glad to see this replaced with explicit sector and func arguments
in later refactoring in the 6/ patch.

But I don't think the function poiner casts in that 6/ patch are wise
(Or even safe all the time, given crazy function pointer trampolines?
Is that still a thing?).  I'd have made a single walk_fn type that
returns and have the non-returning iterators just return 0.

- z
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux