aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux-uml/linux-uml-2.4.26/12-hostfs.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux-uml/linux-uml-2.4.26/12-hostfs.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.bz2
openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.zip
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux-uml/linux-uml-2.4.26/12-hostfs.patch')
-rw-r--r--recipes/linux-uml/linux-uml-2.4.26/12-hostfs.patch109
1 files changed, 109 insertions, 0 deletions
diff --git a/recipes/linux-uml/linux-uml-2.4.26/12-hostfs.patch b/recipes/linux-uml/linux-uml-2.4.26/12-hostfs.patch
new file mode 100644
index 0000000000..124f975650
--- /dev/null
+++ b/recipes/linux-uml/linux-uml-2.4.26/12-hostfs.patch
@@ -0,0 +1,109 @@
+diff -ru linux-2.4.26-1.orig/arch/um/fs/hostfs/externfs.c linux-2.4.26-1.hno/arch/um/fs/hostfs/externfs.c
+--- linux-2.4.26-1.orig/arch/um/fs/hostfs/externfs.c Mon May 17 23:36:17 2004
++++ linux-2.4.26-1.hno/arch/um/fs/hostfs/externfs.c Tue May 18 00:10:42 2004
+@@ -1133,7 +1133,7 @@
+ if((mount_arg != NULL) && (*mount_arg != '\0'))
+ root = mount_arg;
+
+- return(uml_strdup(mount_arg));
++ return(uml_strdup(root));
+ }
+
+ struct super_block *hostfs_read_super(struct super_block *sb, void *data,
+diff -ru linux-2.4.26-1.orig/arch/um/fs/hostfs/host_file.c linux-2.4.26-1.hno/arch/um/fs/hostfs/host_file.c
+--- linux-2.4.26-1.orig/arch/um/fs/hostfs/host_file.c Mon May 17 23:36:17 2004
++++ linux-2.4.26-1.hno/arch/um/fs/hostfs/host_file.c Tue May 18 11:40:47 2004
+@@ -72,28 +72,21 @@
+ {
+ char tmp[HOSTFS_BUFSIZE], *file;
+ int mode = 0, err;
++ struct openflags flags = OPENFLAGS();
+
+- if(r && !w)
+- mode = O_RDONLY;
+- else if(!r && w)
+- mode = O_WRONLY;
+- else if(r && w)
+- mode = O_RDWR;
+- else {
+- printk("Impossible mode in host_open_file - r = %d, w = %d",
+- r, w);
+- return(-EINVAL);
+- }
+-
++ if (r)
++ flags = of_read(flags);
++ if (w)
++ flags = of_write(flags);
+ if(append)
+- mode |= O_APPEND;
++ flags = of_append(flags);
+
+ err = -ENOMEM;
+ file = get_path(path, tmp, sizeof(tmp));
+ if(file == NULL)
+ goto out;
+
+- err = open_filehandle(file, of_create(of_rdwr(OPENFLAGS())), mode, fh);
++ err = open_filehandle(file, flags, 0, fh);
+ out:
+ free_path(file, tmp);
+ return(err);
+diff -ru linux-2.4.26-1.orig/arch/um/fs/hostfs/host_fs.c linux-2.4.26-1.hno/arch/um/fs/hostfs/host_fs.c
+--- linux-2.4.26-1.orig/arch/um/fs/hostfs/host_fs.c Mon May 17 23:36:17 2004
++++ linux-2.4.26-1.hno/arch/um/fs/hostfs/host_fs.c Tue May 18 11:38:51 2004
+@@ -111,10 +111,14 @@
+ {
+ const char *path[] = { jail_dir, mount, file, NULL };
+ int uid;
++ int gid;
++ int rc;
+
++ /* These should be mount flags from an internal "superblock" */
+ *uid_out = 0;
++ *gid_out = 0;
+ return(host_stat_file(path, dev_out, inode_out, mode_out, nlink_out,
+- &uid, gid_out, size_out, atime_out, mtime_out,
++ &uid, &gid, size_out, atime_out, mtime_out,
+ ctime_out, blksize_out, blocks_out));
+ }
+
+@@ -138,6 +142,12 @@
+ goto out;
+
+ err = host_open_file(path, 1, 1, fh);
++ if (err == -EISDIR) {
++ kfree(fh);
++ return NULL;
++ }
++ if (err == -EPERM)
++ err = host_open_file(path, 1, 0, fh);
+ if(err)
+ goto out_free;
+
+@@ -175,10 +185,9 @@
+ len - ignore_end);
+
+ out:
+- if(err < 0)
+- (*completion)(buf, err, arg);
+- else err = 0;
+-
++ (*completion)(buf, err, arg);
++ if (err > 0)
++ err = 0;
+ return(err);
+ }
+
+@@ -191,8 +200,9 @@
+
+ err = write_file(fh, offset + start, buf + start, len);
+
+- if(err < 0)
+- (*completion)((char *) buf, err, arg);
++ (*completion)((char *) buf, err, arg);
++ if (err > 0)
++ err = 0;
+ return(err);
+ }
+