]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux-uml/linux-uml-2.4.26/12-hostfs.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux-uml / linux-uml-2.4.26 / 12-hostfs.patch
1 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
2 --- linux-2.4.26-1.orig/arch/um/fs/hostfs/externfs.c    Mon May 17 23:36:17 2004
3 +++ linux-2.4.26-1.hno/arch/um/fs/hostfs/externfs.c     Tue May 18 00:10:42 2004
4 @@ -1133,7 +1133,7 @@
5         if((mount_arg != NULL) && (*mount_arg != '\0'))
6                 root = mount_arg;
7  
8 -       return(uml_strdup(mount_arg));
9 +       return(uml_strdup(root));
10  }
11  
12  struct super_block *hostfs_read_super(struct super_block *sb, void *data, 
13 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
14 --- linux-2.4.26-1.orig/arch/um/fs/hostfs/host_file.c   Mon May 17 23:36:17 2004
15 +++ linux-2.4.26-1.hno/arch/um/fs/hostfs/host_file.c    Tue May 18 11:40:47 2004
16 @@ -72,28 +72,21 @@
17  {
18         char tmp[HOSTFS_BUFSIZE], *file;
19         int mode = 0, err;
20 +       struct openflags flags = OPENFLAGS();
21  
22 -       if(r && !w) 
23 -               mode = O_RDONLY;
24 -       else if(!r && w) 
25 -               mode = O_WRONLY;
26 -       else if(r && w) 
27 -               mode = O_RDWR;
28 -       else {
29 -               printk("Impossible mode in host_open_file - r = %d, w = %d", 
30 -                      r, w);
31 -               return(-EINVAL);
32 -       }
33 -
34 +       if (r)
35 +           flags = of_read(flags);
36 +       if (w)
37 +           flags = of_write(flags);
38         if(append)
39 -               mode |= O_APPEND;
40 +           flags = of_append(flags);
41  
42         err = -ENOMEM;
43         file = get_path(path, tmp, sizeof(tmp));
44         if(file == NULL)
45                 goto out;
46         
47 -       err = open_filehandle(file, of_create(of_rdwr(OPENFLAGS())), mode, fh);
48 +       err = open_filehandle(file, flags, 0, fh);
49   out:
50         free_path(file, tmp);
51         return(err);
52 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
53 --- linux-2.4.26-1.orig/arch/um/fs/hostfs/host_fs.c     Mon May 17 23:36:17 2004
54 +++ linux-2.4.26-1.hno/arch/um/fs/hostfs/host_fs.c      Tue May 18 11:38:51 2004
55 @@ -111,10 +111,14 @@
56  {
57         const char *path[] = { jail_dir, mount, file, NULL };
58         int uid;
59 +       int gid;
60 +       int rc;
61  
62 +       /* These should be mount flags from an internal "superblock" */
63         *uid_out = 0;
64 +       *gid_out = 0;
65         return(host_stat_file(path, dev_out, inode_out, mode_out, nlink_out, 
66 -                             &uid, gid_out, size_out, atime_out, mtime_out, 
67 +                             &uid, &gid, size_out, atime_out, mtime_out, 
68                               ctime_out, blksize_out, blocks_out));
69  }
70  
71 @@ -138,6 +142,12 @@
72                 goto out;
73  
74         err = host_open_file(path, 1, 1, fh);
75 +       if (err == -EISDIR) {
76 +           kfree(fh);
77 +           return NULL;
78 +       }
79 +       if (err == -EPERM)
80 +           err = host_open_file(path, 1, 0, fh);
81         if(err)
82                 goto out_free;
83  
84 @@ -175,10 +185,9 @@
85                                 len - ignore_end);
86  
87   out:
88 -       if(err < 0)
89 -               (*completion)(buf, err, arg);
90 -       else err = 0;
91 -
92 +       (*completion)(buf, err, arg);
93 +       if (err > 0)
94 +           err = 0;
95         return(err);
96  }
97  
98 @@ -191,8 +200,9 @@
99  
100         err = write_file(fh, offset + start, buf + start, len);
101  
102 -       if(err < 0)
103 -               (*completion)((char *) buf, err, arg);
104 +       (*completion)((char *) buf, err, arg);
105 +       if (err > 0)
106 +           err = 0;
107         return(err);
108  }
109