diff options
author | Ankit Jain <me@ankitjain.org> | 2009-06-19 14:28:07 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 08:15:27 -0400 |
commit | 3e63cbb1efca7dd3137de1bb475e2e068e38ef23 (patch) | |
tree | 5a7964068266e778e94c1348192d3c85eba4ac48 /include/linux | |
parent | 01c031945f2755c7afaaf456088543312f2b72ea (diff) |
fs: Add new pre-allocation ioctls to vfs for compatibility with legacy xfs ioctls
This patch adds ioctls to vfs for compatibility with legacy XFS
pre-allocation ioctls (XFS_IOC_*RESVP*). The implementation
effectively invokes sys_fallocate for the new ioctls.
Also handles the compat_ioctl case.
Note: These legacy ioctls are also implemented by OCFS2.
[AV: folded fixes from hch]
Signed-off-by: Ankit Jain <me@ankitjain.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/falloc.h | 21 | ||||
-rw-r--r-- | include/linux/fs.h | 6 |
2 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/falloc.h b/include/linux/falloc.h index 8e912ab6a072..3c155107d61f 100644 --- a/include/linux/falloc.h +++ b/include/linux/falloc.h | |||
@@ -3,4 +3,25 @@ | |||
3 | 3 | ||
4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ | 4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ |
5 | 5 | ||
6 | #ifdef __KERNEL__ | ||
7 | |||
8 | /* | ||
9 | * Space reservation ioctls and argument structure | ||
10 | * are designed to be compatible with the legacy XFS ioctls. | ||
11 | */ | ||
12 | struct space_resv { | ||
13 | __s16 l_type; | ||
14 | __s16 l_whence; | ||
15 | __s64 l_start; | ||
16 | __s64 l_len; /* len == 0 means until end of file */ | ||
17 | __s32 l_sysid; | ||
18 | __u32 l_pid; | ||
19 | __s32 l_pad[4]; /* reserved area */ | ||
20 | }; | ||
21 | |||
22 | #define FS_IOC_RESVSP _IOW('X', 40, struct space_resv) | ||
23 | #define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv) | ||
24 | |||
25 | #endif /* __KERNEL__ */ | ||
26 | |||
6 | #endif /* _FALLOC_H_ */ | 27 | #endif /* _FALLOC_H_ */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1ff5e4e01952..79e302ddde0f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1906,6 +1906,8 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1906 | 1906 | ||
1907 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | 1907 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, |
1908 | struct file *filp); | 1908 | struct file *filp); |
1909 | extern int do_fallocate(struct file *file, int mode, loff_t offset, | ||
1910 | loff_t len); | ||
1909 | extern long do_sys_open(int dfd, const char __user *filename, int flags, | 1911 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
1910 | int mode); | 1912 | int mode); |
1911 | extern struct file *filp_open(const char *, int, int); | 1913 | extern struct file *filp_open(const char *, int, int); |
@@ -1914,6 +1916,10 @@ extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | |||
1914 | extern int filp_close(struct file *, fl_owner_t id); | 1916 | extern int filp_close(struct file *, fl_owner_t id); |
1915 | extern char * getname(const char __user *); | 1917 | extern char * getname(const char __user *); |
1916 | 1918 | ||
1919 | /* fs/ioctl.c */ | ||
1920 | |||
1921 | extern int ioctl_preallocate(struct file *filp, void __user *argp); | ||
1922 | |||
1917 | /* fs/dcache.c */ | 1923 | /* fs/dcache.c */ |
1918 | extern void __init vfs_caches_init_early(void); | 1924 | extern void __init vfs_caches_init_early(void); |
1919 | extern void __init vfs_caches_init(unsigned long); | 1925 | extern void __init vfs_caches_init(unsigned long); |