From 4d690855d6bdc15b753ac3c21bf507ad94d46aac Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sun, 21 Sep 2008 11:58:27 -0700
Subject: [PATCH] superreadahead patch

---
 fs/ext3/ioctl.c         |    3 +++
 fs/ext3/super.c         |    1 +
 include/linux/ext3_fs.h |    1 +
 include/linux/fs.h      |    2 ++
 4 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index 8897481..08f4854 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -276,6 +276,9 @@ group_add_out:
 		mnt_drop_write(filp->f_path.mnt);
 		return err;
 	}
+	case EXT3_IOC_INODE_JIFFIES: {
+		return inode->created_when;
+	}
 
 
 	default:
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 524b349..e6e8514 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -466,6 +466,7 @@ static struct inode *ext3_alloc_inode(struct super_block *sb)
 		return NULL;
 	ei->i_block_alloc_info = NULL;
 	ei->vfs_inode.i_version = 1;
+	ei->vfs_inode.created_when = jiffies;
 	atomic_set(&ei->i_datasync_tid, 0);
 	atomic_set(&ei->i_sync_tid, 0);
 	return &ei->vfs_inode;
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 634a5e5..84d5394 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -250,6 +250,7 @@ struct ext3_new_group_data {
 #endif
 #define EXT3_IOC_GETRSVSZ		_IOR('f', 5, long)
 #define EXT3_IOC_SETRSVSZ		_IOW('f', 6, long)
+#define EXT3_IOC_INODE_JIFFIES		_IOR('f', 19, long)
 
 /*
  * ioctl commands in 32 bit emulation
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0872372..078e3fd 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -781,6 +781,8 @@ struct inode {
 	struct posix_acl	*i_default_acl;
 #endif
 	void			*i_private; /* fs or device private pointer */
+	
+	unsigned long		created_when; /* jiffies of creation time */
 };
 
 /*
-- 
1.6.0.6

--- vanilla-2.6.32-rc7/fs/btrfs/inode.c~	2009-11-13 11:15:48.000000000 -0800
+++ vanilla-2.6.32-rc7/fs/btrfs/inode.c	2009-11-13 11:15:48.000000000 -0800
@@ -5181,6 +5181,7 @@
 	ei->outstanding_extents = 0;
 	ei->reserved_extents = 0;
 	ei->root = NULL;
+	ei->vfs_inode.created_when = jiffies;
 	spin_lock_init(&ei->accounting_lock);
 	btrfs_ordered_inode_tree_init(&ei->ordered_tree);
 	INIT_LIST_HEAD(&ei->i_orphan);
--- vanilla-2.6.32-rc7/fs/btrfs/ioctl.c~	2009-11-13 11:16:58.000000000 -0800
+++ vanilla-2.6.32-rc7/fs/btrfs/ioctl.c	2009-11-13 11:16:58.000000000 -0800
@@ -1298,6 +1298,8 @@
 	return 0;
 }
 
+#define EXT3_IOC_INODE_JIFFIES         _IOR('f', 19, long)
+
 long btrfs_ioctl(struct file *file, unsigned int
 		cmd, unsigned long arg)
 {
@@ -1337,6 +1338,8 @@
 	case BTRFS_IOC_SYNC:
 		btrfs_sync_fs(file->f_dentry->d_sb, 1);
 		return 0;
+	case EXT3_IOC_INODE_JIFFIES:
+		return fdentry(file)->d_inode->created_when;
 	}
 
 	return -ENOTTY;
