Whamcloud - gitweb
Add separate file for MDS filesystem interaction routines.
[fs/lustre-release.git] / lustre / patches / patch-2.4.16
1 --- /usr/src/linux-2.4.16/fs/reiserfs/file.c.obd-orig   Thu Dec 13 14:35:00 2001
2 +++ /usr/src/linux-2.4.16/fs/reiserfs/file.c    Thu Dec 13 14:35:08 2001
3 @@ -28,8 +28,8 @@
4      struct reiserfs_transaction_handle th ;
5      int windex ;
6  
7 -    if (!S_ISREG (inode->i_mode))
8 -       BUG ();
9 +    //if (!S_ISREG (inode->i_mode))
10 +    //BUG ();
11  
12      /* fast out for when nothing needs to be done */
13      if ((atomic_read(&inode->i_count) > 1 ||
14 --- /usr/src/linux-2.4.16/fs/namespace.c.obd-orig       Tue Dec 11 20:44:15 2001
15 +++ /usr/src/linux-2.4.16/fs/namespace.c        Tue Dec 11 20:44:35 2001
16 @@ -332,7 +332,7 @@
17         }
18  }
19  
20 -static int do_umount(struct vfsmount *mnt, int flags)
21 +int do_umount(struct vfsmount *mnt, int flags)
22  {
23         struct super_block * sb = mnt->mnt_sb;
24         int retval = 0;
25 --- /usr/src/linux-2.4.16/kernel/ksyms.c.obd-orig       Tue Dec 11 14:22:09 2001
26 +++ /usr/src/linux-2.4.16/kernel/ksyms.c        Tue Dec 11 18:05:30 2001
27 @@ -268,6 +268,7 @@
28  EXPORT_SYMBOL(__pollwait);
29  EXPORT_SYMBOL(poll_freewait);
30  EXPORT_SYMBOL(ROOT_DEV);
31 +EXPORT_SYMBOL(pagecache_lock);
32  EXPORT_SYMBOL(__find_get_page);
33  EXPORT_SYMBOL(__find_lock_page);
34  EXPORT_SYMBOL(grab_cache_page);
35 --- /usr/src/linux-2.4.16/mm/filemap.c.obd-orig Mon Nov 26 06:29:17 2001
36 +++ /usr/src/linux-2.4.16/mm/filemap.c  Tue Dec 11 14:29:50 2001
37 @@ -2846,8 +2846,7 @@
38   * file system has to do this all by itself, unfortunately.
39   *                                                     okir@monad.swb.de
40   */
41 -ssize_t
42 -generic_file_write(struct file *file,const char *buf,size_t count, loff_t *ppos)
43 +ssize_t do_generic_file_write(struct file *file,const char *buf,size_t count,loff_t *ppos, int (*actor)(char *, char *, size_t ))
44  {
45         struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
46         struct inode    *inode = mapping->host;
47 @@ -2862,8 +2861,10 @@
48         if ((ssize_t) count < 0)
49                 return -EINVAL;
50  
51 +#if 0
52         if (!access_ok(VERIFY_READ, buf, count))
53                 return -EFAULT;
54 +#endif
55  
56         cached_page = NULL;
57  
58 @@ -2987,10 +2988,12 @@
59                  * same page as we're writing to, without it being marked
60                  * up-to-date.
61                  */
62 +#if 0
63                 { volatile unsigned char dummy;
64                         __get_user(dummy, buf);
65                         __get_user(dummy, buf+bytes-1);
66                 }
67 +#endif
68  
69                 status = -ENOMEM;       /* we'll assign it later anyway */
70                 page = __grab_cache_page(mapping, index, &cached_page);
71 @@ -3006,7 +3009,7 @@
72                 status = mapping->a_ops->prepare_write(file, page, offset, offset+bytes);
73                 if (status)
74                         goto unlock;
75 -               page_fault = __copy_from_user(kaddr+offset, buf, bytes);
76 +               page_fault = actor(kaddr+offset, buf, bytes);
77                 flush_dcache_page(page);
78                 status = mapping->a_ops->commit_write(file, page, offset, offset+bytes);
79                 if (page_fault)
80 @@ -3072,6 +3075,23 @@
81         goto out_status;
82  }
83  
84 +
85 +static inline int actor_from_user(char *dst, char *src, size_t len)
86 +{
87 +       if (!access_ok(VERIFY_READ, src, len))
88 +               return -EFAULT;
89 +               
90 +       return __copy_from_user(dst, src, len);
91 +}
92 +
93 +ssize_t
94 +generic_file_write(struct file *file,const char *buf,size_t count,loff_t *ppos)
95 +{
96 +       return do_generic_file_write(file, buf, count, ppos, &actor_from_user);
97 +}
98 +
99 +
100 +
101  void __init page_cache_init(unsigned long mempages)
102  {
103         unsigned long htable_size, order;
104 --- /usr/src/linux-2.4.16/include/linux/fs.h.obd-orig   Tue Dec 11 14:23:29 2001
105 +++ /usr/src/linux-2.4.16/include/linux/fs.h    Tue Dec 11 20:45:00 2001
106 @@ -978,8 +978,10 @@
107  extern int register_filesystem(struct file_system_type *);
108  extern int unregister_filesystem(struct file_system_type *);
109  extern struct vfsmount *kern_mount(struct file_system_type *);
110 +struct vfsmount *do_kern_mount(char *type, int flags, char *name, void *data);
111  extern int may_umount(struct vfsmount *);
112  extern long do_mount(char *, char *, char *, unsigned long, void *);
113 +int do_umount(struct vfsmount *mnt, int flags);
114  
115  #define kern_umount mntput
116  
117 @@ -1044,6 +1046,35 @@
118  
119  asmlinkage long sys_open(const char *, int, int);
120  asmlinkage long sys_close(unsigned int);       /* yes, it's really unsigned */
121 +asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count);
122 +asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count);
123 +asmlinkage long sys_truncate64(const char * path, loff_t length);
124 +asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
125 +asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type,
126 +                         unsigned long flags, void * data);
127 +asmlinkage long sys_umount(char * name, int flags);
128 +asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf);
129 +asmlinkage long sys_mknod(const char * filename, int mode, dev_t dev);
130 +asmlinkage long sys_mkdir(const char * pathname, int mode);
131 +asmlinkage long sys_rmdir(const char * pathname);
132 +asmlinkage long sys_unlink(const char * pathname);
133 +asmlinkage long sys_symlink(const char * oldname, const char * newname);
134 +asmlinkage long sys_link(const char * oldname, const char * newname);
135 +asmlinkage long sys_rename(const char * oldname, const char * newname);
136 +asmlinkage long sys_lstat64(char * filename, struct stat64 * statbuf, long flags);
137 +asmlinkage long sys_stat64(char * filename, struct stat64 * statbuf, long flags);
138 +asmlinkage long sys_fstat64(unsigned long fd, struct stat64 * statbuf, long flags);
139 +
140 +
141 +
142 +
143 +
144 +
145 +
146 +
147 +
148 +
149 +
150  extern int do_truncate(struct dentry *, loff_t start);
151  
152  extern struct file *filp_open(const char *, int, int);
153 @@ -1395,6 +1426,8 @@
154  extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
155  extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *);
156  extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t);
157 +ssize_t do_generic_file_write(struct file *file,const char *buf,size_t count,loff_t *ppos, int (*actor)(char *, char *, size_t ));
158 +
159  extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
160  extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
161  extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *);