[PATCH 09/10] fs: allocate FILE table dynamically

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

 



Some systems are runnignfrom a very limited SRAM, but have a huge
malloc space in SDRAM. The bss normally is in SRAM, so we should
avoid having big structures there. The FILE table is 5120 bytes
big, so allocate it dynamically instead.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 fs/fs.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index 6346112..7e2fb78 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -119,14 +119,19 @@ EXPORT_SYMBOL(mkmodestr);
 
 static char *cwd;
 
-static int init_cwd(void)
+static FILE *files;
+
+static int init_fs(void)
 {
 	cwd = xzalloc(PATH_MAX);
 	*cwd = '/';
+
+	files = xzalloc(sizeof(FILE) * MAX_FILES);
+
 	return 0;
 }
 
-postcore_initcall(init_cwd);
+postcore_initcall(init_fs);
 
 char *normalise_link(const char *pathname, const char *symlink)
 {
@@ -268,8 +273,6 @@ char *get_mounted_path(const char *path)
 	return fdev->path;
 }
 
-static FILE files[MAX_FILES];
-
 static FILE *get_file(void)
 {
 	int i;
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux