On Mon, Mar 07, 2016 at 03:54:24PM -0800, Keith Mok wrote:
> No, other common filesystem use this BUG_ON in this way, pls read:
> fs/btrfs/hash.c
> fs/ext4/ext4.h
> and even the BUG_ON is used inside crc32c function that is exported by
> libcrc32c.c which xfs and many other drivers are using:
> lib
On Wed, Mar 02, 2016 at 12:01:02PM -0800, Keith Mok wrote:
> Will update the first BUG_ON by using SHASH_DESC_ON_STACK.
I meant, for *every* BUG_ONs, doing like:
if (err)
return original f2fs_crc32();
Thanks,
>
>
> 2016-03-02 10:21 GMT-08:00 Jaegeuk Kim :
> > Hi Keith,
No, other common filesystem use this BUG_ON in this way, pls read:
fs/btrfs/hash.c
fs/ext4/ext4.h
and even the BUG_ON is used inside crc32c function that is exported by
libcrc32c.c which xfs and many other drivers are using:
lib/libcrc32c.c
fs/xfs/libxfs/xfs_cksum.h
If it should have some fallbac
Will update the first BUG_ON by using SHASH_DESC_ON_STACK.
2016-03-02 10:21 GMT-08:00 Jaegeuk Kim :
> Hi Keith,
>
>> +static inline __u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void
>> *address,
>> +unsigned int length)
>> +{
>> + struct {
>> + struct
Hi Keith,
> +static inline __u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void *address,
> +unsigned int length)
> +{
> + struct {
> + struct shash_desc shash;
> + char ctx[4];
> + } desc;
> + int err;
> +
> + BUG_ON(crypto_shash_de
Hi,
> f2fs_crc32/f2fs_crc_valid won't been invoked very often, so I don't think
that would cause much overhead in calculation and make things slow.
Right, the gain is not that big. But I think it still worth it. That's
not much code changes for it.
> Moreover, we could suffer crash if any error o
Hi,
> -Original Message-
> From: Keith Mok [mailto:ek9...@gmail.com]
> Sent: Tuesday, March 01, 2016 7:13 AM
> To: linux-f2fs-devel@lists.sourceforge.net
> Cc: chao2...@samsung.com; cm224@samsung.com; jaeg...@kernel.org; Keith
> Mok; Keith Mok
> Subject: [PATCH] f2fs: Use crypto crc32
The crc function is done bit by bit and
painfully slow, switch to use crypto
crc32 function which is backed by h/w/ acceleration.
Signed-off-by: Keith Mok
---
fs/f2fs/Kconfig | 2 ++
fs/f2fs/checkpoint.c | 6 +++---
fs/f2fs/f2fs.h | 52 +++