public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [patch 6/8] inode-diet: Move i_cindex from struct inode to struct file
Date: Sun, 02 Jul 2006 20:53:39 -0400	[thread overview]
Message-ID: <20060703010023.430751000@candygram.thunk.org> (raw)
In-Reply-To: 20060703005333.706556000@candygram.thunk.org

[-- Attachment #1: inode-slim-6 --]
[-- Type: text/plain, Size: 2000 bytes --]

inode.i_cindex isn't initialized until the character device is opened
anyway, and there are far more struct inodes in memory than there are
struct file.  So move the cindex field to file.f_cindex, and change
the one(!) user of cindex to use file pointer, which is in fact simpler.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>


Index: linux-2.6.17-mm5/include/linux/fs.h
===================================================================
--- linux-2.6.17-mm5.orig/include/linux/fs.h	2006-07-02 20:29:16.000000000 -0400
+++ linux-2.6.17-mm5/include/linux/fs.h	2006-07-02 20:29:49.000000000 -0400
@@ -528,7 +528,6 @@
 		struct block_device	*i_bdev;
 		struct cdev		*i_cdev;
 	};
-	int			i_cindex;
 
 	__u32			i_generation;
 
@@ -749,6 +748,7 @@
 	spinlock_t		f_ep_lock;
 #endif /* #ifdef CONFIG_EPOLL */
 	struct address_space	*f_mapping;
+	int			f_cindex;
 };
 extern spinlock_t files_lock;
 #define file_list_lock() spin_lock(&files_lock);
Index: linux-2.6.17-mm5/fs/char_dev.c
===================================================================
--- linux-2.6.17-mm5.orig/fs/char_dev.c	2006-07-02 20:25:46.000000000 -0400
+++ linux-2.6.17-mm5/fs/char_dev.c	2006-07-02 20:29:49.000000000 -0400
@@ -288,7 +288,7 @@
 		p = inode->i_cdev;
 		if (!p) {
 			inode->i_cdev = p = new;
-			inode->i_cindex = idx;
+			filp->f_cindex = idx;
 			list_add(&inode->i_devices, &p->list);
 			new = NULL;
 		} else if (!cdev_get(p))
Index: linux-2.6.17-mm5/drivers/ieee1394/ieee1394_core.h
===================================================================
--- linux-2.6.17-mm5.orig/drivers/ieee1394/ieee1394_core.h	2006-07-02 20:25:31.000000000 -0400
+++ linux-2.6.17-mm5/drivers/ieee1394/ieee1394_core.h	2006-07-02 20:29:49.000000000 -0400
@@ -212,7 +212,7 @@
 /* return the index (within a minor number block) of a file */
 static inline unsigned char ieee1394_file_to_instance(struct file *file)
 {
-	return file->f_dentry->d_inode->i_cindex;
+	return file->f_cindex;
 }
 
 extern int hpsb_disable_irm;

--

  parent reply	other threads:[~2006-07-03  1:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03  0:53 [patch 0/8] Inode slimming patches, part 1 Theodore Ts'o
2006-07-03  0:53 ` [patch 1/8] inode_diet: Replace inode.u.generic_ip with inode.i_private Theodore Ts'o
2006-07-03  0:53 ` [patch 2/8] inode-diet: Move i_pipe into a union Theodore Ts'o
2006-07-03  0:53 ` [patch 3/8] inode-diet: Move i_bdev " Theodore Ts'o
2006-07-03  0:53 ` [patch 4/8] inode-diet: Move i_cdev " Theodore Ts'o
2006-07-03  0:53 ` [patch 5/8] inode-diet: Eliminate i_blksize and use a per-superblock default Theodore Ts'o
2006-07-03  0:53 ` Theodore Ts'o [this message]
2006-07-03  9:05   ` [patch 6/8] inode-diet: Move i_cindex from struct inode to struct file Christoph Hellwig
2006-07-03 14:05     ` Theodore Tso
2006-07-03  0:53 ` [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices Theodore Ts'o
2006-07-03  8:27   ` Andrew Morton
2006-07-03 14:35     ` Hugh Dickins
2006-07-03  9:06   ` Christoph Hellwig
2006-07-03 14:02     ` Theodore Tso
2006-07-03 14:42       ` Jan Engelhardt
2006-07-03 15:18       ` H. Peter Anvin
2006-07-03  0:53 ` [patch 8/8] inode-diet: Fix size of i_blkbits, i_version, and i_dnotify_mask Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060703010023.430751000@candygram.thunk.org \
    --to=tytso@mit.edu \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox