Re: [PATCH] add romfs_get_size()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Wed, 7 Sep 2005 16:04:39 +0100,
Christoph Hellwig wrote:
> 
> On Wed, Sep 07, 2005 at 11:31:36PM +0900, Yasushi SHOJI wrote:
> > > On Wed, Sep 07, 2005 at 11:22:19PM +0900, Yasushi SHOJI wrote:
> > > > Many embedded linux products have been using romfs and it's still
> > > > growing.  most, if not all, of them implement thier own way to check
> > > > its romfs size.
> > > > 
> > > > this patch provides this commonly used function.
> > > 
> > > Used where.  Please come back as soon as you have a caller in-tree
> > > which makes sense..
> > 
> > i don't know this one make sense but the biggest user is uclinux mtd
> > map. in uclinux_mtd_init():
> 
> I don't quite see the corelation.  Anyway, please submit a patch series
> that converts whatever wrong variant to the new one, describing each
> patch in detail, and adding proper ROMFS depencies to the places using
> it.

I don't have most of platform to test. sure it's easy to just convert
them using romfs_get_size() but I don't wanna submit any patch that I
can't test.

So, if the patch is not that bad, it'd be much easier to just tell all
platform maintainer that the infra. is in place and they can start
converting their code to use new function.

Anyway I just converted uclinux.c to use romfs_get_size(). Greg, would
you kindly comment on the attached patch?

Signed-off-by: Yasushi SHOJI <[email protected]>
---
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
+#include <linux/romfs_fs.h>
 #include <linux/major.h>
 #include <linux/root_dev.h>
 #include <linux/mtd/mtd.h>
@@ -63,7 +64,7 @@ int __init uclinux_mtd_init(void)
 
 	mapp = &uclinux_ram_map;
 	mapp->phys = (unsigned long) &_ebss;
-	mapp->size = PAGE_ALIGN(*((unsigned long *)((&_ebss) + 8)));
+	mapp->size = PAGE_ALIGN(romfs_get_size((struct romfs_super_block *)&_ebss));
 	mapp->bankwidth = 4;
 
 	printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n",

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux