* [PATCH/RFC/whatever] generic sreadahead hook ioctls
@ 2008-12-10 3:11 Kyle McMartin
2008-12-19 10:35 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Kyle McMartin @ 2008-12-10 3:11 UTC (permalink / raw)
To: arjan; +Cc: linux-fsdevel
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 */
};
/*
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH/RFC/whatever] generic sreadahead hook ioctls
2008-12-10 3:11 [PATCH/RFC/whatever] generic sreadahead hook ioctls Kyle McMartin
@ 2008-12-19 10:35 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2008-12-19 10:35 UTC (permalink / raw)
To: Kyle McMartin; +Cc: arjan, linux-fsdevel
On Tue, Dec 09, 2008 at 10:11:00PM -0500, Kyle McMartin wrote:
> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-19 10:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 3:11 [PATCH/RFC/whatever] generic sreadahead hook ioctls Kyle McMartin
2008-12-19 10:35 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).