Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358999
b: refs/heads/master
c: e975082
h: refs/heads/master
i:
  358997: e74bdca
  358995: 031e8ca
  358991: 42ce3b2
v: v3
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Feb 11, 2013
1 parent b2c95f8 commit 6cb0fdd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7250d2d845822466356f7f22a650bf807090d7e
refs/heads/master: e9750824114ff939d9da299e73651add6aa65456
15 changes: 15 additions & 0 deletions trunk/fs/f2fs/f2fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ static inline int update_sits_in_cursum(struct f2fs_summary_block *rs, int i)
return before;
}

/*
* ioctl commands
*/
#define F2FS_IOC_GETFLAGS FS_IOC_GETFLAGS
#define F2FS_IOC_SETFLAGS FS_IOC_SETFLAGS

#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
/*
* ioctl commands in 32 bit emulation
*/
#define F2FS_IOC32_GETFLAGS FS_IOC32_GETFLAGS
#define F2FS_IOC32_SETFLAGS FS_IOC32_SETFLAGS
#endif

/*
* For INODE and NODE manager
*/
Expand Down Expand Up @@ -850,6 +864,7 @@ void f2fs_truncate(struct inode *);
int f2fs_setattr(struct dentry *, struct iattr *);
int truncate_hole(struct inode *, pgoff_t, pgoff_t);
long f2fs_ioctl(struct file *, unsigned int, unsigned long);
long f2fs_compat_ioctl(struct file *, unsigned int, unsigned long);

/*
* inode.c
Expand Down
21 changes: 21 additions & 0 deletions trunk/fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/writeback.h>
#include <linux/falloc.h>
#include <linux/types.h>
#include <linux/compat.h>
#include <linux/uaccess.h>
#include <linux/mount.h>

Expand Down Expand Up @@ -634,6 +635,23 @@ long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
}
}

#ifdef CONFIG_COMPAT
long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case F2FS_IOC32_GETFLAGS:
cmd = F2FS_IOC_GETFLAGS;
break;
case F2FS_IOC32_SETFLAGS:
cmd = F2FS_IOC_SETFLAGS;
break;
default:
return -ENOIOCTLCMD;
}
return f2fs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));
}
#endif

const struct file_operations f2fs_file_operations = {
.llseek = generic_file_llseek,
.read = do_sync_read,
Expand All @@ -645,6 +663,9 @@ const struct file_operations f2fs_file_operations = {
.fsync = f2fs_sync_file,
.fallocate = f2fs_fallocate,
.unlocked_ioctl = f2fs_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = f2fs_compat_ioctl,
#endif
.splice_read = generic_file_splice_read,
.splice_write = generic_file_splice_write,
};

0 comments on commit 6cb0fdd

Please sign in to comment.