]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/fs.h
[PATCH] VFS: pass file pointer to filesystem from ftruncate()
[net-next-2.6.git] / include / linux / fs.h
index 6d6226732c93ba96e5edf946e2c934f3e23b390b..0c89fc9481a8d94ad820238a3c22b6b4042a2548 100644 (file)
@@ -264,6 +264,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
 #define ATTR_ATTR_FLAG 1024
 #define ATTR_KILL_SUID 2048
 #define ATTR_KILL_SGID 4096
+#define ATTR_FILE      8192
 
 /*
  * This is the Inode Attributes structure, used for notify_change().  It
@@ -283,6 +284,13 @@ struct iattr {
        struct timespec ia_atime;
        struct timespec ia_mtime;
        struct timespec ia_ctime;
+
+       /*
+        * Not an attribute, but an auxilary info for filesystems wanting to
+        * implement an ftruncate() like method.  NOTE: filesystem should
+        * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL).
+        */
+       struct file     *ia_file;
 };
 
 /*
@@ -1288,7 +1296,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
 
 /* fs/open.c */
 
-extern int do_truncate(struct dentry *, loff_t start);
+extern int do_truncate(struct dentry *, loff_t start, struct file *filp);
 extern long do_sys_open(const char __user *filename, int flags, int mode);
 extern struct file *filp_open(const char *, int, int);
 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);