Re: [PATCH v4 11/13] btrfs: directly call into crypto framework for checsumming

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

 



On Mon, Jun 03, 2019 at 04:58:57PM +0200, Johannes Thumshirn wrote:
> +		crypto_shash_init(shash);
>  
>  		kaddr = kmap_atomic(page);
> -		csum = btrfs_csum_data(kaddr, csum, PAGE_SIZE);
> -		btrfs_csum_final(csum, (u8 *)&csum);
> +		crypto_shash_update(shash, kaddr, PAGE_SIZE);
> +		crypto_shash_final(shash, (u8 *)&csum);
>  		kunmap_atomic(kaddr);

I've noticed the code below doing the kmap/hash/kunmap places the
mapping just around the update phase so I reordered it in this function
too like:

	crypto_shash_init(shash);
	kaddr = kmap_atomic(page);
	crypto_shash_update(shash, kaddr, PAGE_SIZE);
	kunmap_atomic(kaddr);
	crypto_shash_final(shash, (u8 *)&csum);



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux