aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/bad_inode.c7
-rw-r--r--fs/compat.c23
-rw-r--r--fs/compat_ioctl.c3
-rw-r--r--fs/dcache.c2
-rw-r--r--fs/ioctl.c18
-rw-r--r--fs/jbd2/transaction.c46
-rw-r--r--fs/logfs/dir.c2
-rw-r--r--fs/logfs/file.c6
-rw-r--r--fs/logfs/logfs.h3
-rw-r--r--fs/proc/inode.c17
-rw-r--r--fs/proc/task_mmu.c8
-rw-r--r--fs/stat.c29
-rw-r--r--fs/utimes.c7
13 files changed, 84 insertions, 87 deletions
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 52e59bf4aa5f..f024d8aaddef 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -55,12 +55,6 @@ static unsigned int bad_file_poll(struct file *filp, poll_table *wait)
55 return POLLERR; 55 return POLLERR;
56} 56}
57 57
58static int bad_file_ioctl (struct inode *inode, struct file *filp,
59 unsigned int cmd, unsigned long arg)
60{
61 return -EIO;
62}
63
64static long bad_file_unlocked_ioctl(struct file *file, unsigned cmd, 58static long bad_file_unlocked_ioctl(struct file *file, unsigned cmd,
65 unsigned long arg) 59 unsigned long arg)
66{ 60{
@@ -159,7 +153,6 @@ static const struct file_operations bad_file_ops =
159 .aio_write = bad_file_aio_write, 153 .aio_write = bad_file_aio_write,
160 .readdir = bad_file_readdir, 154 .readdir = bad_file_readdir,
161 .poll = bad_file_poll, 155 .poll = bad_file_poll,
162 .ioctl = bad_file_ioctl,
163 .unlocked_ioctl = bad_file_unlocked_ioctl, 156 .unlocked_ioctl = bad_file_unlocked_ioctl,
164 .compat_ioctl = bad_file_compat_ioctl, 157 .compat_ioctl = bad_file_compat_ioctl,
165 .mmap = bad_file_mmap, 158 .mmap = bad_file_mmap,
diff --git a/fs/compat.c b/fs/compat.c
index e6d5d70cf3cf..718c7062aec1 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -77,7 +77,8 @@ int compat_printk(const char *fmt, ...)
77 * Not all architectures have sys_utime, so implement this in terms 77 * Not all architectures have sys_utime, so implement this in terms
78 * of sys_utimes. 78 * of sys_utimes.
79 */ 79 */
80asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __user *t) 80asmlinkage long compat_sys_utime(const char __user *filename,
81 struct compat_utimbuf __user *t)
81{ 82{
82 struct timespec tv[2]; 83 struct timespec tv[2];
83 84
@@ -91,7 +92,7 @@ asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __
91 return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0); 92 return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0);
92} 93}
93 94
94asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, struct compat_timespec __user *t, int flags) 95asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename, struct compat_timespec __user *t, int flags)
95{ 96{
96 struct timespec tv[2]; 97 struct timespec tv[2];
97 98
@@ -106,7 +107,7 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, st
106 return do_utimes(dfd, filename, t ? tv : NULL, flags); 107 return do_utimes(dfd, filename, t ? tv : NULL, flags);
107} 108}
108 109
109asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, struct compat_timeval __user *t) 110asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename, struct compat_timeval __user *t)
110{ 111{
111 struct timespec tv[2]; 112 struct timespec tv[2];
112 113
@@ -125,7 +126,7 @@ asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, st
125 return do_utimes(dfd, filename, t ? tv : NULL, 0); 126 return do_utimes(dfd, filename, t ? tv : NULL, 0);
126} 127}
127 128
128asmlinkage long compat_sys_utimes(char __user *filename, struct compat_timeval __user *t) 129asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_timeval __user *t)
129{ 130{
130 return compat_sys_futimesat(AT_FDCWD, filename, t); 131 return compat_sys_futimesat(AT_FDCWD, filename, t);
131} 132}
@@ -169,7 +170,7 @@ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
169 return err; 170 return err;
170} 171}
171 172
172asmlinkage long compat_sys_newstat(char __user * filename, 173asmlinkage long compat_sys_newstat(const char __user * filename,
173 struct compat_stat __user *statbuf) 174 struct compat_stat __user *statbuf)
174{ 175{
175 struct kstat stat; 176 struct kstat stat;
@@ -181,7 +182,7 @@ asmlinkage long compat_sys_newstat(char __user * filename,
181 return cp_compat_stat(&stat, statbuf); 182 return cp_compat_stat(&stat, statbuf);
182} 183}
183 184
184asmlinkage long compat_sys_newlstat(char __user * filename, 185asmlinkage long compat_sys_newlstat(const char __user * filename,
185 struct compat_stat __user *statbuf) 186 struct compat_stat __user *statbuf)
186{ 187{
187 struct kstat stat; 188 struct kstat stat;
@@ -194,7 +195,8 @@ asmlinkage long compat_sys_newlstat(char __user * filename,
194} 195}
195 196
196#ifndef __ARCH_WANT_STAT64 197#ifndef __ARCH_WANT_STAT64
197asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename, 198asmlinkage long compat_sys_newfstatat(unsigned int dfd,
199 const char __user *filename,
198 struct compat_stat __user *statbuf, int flag) 200 struct compat_stat __user *statbuf, int flag)
199{ 201{
200 struct kstat stat; 202 struct kstat stat;
@@ -837,9 +839,10 @@ static int do_nfs4_super_data_conv(void *raw_data)
837#define NCPFS_NAME "ncpfs" 839#define NCPFS_NAME "ncpfs"
838#define NFS4_NAME "nfs4" 840#define NFS4_NAME "nfs4"
839 841
840asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name, 842asmlinkage long compat_sys_mount(const char __user * dev_name,
841 char __user * type, unsigned long flags, 843 const char __user * dir_name,
842 void __user * data) 844 const char __user * type, unsigned long flags,
845 const void __user * data)
843{ 846{
844 char *kernel_type; 847 char *kernel_type;
845 unsigned long data_page; 848 unsigned long data_page;
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 70227e0dc01d..03e59aa318eb 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1699,8 +1699,7 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
1699 goto out_fput; 1699 goto out_fput;
1700 } 1700 }
1701 1701
1702 if (!filp->f_op || 1702 if (!filp->f_op || !filp->f_op->unlocked_ioctl)
1703 (!filp->f_op->ioctl && !filp->f_op->unlocked_ioctl))
1704 goto do_ioctl; 1703 goto do_ioctl;
1705 break; 1704 break;
1706 } 1705 }
diff --git a/fs/dcache.c b/fs/dcache.c
index 166d35d56868..4d13bf50b7b1 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1976,7 +1976,7 @@ global_root:
1976 * __d_path - return the path of a dentry 1976 * __d_path - return the path of a dentry
1977 * @path: the dentry/vfsmount to report 1977 * @path: the dentry/vfsmount to report
1978 * @root: root vfsmnt/dentry (may be modified by this function) 1978 * @root: root vfsmnt/dentry (may be modified by this function)
1979 * @buffer: buffer to return value in 1979 * @buf: buffer to return value in
1980 * @buflen: buffer length 1980 * @buflen: buffer length
1981 * 1981 *
1982 * Convert a dentry into an ASCII path name. 1982 * Convert a dentry into an ASCII path name.
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 2d140a713861..f855ea4fc888 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -29,7 +29,6 @@
29 * @arg: command-specific argument for ioctl 29 * @arg: command-specific argument for ioctl
30 * 30 *
31 * Invokes filesystem specific ->unlocked_ioctl, if one exists; otherwise 31 * Invokes filesystem specific ->unlocked_ioctl, if one exists; otherwise
32 * invokes filesystem specific ->ioctl method. If neither method exists,
33 * returns -ENOTTY. 32 * returns -ENOTTY.
34 * 33 *
35 * Returns 0 on success, -errno on error. 34 * Returns 0 on success, -errno on error.
@@ -39,21 +38,12 @@ static long vfs_ioctl(struct file *filp, unsigned int cmd,
39{ 38{
40 int error = -ENOTTY; 39 int error = -ENOTTY;
41 40
42 if (!filp->f_op) 41 if (!filp->f_op || !filp->f_op->unlocked_ioctl)
43 goto out; 42 goto out;
44 43
45 if (filp->f_op->unlocked_ioctl) { 44 error = filp->f_op->unlocked_ioctl(filp, cmd, arg);
46 error = filp->f_op->unlocked_ioctl(filp, cmd, arg); 45 if (error == -ENOIOCTLCMD)
47 if (error == -ENOIOCTLCMD) 46 error = -EINVAL;
48 error = -EINVAL;
49 goto out;
50 } else if (filp->f_op->ioctl) {
51 lock_kernel();
52 error = filp->f_op->ioctl(filp->f_path.dentry->d_inode,
53 filp, cmd, arg);
54 unlock_kernel();
55 }
56
57 out: 47 out:
58 return error; 48 return error;
59} 49}
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index d95cc9d0401d..f3479d6e0a83 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -82,6 +82,32 @@ jbd2_get_transaction(journal_t *journal, transaction_t *transaction)
82 */ 82 */
83 83
84/* 84/*
85 * Update transiaction's maximum wait time, if debugging is enabled.
86 *
87 * In order for t_max_wait to be reliable, it must be protected by a
88 * lock. But doing so will mean that start_this_handle() can not be
89 * run in parallel on SMP systems, which limits our scalability. So
90 * unless debugging is enabled, we no longer update t_max_wait, which
91 * means that maximum wait time reported by the jbd2_run_stats
92 * tracepoint will always be zero.
93 */
94static inline void update_t_max_wait(transaction_t *transaction)
95{
96#ifdef CONFIG_JBD2_DEBUG
97 unsigned long ts = jiffies;
98
99 if (jbd2_journal_enable_debug &&
100 time_after(transaction->t_start, ts)) {
101 ts = jbd2_time_diff(ts, transaction->t_start);
102 spin_lock(&transaction->t_handle_lock);
103 if (ts > transaction->t_max_wait)
104 transaction->t_max_wait = ts;
105 spin_unlock(&transaction->t_handle_lock);
106 }
107#endif
108}
109
110/*
85 * start_this_handle: Given a handle, deal with any locking or stalling 111 * start_this_handle: Given a handle, deal with any locking or stalling
86 * needed to make sure that there is enough journal space for the handle 112 * needed to make sure that there is enough journal space for the handle
87 * to begin. Attach the handle to a transaction and set up the 113 * to begin. Attach the handle to a transaction and set up the
@@ -95,7 +121,6 @@ static int start_this_handle(journal_t *journal, handle_t *handle,
95 int needed; 121 int needed;
96 int nblocks = handle->h_buffer_credits; 122 int nblocks = handle->h_buffer_credits;
97 transaction_t *new_transaction = NULL; 123 transaction_t *new_transaction = NULL;
98 unsigned long ts = jiffies;
99 124
100 if (nblocks > journal->j_max_transaction_buffers) { 125 if (nblocks > journal->j_max_transaction_buffers) {
101 printk(KERN_ERR "JBD: %s wants too many credits (%d > %d)\n", 126 printk(KERN_ERR "JBD: %s wants too many credits (%d > %d)\n",
@@ -241,25 +266,8 @@ repeat:
241 266
242 /* OK, account for the buffers that this operation expects to 267 /* OK, account for the buffers that this operation expects to
243 * use and add the handle to the running transaction. 268 * use and add the handle to the running transaction.
244 *
245 * In order for t_max_wait to be reliable, it must be
246 * protected by a lock. But doing so will mean that
247 * start_this_handle() can not be run in parallel on SMP
248 * systems, which limits our scalability. So we only enable
249 * it when debugging is enabled. We may want to use a
250 * separate flag, eventually, so we can enable this
251 * independently of debugging.
252 */ 269 */
253#ifdef CONFIG_JBD2_DEBUG 270 update_t_max_wait(transaction);
254 if (jbd2_journal_enable_debug &&
255 time_after(transaction->t_start, ts)) {
256 ts = jbd2_time_diff(ts, transaction->t_start);
257 spin_lock(&transaction->t_handle_lock);
258 if (ts > transaction->t_max_wait)
259 transaction->t_max_wait = ts;
260 spin_unlock(&transaction->t_handle_lock);
261 }
262#endif
263 handle->h_transaction = transaction; 271 handle->h_transaction = transaction;
264 atomic_inc(&transaction->t_updates); 272 atomic_inc(&transaction->t_updates);
265 atomic_inc(&transaction->t_handle_count); 273 atomic_inc(&transaction->t_handle_count);
diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c
index 675cc49197fe..9777eb5b5522 100644
--- a/fs/logfs/dir.c
+++ b/fs/logfs/dir.c
@@ -824,7 +824,7 @@ const struct inode_operations logfs_dir_iops = {
824}; 824};
825const struct file_operations logfs_dir_fops = { 825const struct file_operations logfs_dir_fops = {
826 .fsync = logfs_fsync, 826 .fsync = logfs_fsync,
827 .ioctl = logfs_ioctl, 827 .unlocked_ioctl = logfs_ioctl,
828 .readdir = logfs_readdir, 828 .readdir = logfs_readdir,
829 .read = generic_read_dir, 829 .read = generic_read_dir,
830}; 830};
diff --git a/fs/logfs/file.c b/fs/logfs/file.c
index 4dd0f7c06e39..e86376b87af1 100644
--- a/fs/logfs/file.c
+++ b/fs/logfs/file.c
@@ -181,9 +181,9 @@ static int logfs_releasepage(struct page *page, gfp_t only_xfs_uses_this)
181} 181}
182 182
183 183
184int logfs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 184long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
185 unsigned long arg)
186{ 185{
186 struct inode *inode = file->f_path.dentry->d_inode;
187 struct logfs_inode *li = logfs_inode(inode); 187 struct logfs_inode *li = logfs_inode(inode);
188 unsigned int oldflags, flags; 188 unsigned int oldflags, flags;
189 int err; 189 int err;
@@ -255,7 +255,7 @@ const struct file_operations logfs_reg_fops = {
255 .aio_read = generic_file_aio_read, 255 .aio_read = generic_file_aio_read,
256 .aio_write = generic_file_aio_write, 256 .aio_write = generic_file_aio_write,
257 .fsync = logfs_fsync, 257 .fsync = logfs_fsync,
258 .ioctl = logfs_ioctl, 258 .unlocked_ioctl = logfs_ioctl,
259 .llseek = generic_file_llseek, 259 .llseek = generic_file_llseek,
260 .mmap = generic_file_readonly_mmap, 260 .mmap = generic_file_readonly_mmap,
261 .open = generic_file_open, 261 .open = generic_file_open,
diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h
index 5e3b72077951..b8786264d243 100644
--- a/fs/logfs/logfs.h
+++ b/fs/logfs/logfs.h
@@ -504,8 +504,7 @@ extern const struct inode_operations logfs_reg_iops;
504extern const struct file_operations logfs_reg_fops; 504extern const struct file_operations logfs_reg_fops;
505extern const struct address_space_operations logfs_reg_aops; 505extern const struct address_space_operations logfs_reg_aops;
506int logfs_readpage(struct file *file, struct page *page); 506int logfs_readpage(struct file *file, struct page *page);
507int logfs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 507long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
508 unsigned long arg);
509int logfs_fsync(struct file *file, int datasync); 508int logfs_fsync(struct file *file, int datasync);
510 509
511/* gc.c */ 510/* gc.c */
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 23561cda7245..9c2b5f484879 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -214,8 +214,7 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne
214{ 214{
215 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 215 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
216 long rv = -ENOTTY; 216 long rv = -ENOTTY;
217 long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); 217 long (*ioctl)(struct file *, unsigned int, unsigned long);
218 int (*ioctl)(struct inode *, struct file *, unsigned int, unsigned long);
219 218
220 spin_lock(&pde->pde_unload_lock); 219 spin_lock(&pde->pde_unload_lock);
221 if (!pde->proc_fops) { 220 if (!pde->proc_fops) {
@@ -223,19 +222,11 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne
223 return rv; 222 return rv;
224 } 223 }
225 pde->pde_users++; 224 pde->pde_users++;
226 unlocked_ioctl = pde->proc_fops->unlocked_ioctl; 225 ioctl = pde->proc_fops->unlocked_ioctl;
227 ioctl = pde->proc_fops->ioctl;
228 spin_unlock(&pde->pde_unload_lock); 226 spin_unlock(&pde->pde_unload_lock);
229 227
230 if (unlocked_ioctl) { 228 if (ioctl)
231 rv = unlocked_ioctl(file, cmd, arg); 229 rv = ioctl(file, cmd, arg);
232 if (rv == -ENOIOCTLCMD)
233 rv = -EINVAL;
234 } else if (ioctl) {
235 WARN_ONCE(1, "Procfs ioctl handlers must use unlocked_ioctl, "
236 "%pf will be called without the Bkl held\n", ioctl);
237 rv = ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
238 }
239 230
240 pde_users_dec(pde); 231 pde_users_dec(pde);
241 return rv; 232 return rv;
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index aea1d3f1ffb5..439fc1f1c1c4 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -210,6 +210,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
210 int flags = vma->vm_flags; 210 int flags = vma->vm_flags;
211 unsigned long ino = 0; 211 unsigned long ino = 0;
212 unsigned long long pgoff = 0; 212 unsigned long long pgoff = 0;
213 unsigned long start;
213 dev_t dev = 0; 214 dev_t dev = 0;
214 int len; 215 int len;
215 216
@@ -220,8 +221,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
220 pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; 221 pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
221 } 222 }
222 223
224 /* We don't show the stack guard page in /proc/maps */
225 start = vma->vm_start;
226 if (vma->vm_flags & VM_GROWSDOWN)
227 start += PAGE_SIZE;
228
223 seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n", 229 seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
224 vma->vm_start, 230 start,
225 vma->vm_end, 231 vma->vm_end,
226 flags & VM_READ ? 'r' : '-', 232 flags & VM_READ ? 'r' : '-',
227 flags & VM_WRITE ? 'w' : '-', 233 flags & VM_WRITE ? 'w' : '-',
diff --git a/fs/stat.c b/fs/stat.c
index c4ecd52c5737..12e90e213900 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -68,7 +68,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
68} 68}
69EXPORT_SYMBOL(vfs_fstat); 69EXPORT_SYMBOL(vfs_fstat);
70 70
71int vfs_fstatat(int dfd, char __user *filename, struct kstat *stat, int flag) 71int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,
72 int flag)
72{ 73{
73 struct path path; 74 struct path path;
74 int error = -EINVAL; 75 int error = -EINVAL;
@@ -91,13 +92,13 @@ out:
91} 92}
92EXPORT_SYMBOL(vfs_fstatat); 93EXPORT_SYMBOL(vfs_fstatat);
93 94
94int vfs_stat(char __user *name, struct kstat *stat) 95int vfs_stat(const char __user *name, struct kstat *stat)
95{ 96{
96 return vfs_fstatat(AT_FDCWD, name, stat, 0); 97 return vfs_fstatat(AT_FDCWD, name, stat, 0);
97} 98}
98EXPORT_SYMBOL(vfs_stat); 99EXPORT_SYMBOL(vfs_stat);
99 100
100int vfs_lstat(char __user *name, struct kstat *stat) 101int vfs_lstat(const char __user *name, struct kstat *stat)
101{ 102{
102 return vfs_fstatat(AT_FDCWD, name, stat, AT_SYMLINK_NOFOLLOW); 103 return vfs_fstatat(AT_FDCWD, name, stat, AT_SYMLINK_NOFOLLOW);
103} 104}
@@ -147,7 +148,8 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
147 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 148 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
148} 149}
149 150
150SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) 151SYSCALL_DEFINE2(stat, const char __user *, filename,
152 struct __old_kernel_stat __user *, statbuf)
151{ 153{
152 struct kstat stat; 154 struct kstat stat;
153 int error; 155 int error;
@@ -159,7 +161,8 @@ SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *
159 return cp_old_stat(&stat, statbuf); 161 return cp_old_stat(&stat, statbuf);
160} 162}
161 163
162SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) 164SYSCALL_DEFINE2(lstat, const char __user *, filename,
165 struct __old_kernel_stat __user *, statbuf)
163{ 166{
164 struct kstat stat; 167 struct kstat stat;
165 int error; 168 int error;
@@ -234,7 +237,8 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
234 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 237 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
235} 238}
236 239
237SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) 240SYSCALL_DEFINE2(newstat, const char __user *, filename,
241 struct stat __user *, statbuf)
238{ 242{
239 struct kstat stat; 243 struct kstat stat;
240 int error = vfs_stat(filename, &stat); 244 int error = vfs_stat(filename, &stat);
@@ -244,7 +248,8 @@ SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf)
244 return cp_new_stat(&stat, statbuf); 248 return cp_new_stat(&stat, statbuf);
245} 249}
246 250
247SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf) 251SYSCALL_DEFINE2(newlstat, const char __user *, filename,
252 struct stat __user *, statbuf)
248{ 253{
249 struct kstat stat; 254 struct kstat stat;
250 int error; 255 int error;
@@ -257,7 +262,7 @@ SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf
257} 262}
258 263
259#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) 264#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
260SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, 265SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename,
261 struct stat __user *, statbuf, int, flag) 266 struct stat __user *, statbuf, int, flag)
262{ 267{
263 struct kstat stat; 268 struct kstat stat;
@@ -355,7 +360,8 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
355 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 360 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
356} 361}
357 362
358SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf) 363SYSCALL_DEFINE2(stat64, const char __user *, filename,
364 struct stat64 __user *, statbuf)
359{ 365{
360 struct kstat stat; 366 struct kstat stat;
361 int error = vfs_stat(filename, &stat); 367 int error = vfs_stat(filename, &stat);
@@ -366,7 +372,8 @@ SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf
366 return error; 372 return error;
367} 373}
368 374
369SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf) 375SYSCALL_DEFINE2(lstat64, const char __user *, filename,
376 struct stat64 __user *, statbuf)
370{ 377{
371 struct kstat stat; 378 struct kstat stat;
372 int error = vfs_lstat(filename, &stat); 379 int error = vfs_lstat(filename, &stat);
@@ -388,7 +395,7 @@ SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf)
388 return error; 395 return error;
389} 396}
390 397
391SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, 398SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
392 struct stat64 __user *, statbuf, int, flag) 399 struct stat64 __user *, statbuf, int, flag)
393{ 400{
394 struct kstat stat; 401 struct kstat stat;
diff --git a/fs/utimes.c b/fs/utimes.c
index e4c75db5d373..179b58690657 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -126,7 +126,8 @@ out:
126 * must be owner or have write permission. 126 * must be owner or have write permission.
127 * Else, update from *times, must be owner or super user. 127 * Else, update from *times, must be owner or super user.
128 */ 128 */
129long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags) 129long do_utimes(int dfd, const char __user *filename, struct timespec *times,
130 int flags)
130{ 131{
131 int error = -EINVAL; 132 int error = -EINVAL;
132 133
@@ -170,7 +171,7 @@ out:
170 return error; 171 return error;
171} 172}
172 173
173SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, 174SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename,
174 struct timespec __user *, utimes, int, flags) 175 struct timespec __user *, utimes, int, flags)
175{ 176{
176 struct timespec tstimes[2]; 177 struct timespec tstimes[2];
@@ -188,7 +189,7 @@ SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename,
188 return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); 189 return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags);
189} 190}
190 191
191SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, 192SYSCALL_DEFINE3(futimesat, int, dfd, const char __user *, filename,
192 struct timeval __user *, utimes) 193 struct timeval __user *, utimes)
193{ 194{
194 struct timeval times[2]; 195 struct timeval times[2];