Commit 577c4eb0 authored by Theodore Ts'o's avatar Theodore Ts'o Committed by Linus Torvalds

[PATCH] inode-diet: Move i_cdev into a union

Move the i_cdev pointer in struct inode into a union.
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent eaf796e7
...@@ -169,7 +169,7 @@ void fastcall __fput(struct file *file) ...@@ -169,7 +169,7 @@ void fastcall __fput(struct file *file)
if (file->f_op && file->f_op->release) if (file->f_op && file->f_op->release)
file->f_op->release(inode, file); file->f_op->release(inode, file);
security_file_free(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); cdev_put(inode->i_cdev);
fops_put(file->f_op); fops_put(file->f_op);
if (file->f_mode & FMODE_WRITE) if (file->f_mode & FMODE_WRITE)
......
...@@ -256,7 +256,7 @@ void clear_inode(struct inode *inode) ...@@ -256,7 +256,7 @@ void clear_inode(struct inode *inode)
inode->i_sb->s_op->clear_inode(inode); inode->i_sb->s_op->clear_inode(inode);
if (S_ISBLK(inode->i_mode) && inode->i_bdev) if (S_ISBLK(inode->i_mode) && inode->i_bdev)
bd_forget(inode); bd_forget(inode);
if (inode->i_cdev) if (S_ISCHR(inode->i_mode) && inode->i_cdev)
cd_forget(inode); cd_forget(inode);
inode->i_state = I_CLEAR; inode->i_state = I_CLEAR;
} }
......
...@@ -532,8 +532,8 @@ struct inode { ...@@ -532,8 +532,8 @@ struct inode {
union { union {
struct pipe_inode_info *i_pipe; struct pipe_inode_info *i_pipe;
struct block_device *i_bdev; struct block_device *i_bdev;
};
struct cdev *i_cdev; struct cdev *i_cdev;
};
int i_cindex; int i_cindex;
__u32 i_generation; __u32 i_generation;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment