Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29671
b: refs/heads/master
c: 826843a
h: refs/heads/master
i:
  29669: b4056eb
  29667: 6eeca34
  29663: 7f4d897
v: v3
  • Loading branch information
Evgeniy Dushistov authored and Linus Torvalds committed Jun 25, 2006
1 parent c8e48f0 commit 5c41630
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ef4d6bf86a82965896eaa1a189177239ec2bbab
refs/heads/master: 826843a347cc8fd596a4c73d3fbdf04a1f130b8a
58 changes: 24 additions & 34 deletions trunk/fs/ufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,28 @@ struct address_space_operations ufs_aops = {
.bmap = ufs_bmap
};

static void ufs_set_inode_ops(struct inode *inode)
{
if (S_ISREG(inode->i_mode)) {
inode->i_op = &ufs_file_inode_operations;
inode->i_fop = &ufs_file_operations;
inode->i_mapping->a_ops = &ufs_aops;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &ufs_dir_inode_operations;
inode->i_fop = &ufs_dir_operations;
inode->i_mapping->a_ops = &ufs_aops;
} else if (S_ISLNK(inode->i_mode)) {
if (!inode->i_blocks)
inode->i_op = &ufs_fast_symlink_inode_operations;
else {
inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops;
}
} else
init_special_inode(inode, inode->i_mode,
ufs_get_inode_dev(inode->i_sb, UFS_I(inode)));
}

void ufs_read_inode (struct inode * inode)
{
struct ufs_inode_info *ufsi = UFS_I(inode);
Expand Down Expand Up @@ -626,23 +648,7 @@ void ufs_read_inode (struct inode * inode)
}
ufsi->i_osync = 0;

if (S_ISREG(inode->i_mode)) {
inode->i_op = &ufs_file_inode_operations;
inode->i_fop = &ufs_file_operations;
inode->i_mapping->a_ops = &ufs_aops;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &ufs_dir_inode_operations;
inode->i_fop = &ufs_dir_operations;
} else if (S_ISLNK(inode->i_mode)) {
if (!inode->i_blocks)
inode->i_op = &ufs_fast_symlink_inode_operations;
else {
inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops;
}
} else
init_special_inode(inode, inode->i_mode,
ufs_get_inode_dev(sb, ufsi));
ufs_set_inode_ops(inode);

brelse (bh);

Expand Down Expand Up @@ -702,23 +708,7 @@ ufs2_inode :
}
ufsi->i_osync = 0;

if (S_ISREG(inode->i_mode)) {
inode->i_op = &ufs_file_inode_operations;
inode->i_fop = &ufs_file_operations;
inode->i_mapping->a_ops = &ufs_aops;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &ufs_dir_inode_operations;
inode->i_fop = &ufs_dir_operations;
} else if (S_ISLNK(inode->i_mode)) {
if (!inode->i_blocks)
inode->i_op = &ufs_fast_symlink_inode_operations;
else {
inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops;
}
} else /* TODO : here ...*/
init_special_inode(inode, inode->i_mode,
ufs_get_inode_dev(sb, ufsi));
ufs_set_inode_ops(inode);

brelse(bh);

Expand Down
1 change: 1 addition & 0 deletions trunk/fs/ufs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ static int ufs_mkdir(struct inode * dir, struct dentry * dentry, int mode)

inode->i_op = &ufs_dir_inode_operations;
inode->i_fop = &ufs_dir_operations;
inode->i_mapping->a_ops = &ufs_aops;

inode_inc_link_count(inode);

Expand Down

0 comments on commit 5c41630

Please sign in to comment.