lkml.org 
[lkml]   [2006]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 4/8] inode-diet: Move i_cdev into a union
Move the i_cdev pointer in struct inode into a union.

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:28:55.000000000 -0400
+++ linux-2.6.17-mm5/include/linux/fs.h 2006-07-02 20:28:58.000000000 -0400
@@ -527,8 +527,8 @@
union {
struct pipe_inode_info *i_pipe;
struct block_device *i_bdev;
+ struct cdev *i_cdev;
};
- struct cdev *i_cdev;
int i_cindex;

__u32 i_generation;
Index: linux-2.6.17-mm5/fs/file_table.c
===================================================================
--- linux-2.6.17-mm5.orig/fs/file_table.c 2006-07-02 20:25:46.000000000 -0400
+++ linux-2.6.17-mm5/fs/file_table.c 2006-07-02 20:28:58.000000000 -0400
@@ -176,7 +176,7 @@
if (file->f_op && file->f_op->release)
file->f_op->release(inode, file);
security_file_free(file);
- if (unlikely(inode->i_cdev != NULL))
+ if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL))
cdev_put(inode->i_cdev);
fops_put(file->f_op);
if (file->f_mode & FMODE_WRITE)
Index: linux-2.6.17-mm5/fs/inode.c
===================================================================
--- linux-2.6.17-mm5.orig/fs/inode.c 2006-07-02 20:28:55.000000000 -0400
+++ linux-2.6.17-mm5/fs/inode.c 2006-07-02 20:28:58.000000000 -0400
@@ -256,7 +256,7 @@
inode->i_sb->s_op->clear_inode(inode);
if (S_ISBLK(inode->i_mode) && inode->i_bdev)
bd_forget(inode);
- if (inode->i_cdev)
+ if (S_ISCHR(inode->i_mode) && inode->i_cdev)
cd_forget(inode);
inode->i_state = I_CLEAR;
}
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-03 03:05    [W:0.063 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site