~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/alpha/kernel/osf_sys.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        return copy_to_user(osf_stat, &tmp_stat, bufsiz) ? -EFAULT : 0;
231
231
}
232
232
 
233
 
static int
234
 
do_osf_statfs(struct path *path, struct osf_statfs __user *buffer,
235
 
              unsigned long bufsiz)
 
233
SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
 
234
                struct osf_statfs __user *, buffer, unsigned long, bufsiz)
236
235
{
237
236
        struct kstatfs linux_stat;
238
 
        int error = vfs_statfs(path, &linux_stat);
 
237
        int error = user_statfs(pathname, &linux_stat);
239
238
        if (!error)
240
239
                error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
241
240
        return error;   
242
241
}
243
242
 
244
 
SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
245
 
                struct osf_statfs __user *, buffer, unsigned long, bufsiz)
246
 
{
247
 
        struct path path;
248
 
        int retval;
249
 
 
250
 
        retval = user_path(pathname, &path);
251
 
        if (!retval) {
252
 
                retval = do_osf_statfs(&path, buffer, bufsiz);
253
 
                path_put(&path);
254
 
        }
255
 
        return retval;
256
 
}
257
 
 
258
243
SYSCALL_DEFINE3(osf_fstatfs, unsigned long, fd,
259
244
                struct osf_statfs __user *, buffer, unsigned long, bufsiz)
260
245
{
261
 
        struct file *file;
262
 
        int retval;
263
 
 
264
 
        retval = -EBADF;
265
 
        file = fget(fd);
266
 
        if (file) {
267
 
                retval = do_osf_statfs(&file->f_path, buffer, bufsiz);
268
 
                fput(file);
269
 
        }
270
 
        return retval;
 
246
        struct kstatfs linux_stat;
 
247
        int error = fd_statfs(fd, &linux_stat);
 
248
        if (!error)
 
249
                error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
 
250
        return error;
271
251
}
272
252
 
273
253
/*
429
409
                return -EFAULT;
430
410
 
431
411
        len = namelen;
432
 
        if (namelen > 32)
 
412
        if (len > 32)
433
413
                len = 32;
434
414
 
435
415
        down_read(&uts_sem);
614
594
        down_read(&uts_sem);
615
595
        res = sysinfo_table[offset];
616
596
        len = strlen(res)+1;
617
 
        if (len > count)
 
597
        if ((unsigned long)len > (unsigned long)count)
618
598
                len = count;
619
599
        if (copy_to_user(buf, res, len))
620
600
                err = -EFAULT;
669
649
                return 1;
670
650
 
671
651
        case GSI_GET_HWRPB:
672
 
                if (nbytes < sizeof(*hwrpb))
 
652
                if (nbytes > sizeof(*hwrpb))
673
653
                        return -EINVAL;
674
654
                if (copy_to_user(buffer, hwrpb, nbytes) != 0)
675
655
                        return -EFAULT;
1028
1008
{
1029
1009
        struct rusage r;
1030
1010
        long ret, err;
 
1011
        unsigned int status = 0;
1031
1012
        mm_segment_t old_fs;
1032
1013
 
1033
1014
        if (!ur)
1036
1017
        old_fs = get_fs();
1037
1018
                
1038
1019
        set_fs (KERNEL_DS);
1039
 
        ret = sys_wait4(pid, ustatus, options, (struct rusage __user *) &r);
 
1020
        ret = sys_wait4(pid, (unsigned int __user *) &status, options,
 
1021
                        (struct rusage __user *) &r);
1040
1022
        set_fs (old_fs);
1041
1023
 
1042
1024
        if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur)))
1043
1025
                return -EFAULT;
1044
1026
 
1045
1027
        err = 0;
 
1028
        err |= put_user(status, ustatus);
1046
1029
        err |= __put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec);
1047
1030
        err |= __put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec);
1048
1031
        err |= __put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec);