Honestly, I don't know how tracing infrastructure could be used on this, since you want the information to have existed before you want to run sreadahead... Seems to work for me. cheers, Kyle diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 5235c67..d796c5e 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -2711,6 +2711,9 @@ IGNORE_IOCTL(VFAT_IOCTL_READDIR_SHORT32) /* loop */ IGNORE_IOCTL(LOOP_CLR_FD) +/* fs inode creation jiffies */ +HANDLE_IOCTL(FS_IOC32_CREATION_JIFFIES, w_long) + #ifdef CONFIG_SPARC /* Sparc framebuffers, handled in sbusfb_compat_ioctl() */ IGNORE_IOCTL(FBIOGTYPE) diff --git a/fs/inode.c b/fs/inode.c index 0487ddb..3304244 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -143,6 +143,7 @@ static struct inode *alloc_inode(struct super_block *sb) inode->i_cdev = NULL; inode->i_rdev = 0; inode->dirtied_when = 0; + inode->created_when = jiffies; if (security_inode_alloc(inode)) { if (inode->i_sb->s_op->destroy_inode) inode->i_sb->s_op->destroy_inode(inode); diff --git a/fs/ioctl.c b/fs/ioctl.c index 43e8b2c..eea758f 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -357,6 +357,9 @@ static int file_ioctl(struct file *filp, unsigned int cmd, return ioctl_fibmap(filp, p); case FS_IOC_FIEMAP: return ioctl_fiemap(filp, arg); + case FS_IOC_CREATION_JIFFIES: + case FS_IOC32_CREATION_JIFFIES: + return put_user(inode->created_when, p); case FIGETBSZ: return put_user(inode->i_sb->s_blocksize, p); case FIONREAD: diff --git a/include/linux/fs.h b/include/linux/fs.h index 4a853ef..4f91e57 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -241,10 +241,12 @@ extern int dir_notify_enable; #define FS_IOC_GETVERSION _IOR('v', 1, long) #define FS_IOC_SETVERSION _IOW('v', 2, long) #define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) +#define FS_IOC_CREATION_JIFFIES _IOR('f', 19, long) #define FS_IOC32_GETFLAGS _IOR('f', 1, int) #define FS_IOC32_SETFLAGS _IOW('f', 2, int) #define FS_IOC32_GETVERSION _IOR('v', 1, int) #define FS_IOC32_SETVERSION _IOW('v', 2, int) +#define FS_IOC32_CREATION_JIFFIES _IOR('f', 19, int) /* * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) @@ -685,6 +687,8 @@ struct inode { void *i_security; #endif void *i_private; /* fs or device private pointer */ + + unsigned long created_when; /* jiffies of creation time */ }; /* -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html