generic sreadahead hook ioctls
Subsystems (2)
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
fs/compat_ioctl.c +3 -0
@@ -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)
fs/inode.c +1 -0
@@ -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);
fs/ioctl.c +3 -0
@@ -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 :
include/linux/fs.h +4 -0
@@ -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 */ };/*
Quoted 3 lines · Kyle McMartin
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...
I still strongly disagree. You add fields to every struct inode, for a feature only used during boot time on some. Even if you want to stick to the ioctl interface it should be implemented as some sort of tree / hashtable etc that can be freed after the boot is completed.
Thas is if I understood the use case correctly, actually stating it in the patch would be highly appreciated.