All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Chang <mchang@suse.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] i386-pc: build btrfs zstd support into separate module
Date: Thu, 2 Sep 2021 13:48:30 +0800	[thread overview]
Message-ID: <20210902054830.GA9354@mazu> (raw)
In-Reply-To: <20210901163822.5vq766pc2wdjveef@tomti.i.net-space.pl>

On Wed, Sep 01, 2021 at 06:38:22PM +0200, Daniel Kiper wrote:
> On Tue, Aug 31, 2021 at 03:12:28PM +0800, Michael Chang via Grub-devel wrote:
> > The zstd support in btrfs brings significant size increment to the
> > on-disk image that it can no longer fit into btrfs bootloader area and
> > short mbr gap.
> >
> > In order to support grub update on outstanding i386-pc setup with these
> > size constraints remain in place, here we build the zstd suppprt of
> > btrfs into a separate module, named btrfs_zstd, to alleviate the size
> > change. Please note this only makes it's way to i386-pc, other
> > architecture is not affected.
> 
> I am OK with extracting zstd code from btrfs code. However, I want that be
> done for all architectures and platforms. No exceptions.

May I ask for more background about this decision ?

Given that btrfs compression is per file property and can be
recompressed on the fly, there is no way to detect it beforehand thus
the safest bet is to assume that it is always needed. In other words if
the platform has no known limitation on the size of image, the zstd code
should be indivisible to btrfs.mo.

> 
> [...]
> 
> > diff --git a/grub-core/fs/btrfs_zstd.c b/grub-core/fs/btrfs_zstd.c
> > new file mode 100644
> > index 000000000..d5d1e013c
> > --- /dev/null
> > +++ b/grub-core/fs/btrfs_zstd.c
> > @@ -0,0 +1,36 @@
> > +/*
> > + *  GRUB  --  GRand Unified Bootloader
> > + *  Copyright (C) 2008  Free Software Foundation, Inc.
> > + *
> > + *  GRUB is free software: you can redistribute it and/or modify
> > + *  it under the terms of the GNU General Public License as published by
> > + *  the Free Software Foundation, either version 3 of the License, or
> > + *  (at your option) any later version.
> > + *
> > + *  GRUB is distributed in the hope that it will be useful,
> > + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *  GNU General Public License for more details.
> > + *
> > + *  You should have received a copy of the GNU General Public License
> > + *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
> > + */
> > +
> > +#include <grub/types.h>
> > +#include <grub/dl.h>
> > +/* For NULL.  */
> > +#include <grub/mm.h>
> > +#include <grub/btrfs.h>
> > +#include <grub/lib/zstd.h>
> > +
> > +GRUB_MOD_LICENSE ("GPLv3+");
> > +
> > +GRUB_MOD_INIT (btrfs_zstd)
> > +{
> > +  grub_btrfs_zstd_decompress_func = grub_zstd_decompress;
> 
> Please create a function in btrfs module which will do this for you.

Sure. np.

> 
> > +}
> > +
> > +GRUB_MOD_FINI (btrfs_zstd)
> > +{
> > +  grub_btrfs_zstd_decompress_func = NULL;
> 
> Ditto.

OK.

> 
> Last but not least, please CC original author of zstd support next time.

OK. I will CC Nick Terrell next time.

Thank you very much for the review.

Regards,
Michael

> 
> Daniel
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



  reply	other threads:[~2021-09-02  5:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  7:12 [PATCH] i386-pc: build btrfs zstd support into separate module Michael Chang
2021-09-01 16:38 ` Daniel Kiper
2021-09-02  5:48   ` Michael Chang [this message]
2021-09-02 12:12     ` Daniel Kiper
2021-09-03  1:21       ` Michael Chang
2021-09-08 19:37         ` Daniel Kiper
2021-09-10  9:22           ` Michael Chang
2021-10-26 12:55             ` Daniel Kiper
2021-10-27  3:14               ` Michael Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210902054830.GA9354@mazu \
    --to=mchang@suse.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.