diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-11-07 03:59:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:42 -0500 |
commit | cc4e69dee4a080f6eae3f410daec2593f4fa6f00 (patch) | |
tree | b9be8984a0be5f7997d836603963dcf8f2e728ff /include | |
parent | 481bed454247538e9f57d4ea37b153ccba24ba7b (diff) |
[PATCH] VFS: pass file pointer to filesystem from ftruncate()
This patch extends the iattr structure with a file pointer memeber, and adds
an ATTR_FILE validity flag for this member.
This is set if do_truncate() is invoked from ftruncate() or from
do_coredump().
The change is source and binary compatible.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6d6226732c93..0c89fc9481a8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -264,6 +264,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
264 | #define ATTR_ATTR_FLAG 1024 | 264 | #define ATTR_ATTR_FLAG 1024 |
265 | #define ATTR_KILL_SUID 2048 | 265 | #define ATTR_KILL_SUID 2048 |
266 | #define ATTR_KILL_SGID 4096 | 266 | #define ATTR_KILL_SGID 4096 |
267 | #define ATTR_FILE 8192 | ||
267 | 268 | ||
268 | /* | 269 | /* |
269 | * This is the Inode Attributes structure, used for notify_change(). It | 270 | * This is the Inode Attributes structure, used for notify_change(). It |
@@ -283,6 +284,13 @@ struct iattr { | |||
283 | struct timespec ia_atime; | 284 | struct timespec ia_atime; |
284 | struct timespec ia_mtime; | 285 | struct timespec ia_mtime; |
285 | struct timespec ia_ctime; | 286 | struct timespec ia_ctime; |
287 | |||
288 | /* | ||
289 | * Not an attribute, but an auxilary info for filesystems wanting to | ||
290 | * implement an ftruncate() like method. NOTE: filesystem should | ||
291 | * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL). | ||
292 | */ | ||
293 | struct file *ia_file; | ||
286 | }; | 294 | }; |
287 | 295 | ||
288 | /* | 296 | /* |
@@ -1288,7 +1296,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1288 | 1296 | ||
1289 | /* fs/open.c */ | 1297 | /* fs/open.c */ |
1290 | 1298 | ||
1291 | extern int do_truncate(struct dentry *, loff_t start); | 1299 | extern int do_truncate(struct dentry *, loff_t start, struct file *filp); |
1292 | extern long do_sys_open(const char __user *filename, int flags, int mode); | 1300 | extern long do_sys_open(const char __user *filename, int flags, int mode); |
1293 | extern struct file *filp_open(const char *, int, int); | 1301 | extern struct file *filp_open(const char *, int, int); |
1294 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | 1302 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); |