Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198108
b: refs/heads/master
c: 7845bc3
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann authored and OGAWA Hirofumi committed May 16, 2010
1 parent c5d9cdd commit 4dab9fa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1bdb6f9199def1c3538c18089e499f5df5ff1747
refs/heads/master: 7845bc3e132605e3e8a1f37748e29281164b65f5
11 changes: 6 additions & 5 deletions trunk/fs/fat/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,10 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *filp,
return ret;
}

static int fat_dir_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
static long fat_dir_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{
struct inode *inode = filp->f_path.dentry->d_inode;
struct __fat_dirent __user *d1 = (struct __fat_dirent __user *)arg;
int short_only, both;

Expand All @@ -769,7 +770,7 @@ static int fat_dir_ioctl(struct inode *inode, struct file *filp,
both = 1;
break;
default:
return fat_generic_ioctl(inode, filp, cmd, arg);
return fat_generic_ioctl(filp, cmd, arg);
}

if (!access_ok(VERIFY_WRITE, d1, sizeof(struct __fat_dirent[2])))
Expand Down Expand Up @@ -809,7 +810,7 @@ static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd,
both = 1;
break;
default:
return -ENOIOCTLCMD;
return fat_generic_ioctl(filp, cmd, (unsigned long)arg);
}

if (!access_ok(VERIFY_WRITE, d1, sizeof(struct compat_dirent[2])))
Expand All @@ -831,7 +832,7 @@ const struct file_operations fat_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.readdir = fat_readdir,
.ioctl = fat_dir_ioctl,
.unlocked_ioctl = fat_dir_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = fat_compat_dir_ioctl,
#endif
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/fat/fat.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ extern int fat_free_clusters(struct inode *inode, int cluster);
extern int fat_count_free_clusters(struct super_block *sb);

/* fat/file.c */
extern int fat_generic_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern long fat_generic_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg);
extern const struct file_operations fat_file_operations;
extern const struct inode_operations fat_file_inode_operations;
extern int fat_setattr(struct dentry * dentry, struct iattr * attr);
Expand Down
19 changes: 16 additions & 3 deletions trunk/fs/fat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <linux/capability.h>
#include <linux/module.h>
#include <linux/compat.h>
#include <linux/mount.h>
#include <linux/time.h>
#include <linux/buffer_head.h>
Expand Down Expand Up @@ -114,9 +115,9 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
return err;
}

int fat_generic_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
struct inode *inode = filp->f_path.dentry->d_inode;
u32 __user *user_attr = (u32 __user *)arg;

switch (cmd) {
Expand All @@ -129,6 +130,15 @@ int fat_generic_ioctl(struct inode *inode, struct file *filp,
}
}

#ifdef CONFIG_COMPAT
static long fat_generic_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)

{
return fat_generic_ioctl(filp, cmd, (unsigned long)compat_ptr(arg));
}
#endif

static int fat_file_release(struct inode *inode, struct file *filp)
{
if ((filp->f_mode & FMODE_WRITE) &&
Expand Down Expand Up @@ -159,7 +169,10 @@ const struct file_operations fat_file_operations = {
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.release = fat_file_release,
.ioctl = fat_generic_ioctl,
.unlocked_ioctl = fat_generic_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = fat_generic_compat_ioctl,
#endif
.fsync = fat_file_fsync,
.splice_read = generic_file_splice_read,
};
Expand Down

0 comments on commit 4dab9fa

Please sign in to comment.