lkml.org 
[lkml]   [2019]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v5] f2fs: support data compression
On 12/19, Geert Uytterhoeven wrote:
> Hi,
>
> On Mon, Dec 16, 2019 at 7:29 AM Chao Yu <yuchao0@huawei.com> wrote:
> >
> > This patch tries to support compression in f2fs.
>
>
>
> > --- a/fs/f2fs/file.c
> > +++ b/fs/f2fs/file.c
>
> > @@ -667,6 +719,24 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
> > return err;
> > }
> >
> > +int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
> > +{
> > + u64 free_from = from;
> > +
> > + /*
> > + * for compressed file, only support cluster size
> > + * aligned truncation.
> > + */
> > + if (f2fs_compressed_file(inode)) {
> > + size_t cluster_size = PAGE_SIZE <<
> > + F2FS_I(inode)->i_log_cluster_size;
> > +
> > + free_from = roundup(from, cluster_size);
>
> This is a 64-by-32 or 64-by-64 division, causing a link failure on
> 32-bit platforms:
>
> fs/f2fs/file.o: In function `f2fs_truncate_blocks':
> file.c:(.text+0x1db4): undefined reference to `__udivdi3'
>
> Please use DIV_ROUND_UP_ULL() instead.

Thanks, I applied it in:
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev

>
> Reported-by: <noreply@ellerman.id.au>
>
> > + }
> > +
> > + return do_truncate_blocks(inode, free_from, lock);
> > +}
>
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

\
 
 \ /
  Last update: 2019-12-20 22:26    [W:0.132 / U:4.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site