mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julian Stecklina <julian.stecklina@cyberus-technology.de>
To: "hch@lst.de" <hch@lst.de>,
	"brauner@kernel.org" <brauner@kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>
Cc: "torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xiang@kernel.org" <xiang@kernel.org>,
	"linux-erofs@lists.ozlabs.org" <linux-erofs@lists.ozlabs.org>
Subject: Re: [PATCH v2 3/9] initrd: add a generic mechanism to add fs detectors
Date: Mon, 24 Mar 2025 09:35:02 +0000	[thread overview]
Message-ID: <15428e7e4dd2c548a3d4b6d8503a2d01070d3583.camel@cyberus-technology.de> (raw)
In-Reply-To: <20250322-initrd-erofs-v2-3-d66ee4a2c756@cyberus-technology.de>

On Sat, 2025-03-22 at 21:34 +0100, Julian Stecklina via B4 Relay wrote:
> 
>  #ifdef CONFIG_BLK_DEV_INITRD
>  extern void __init reserve_initrd_mem(void);
>  extern void wait_for_initramfs(void);
> +
> +/*
> + * Detect a filesystem on the initrd. You get 1 KiB (BLOCK_SIZE) of
> + * data to work with. The offset of the block is specified in
> + * initrd_fs_detect().
> + *
> + * @block_data: A pointer to BLOCK_SIZE of data
> + *
> + * Returns the size of the filesystem in bytes or 0, if the filesystem
> + * was not detected.
> + */
> +typedef size_t initrd_fs_detect_fn(void * const block_data);
> +
> +struct initrd_detect_fs {
> + initrd_fs_detect_fn *detect_fn;
> + loff_t detect_byte_offset;
> +};
> +
> +extern struct initrd_detect_fs __start_initrd_fs_detect[];
> +extern struct initrd_detect_fs __stop_initrd_fs_detect[];
> +
> +/*
> + * Add a filesystem detector for initrds. See the documentation of
> + * initrd_fs_detect_fn above.
> + */
> +#define initrd_fs_detect(fn, byte_offset) \
> + static const struct initrd_detect_fs __initrd_fs_detect_ ## fn \
> + __used __section("_initrd_fs_detect") = \
> + { .detect_fn = fn, .detect_byte_offset = byte_offset}
> +
>  #else
>  static inline void __init reserve_initrd_mem(void) {}
>  static inline void wait_for_initramfs(void) {}
> +
> +#define initrd_fs_detect(detectfn)

The !CONFIG_BLK_DEV_INITRD path is broken. Will fix in v3 and add it to my test
plan.

Julian

  reply	other threads:[~2025-03-24  9:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-22 20:34 [PATCH v2 0/9] initrd: cleanup and erofs support Julian Stecklina via B4 Relay
2025-03-22 20:34 ` [PATCH v2 1/9] initrd: remove ASCII spinner Julian Stecklina via B4 Relay
2025-03-25  6:42   ` David Disseldorp
2025-03-22 20:34 ` [PATCH v2 2/9] initrd: fix double fput for truncated ramdisks Julian Stecklina via B4 Relay
2025-03-22 20:34 ` [PATCH v2 3/9] initrd: add a generic mechanism to add fs detectors Julian Stecklina via B4 Relay
2025-03-24  9:35   ` Julian Stecklina [this message]
2025-03-22 20:34 ` [PATCH v2 4/9] fs: minix: register an initrd fs detector Julian Stecklina via B4 Relay
2025-03-22 23:26   ` kernel test robot
2025-03-22 20:34 ` [PATCH v2 5/9] fs: cramfs: " Julian Stecklina via B4 Relay
2025-03-22 20:34 ` [PATCH v2 6/9] fs: romfs: " Julian Stecklina via B4 Relay
2025-03-22 23:26   ` kernel test robot
2025-03-22 20:34 ` [PATCH v2 7/9] fs: squashfs: " Julian Stecklina via B4 Relay
2025-03-22 20:34 ` [PATCH v2 8/9] fs: ext2, ext4: " Julian Stecklina via B4 Relay
2025-03-22 23:36   ` kernel test robot
2025-03-22 20:34 ` [PATCH v2 9/9] fs: erofs: " Julian Stecklina via B4 Relay

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=15428e7e4dd2c548a3d4b6d8503a2d01070d3583.camel@cyberus-technology.de \
    --to=julian.stecklina@cyberus-technology.de \
    --cc=brauner@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiang@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®