Re: [PATCH RFC 1/8] staging: apfs: init lzfse compression library for APFS

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

 



On Fri, Mar 14, 2025 at 05:57:47PM -0400, Ethan Carter Edwards wrote:
> +static size_t lzfse_decode_buffer_with_scratch(uint8_t *__restrict dst_buffer,
> +                         size_t dst_size, const uint8_t *__restrict src_buffer,
> +                         size_t src_size, void *__restrict scratch_buffer) {
> +  int status;
> +  lzfse_decoder_state *s = (lzfse_decoder_state *)scratch_buffer;
> +  memset(s, 0x00, sizeof(*s));
> +
> +  // Initialize state
> +  s->src = src_buffer;
> +  s->src_begin = src_buffer;
> +  s->src_end = s->src + src_size;
> +  s->dst = dst_buffer;
> +  s->dst_begin = dst_buffer;
> +  s->dst_end = dst_buffer + dst_size;
> +
> +  // Decode
> +  status = lzfse_decode(s);
> +  if (status == LZFSE_STATUS_DST_FULL)
> +    return dst_size;
> +  if (status != LZFSE_STATUS_OK)
> +    return 0;                           // failed
> +  return (size_t)(s->dst - dst_buffer); // bytes written
> +}

You'd be better off doing a reformat of the white space before sending
the driver.  The really basic stuff.

regards,
dan carpenter





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

  Powered by Linux