aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat_ioctl.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-08-31 06:50:04 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-09-30 14:52:30 -0400
commit188f83dfe0eeecd1427d0d255cc97dbf7ef6b4b7 (patch)
tree72a36a42e6b1f4693b4c39dc70d25241418dc228 /fs/compat_ioctl.c
parent52a700c5675f399c07e6e57328291e57f13ef3bb (diff)
[PATCH] BLOCK: Move the msdos device ioctl compat stuff to the msdos driver [try #6]
Move the msdos device ioctl compat stuff from fs/compat_ioctl.c to the msdos driver so that the msdos header file doesn't need to be included. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r--fs/compat_ioctl.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index e5eb0f10f05a..e1a56437040a 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -108,7 +108,6 @@
108#include <linux/nbd.h> 108#include <linux/nbd.h>
109#include <linux/random.h> 109#include <linux/random.h>
110#include <linux/filter.h> 110#include <linux/filter.h>
111#include <linux/msdos_fs.h>
112#include <linux/pktcdvd.h> 111#include <linux/pktcdvd.h>
113 112
114#include <linux/hiddev.h> 113#include <linux/hiddev.h>
@@ -1937,51 +1936,6 @@ static int mtd_rw_oob(unsigned int fd, unsigned int cmd, unsigned long arg)
1937 return err; 1936 return err;
1938} 1937}
1939 1938
1940#define VFAT_IOCTL_READDIR_BOTH32 _IOR('r', 1, struct compat_dirent[2])
1941#define VFAT_IOCTL_READDIR_SHORT32 _IOR('r', 2, struct compat_dirent[2])
1942
1943static long
1944put_dirent32 (struct dirent *d, struct compat_dirent __user *d32)
1945{
1946 if (!access_ok(VERIFY_WRITE, d32, sizeof(struct compat_dirent)))
1947 return -EFAULT;
1948
1949 __put_user(d->d_ino, &d32->d_ino);
1950 __put_user(d->d_off, &d32->d_off);
1951 __put_user(d->d_reclen, &d32->d_reclen);
1952 if (__copy_to_user(d32->d_name, d->d_name, d->d_reclen))
1953 return -EFAULT;
1954
1955 return 0;
1956}
1957
1958static int vfat_ioctl32(unsigned fd, unsigned cmd, unsigned long arg)
1959{
1960 struct compat_dirent __user *p = compat_ptr(arg);
1961 int ret;
1962 mm_segment_t oldfs = get_fs();
1963 struct dirent d[2];
1964
1965 switch(cmd)
1966 {
1967 case VFAT_IOCTL_READDIR_BOTH32:
1968 cmd = VFAT_IOCTL_READDIR_BOTH;
1969 break;
1970 case VFAT_IOCTL_READDIR_SHORT32:
1971 cmd = VFAT_IOCTL_READDIR_SHORT;
1972 break;
1973 }
1974
1975 set_fs(KERNEL_DS);
1976 ret = sys_ioctl(fd,cmd,(unsigned long)&d);
1977 set_fs(oldfs);
1978 if (ret >= 0) {
1979 ret |= put_dirent32(&d[0], p);
1980 ret |= put_dirent32(&d[1], p + 1);
1981 }
1982 return ret;
1983}
1984
1985struct raw32_config_request 1939struct raw32_config_request
1986{ 1940{
1987 compat_int_t raw_minor; 1941 compat_int_t raw_minor;
@@ -2726,9 +2680,6 @@ HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl)
2726HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget) 2680HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget)
2727HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset) 2681HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset)
2728HANDLE_IOCTL(BLKGETSIZE64_32, do_blkgetsize64) 2682HANDLE_IOCTL(BLKGETSIZE64_32, do_blkgetsize64)
2729/* vfat */
2730HANDLE_IOCTL(VFAT_IOCTL_READDIR_BOTH32, vfat_ioctl32)
2731HANDLE_IOCTL(VFAT_IOCTL_READDIR_SHORT32, vfat_ioctl32)
2732/* Raw devices */ 2683/* Raw devices */
2733HANDLE_IOCTL(RAW_SETBIND, raw_ioctl) 2684HANDLE_IOCTL(RAW_SETBIND, raw_ioctl)
2734HANDLE_IOCTL(RAW_GETBIND, raw_ioctl) 2685HANDLE_IOCTL(RAW_GETBIND, raw_ioctl)