Re: What populates /proc/partitions ?

From: Brian Masney
Date: Mon Sep 30 2019 - 19:46:21 EST


On Mon, Sep 30, 2019 at 03:47:21PM -0700, David F. wrote:
> Hi,
>
> I want to find out why fd0 is being added to /proc/partitions and stop
> that for my build. I've searched "/proc/partitions" and "partitions",
> not finding anything that matters.

It looks like it is done in block/genhd.c with this function:

static int __init proc_genhd_init(void)
{
proc_create_seq("diskstats", 0, NULL, &diskstats_op);
proc_create_seq("partitions", 0, NULL, &partitions_op);
return 0;
}
module_init(proc_genhd_init);

Brian


>
> If udev is doing it, what function is it call so I can search on that?
>
> TIA!!