Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1754605ybl; Thu, 19 Dec 2019 02:26:11 -0800 (PST) X-Google-Smtp-Source: APXvYqx0IwKKg+88jUzBz00iHI/Xqj/W3tEcUyizWecloOO1GrhXsMBlo2WTmQU8SIk/YThvgcga X-Received: by 2002:a9d:624e:: with SMTP id i14mr8191904otk.371.1576751171880; Thu, 19 Dec 2019 02:26:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576751171; cv=none; d=google.com; s=arc-20160816; b=vEggnAc329DZBmhqcKJN6eqUnwmuaUQk4Z7KG+x95jH2NqnoKf7KubXogQtj0nY9pr STVWCVMUNsndy4jaWaNHi3Ughm/nctUcjcX+tP3JbicMnTiJuOJKwzOrh19OdrvyHN+a CiepAwvLTeiGdhF/MbT0I1Wpc5U78WTBlRHqDXj0LcgHrgxik+qKhjl+eYoitfEYFYQf RoNiCkY1BUewQZ9LnzvYs+ODtpfLOiR/dTuPgwQRgQ69bB5jaAuuyikPk9YbDOtgfRMT 83zuow0MQD7chGvGh4SG9EYArzDNFBHSFrtt+fXrGGFyNgHqrqkXQpfLKO0ZjQVLgA3q 7FPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=qXY/bekMxM74rBpabc0IortWdwZ5JIbPWlc66tqqZzg=; b=Gt+mWaiAHV7fJcXBSTNfOkGLQH/h/il7Fp1CkVVeMHTWexlqi+FHUfjhjJLXULYZIa ZbnlDKS/E44F7nVf7snx8c8Zx9oHGpw0qQNph0/MlsCvBXG58doIuMb5sQesH5nnkPRu JGBhgpUdvw8B5f26qzVEoPoJSFEfTF9Bw0LF9kO2nI5CulTET3Zs95u6tlr/nG3KzwN7 m6ceC+eem2tfq4dPb2RUedE6/xx7jEEQbgqLzYui8EEPtS1ztyFlzeVLxk/AjMATohMo 1bUfUCqIAfOJIPXKVEx8zc+qXmWBDjByFfjOdnyMBWfvbI4xp2VTLThXNuxAqFPi1k/t k7wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si3132536otl.54.2019.12.19.02.25.59; Thu, 19 Dec 2019 02:26:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbfLSKZX (ORCPT + 99 others); Thu, 19 Dec 2019 05:25:23 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:34851 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbfLSKZX (ORCPT ); Thu, 19 Dec 2019 05:25:23 -0500 Received: by mail-ot1-f68.google.com with SMTP id k16so2064351otb.2; Thu, 19 Dec 2019 02:25:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qXY/bekMxM74rBpabc0IortWdwZ5JIbPWlc66tqqZzg=; b=FIAqo9lY19UD6opTdjw4fQ0qX+bhIhny2agEy6XvVcN7jWMG9AYO1U2hZcQMNQuriv 8n72zFSozAJPVnVUuAXLMbKEbiAXS3z22RcOAar37wU2VtUnaW6HiRF/2uhon9Ye54Ue vI7vC2YJcNsLykdA38iWjGxgYoLGMRTociTfqxiHa1otuRWLcCyZJORiaj/mxHdUTp2G +94HQywKG+FTW+49QnrMzTZQjy2Plw9sPAjcT7G2KOQ2U9zTQ8GgfytQIiBx9ZgPlWex wvbBnkvTxiiwfpUKWrK8r586+BpDZj64teYyPNKoBeV68JZMGYpsXJV+Gj/WhPBz2yIT wdnw== X-Gm-Message-State: APjAAAVqrHsLVd/UX7B4OyiIeli9gpuAzbsgSq1aKGKI4KWKnQuEaV6x TTy2vt2W45r6VgBPEHfyHsYOUYpFyVQAIDFJFwg= X-Received: by 2002:a05:6830:2141:: with SMTP id r1mr7956333otd.39.1576751122361; Thu, 19 Dec 2019 02:25:22 -0800 (PST) MIME-Version: 1.0 References: <20191216062806.112361-1-yuchao0@huawei.com> In-Reply-To: <20191216062806.112361-1-yuchao0@huawei.com> From: Geert Uytterhoeven Date: Thu, 19 Dec 2019 11:25:11 +0100 Message-ID: Subject: Re: [RFC PATCH v5] f2fs: support data compression To: Chao Yu Cc: Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net, Linux Kernel Mailing List , Chao Yu , Linux-Next Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Dec 16, 2019 at 7:29 AM Chao Yu 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. Reported-by: > + } > + > + 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