aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/compat.c')
-rw-r--r--fs/compat.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/fs/compat.c b/fs/compat.c
index b1f64786a613..e31e9cf96647 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -55,6 +55,20 @@
55 55
56extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); 56extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
57 57
58int compat_log = 1;
59
60int compat_printk(const char *fmt, ...)
61{
62 va_list ap;
63 int ret;
64 if (!compat_log)
65 return 0;
66 va_start(ap, fmt);
67 ret = vprintk(fmt, ap);
68 va_end(ap);
69 return ret;
70}
71
58/* 72/*
59 * Not all architectures have sys_utime, so implement this in terms 73 * Not all architectures have sys_utime, so implement this in terms
60 * of sys_utimes. 74 * of sys_utimes.
@@ -197,7 +211,7 @@ asmlinkage long compat_sys_statfs(const char __user *path, struct compat_statfs
197 error = user_path_walk(path, &nd); 211 error = user_path_walk(path, &nd);
198 if (!error) { 212 if (!error) {
199 struct kstatfs tmp; 213 struct kstatfs tmp;
200 error = vfs_statfs(nd.dentry->d_inode->i_sb, &tmp); 214 error = vfs_statfs(nd.dentry, &tmp);
201 if (!error) 215 if (!error)
202 error = put_compat_statfs(buf, &tmp); 216 error = put_compat_statfs(buf, &tmp);
203 path_release(&nd); 217 path_release(&nd);
@@ -215,7 +229,7 @@ asmlinkage long compat_sys_fstatfs(unsigned int fd, struct compat_statfs __user
215 file = fget(fd); 229 file = fget(fd);
216 if (!file) 230 if (!file)
217 goto out; 231 goto out;
218 error = vfs_statfs(file->f_dentry->d_inode->i_sb, &tmp); 232 error = vfs_statfs(file->f_dentry, &tmp);
219 if (!error) 233 if (!error)
220 error = put_compat_statfs(buf, &tmp); 234 error = put_compat_statfs(buf, &tmp);
221 fput(file); 235 fput(file);
@@ -265,7 +279,7 @@ asmlinkage long compat_sys_statfs64(const char __user *path, compat_size_t sz, s
265 error = user_path_walk(path, &nd); 279 error = user_path_walk(path, &nd);
266 if (!error) { 280 if (!error) {
267 struct kstatfs tmp; 281 struct kstatfs tmp;
268 error = vfs_statfs(nd.dentry->d_inode->i_sb, &tmp); 282 error = vfs_statfs(nd.dentry, &tmp);
269 if (!error) 283 if (!error)
270 error = put_compat_statfs64(buf, &tmp); 284 error = put_compat_statfs64(buf, &tmp);
271 path_release(&nd); 285 path_release(&nd);
@@ -286,7 +300,7 @@ asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct c
286 file = fget(fd); 300 file = fget(fd);
287 if (!file) 301 if (!file)
288 goto out; 302 goto out;
289 error = vfs_statfs(file->f_dentry->d_inode->i_sb, &tmp); 303 error = vfs_statfs(file->f_dentry, &tmp);
290 if (!error) 304 if (!error)
291 error = put_compat_statfs64(buf, &tmp); 305 error = put_compat_statfs64(buf, &tmp);
292 fput(file); 306 fput(file);
@@ -359,7 +373,7 @@ static void compat_ioctl_error(struct file *filp, unsigned int fd,
359 sprintf(buf,"'%c'", (cmd>>24) & 0x3f); 373 sprintf(buf,"'%c'", (cmd>>24) & 0x3f);
360 if (!isprint(buf[1])) 374 if (!isprint(buf[1]))
361 sprintf(buf, "%02x", buf[1]); 375 sprintf(buf, "%02x", buf[1]);
362 printk("ioctl32(%s:%d): Unknown cmd fd(%d) " 376 compat_printk("ioctl32(%s:%d): Unknown cmd fd(%d) "
363 "cmd(%08x){%s} arg(%08x) on %s\n", 377 "cmd(%08x){%s} arg(%08x) on %s\n",
364 current->comm, current->pid, 378 current->comm, current->pid,
365 (int)fd, (unsigned int)cmd, buf, 379 (int)fd, (unsigned int)cmd, buf,