diff options
-rw-r--r-- | fs/ufs/inode.c | 58 | ||||
-rw-r--r-- | fs/ufs/namei.c | 1 |
2 files changed, 25 insertions, 34 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index ea2267316a72..c28b7522c9e7 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -552,6 +552,28 @@ struct address_space_operations ufs_aops = { | |||
552 | .bmap = ufs_bmap | 552 | .bmap = ufs_bmap |
553 | }; | 553 | }; |
554 | 554 | ||
555 | static void ufs_set_inode_ops(struct inode *inode) | ||
556 | { | ||
557 | if (S_ISREG(inode->i_mode)) { | ||
558 | inode->i_op = &ufs_file_inode_operations; | ||
559 | inode->i_fop = &ufs_file_operations; | ||
560 | inode->i_mapping->a_ops = &ufs_aops; | ||
561 | } else if (S_ISDIR(inode->i_mode)) { | ||
562 | inode->i_op = &ufs_dir_inode_operations; | ||
563 | inode->i_fop = &ufs_dir_operations; | ||
564 | inode->i_mapping->a_ops = &ufs_aops; | ||
565 | } else if (S_ISLNK(inode->i_mode)) { | ||
566 | if (!inode->i_blocks) | ||
567 | inode->i_op = &ufs_fast_symlink_inode_operations; | ||
568 | else { | ||
569 | inode->i_op = &page_symlink_inode_operations; | ||
570 | inode->i_mapping->a_ops = &ufs_aops; | ||
571 | } | ||
572 | } else | ||
573 | init_special_inode(inode, inode->i_mode, | ||
574 | ufs_get_inode_dev(inode->i_sb, UFS_I(inode))); | ||
575 | } | ||
576 | |||
555 | void ufs_read_inode (struct inode * inode) | 577 | void ufs_read_inode (struct inode * inode) |
556 | { | 578 | { |
557 | struct ufs_inode_info *ufsi = UFS_I(inode); | 579 | struct ufs_inode_info *ufsi = UFS_I(inode); |
@@ -626,23 +648,7 @@ void ufs_read_inode (struct inode * inode) | |||
626 | } | 648 | } |
627 | ufsi->i_osync = 0; | 649 | ufsi->i_osync = 0; |
628 | 650 | ||
629 | if (S_ISREG(inode->i_mode)) { | 651 | ufs_set_inode_ops(inode); |
630 | inode->i_op = &ufs_file_inode_operations; | ||
631 | inode->i_fop = &ufs_file_operations; | ||
632 | inode->i_mapping->a_ops = &ufs_aops; | ||
633 | } else if (S_ISDIR(inode->i_mode)) { | ||
634 | inode->i_op = &ufs_dir_inode_operations; | ||
635 | inode->i_fop = &ufs_dir_operations; | ||
636 | } else if (S_ISLNK(inode->i_mode)) { | ||
637 | if (!inode->i_blocks) | ||
638 | inode->i_op = &ufs_fast_symlink_inode_operations; | ||
639 | else { | ||
640 | inode->i_op = &page_symlink_inode_operations; | ||
641 | inode->i_mapping->a_ops = &ufs_aops; | ||
642 | } | ||
643 | } else | ||
644 | init_special_inode(inode, inode->i_mode, | ||
645 | ufs_get_inode_dev(sb, ufsi)); | ||
646 | 652 | ||
647 | brelse (bh); | 653 | brelse (bh); |
648 | 654 | ||
@@ -702,23 +708,7 @@ ufs2_inode : | |||
702 | } | 708 | } |
703 | ufsi->i_osync = 0; | 709 | ufsi->i_osync = 0; |
704 | 710 | ||
705 | if (S_ISREG(inode->i_mode)) { | 711 | ufs_set_inode_ops(inode); |
706 | inode->i_op = &ufs_file_inode_operations; | ||
707 | inode->i_fop = &ufs_file_operations; | ||
708 | inode->i_mapping->a_ops = &ufs_aops; | ||
709 | } else if (S_ISDIR(inode->i_mode)) { | ||
710 | inode->i_op = &ufs_dir_inode_operations; | ||
711 | inode->i_fop = &ufs_dir_operations; | ||
712 | } else if (S_ISLNK(inode->i_mode)) { | ||
713 | if (!inode->i_blocks) | ||
714 | inode->i_op = &ufs_fast_symlink_inode_operations; | ||
715 | else { | ||
716 | inode->i_op = &page_symlink_inode_operations; | ||
717 | inode->i_mapping->a_ops = &ufs_aops; | ||
718 | } | ||
719 | } else /* TODO : here ...*/ | ||
720 | init_special_inode(inode, inode->i_mode, | ||
721 | ufs_get_inode_dev(sb, ufsi)); | ||
722 | 712 | ||
723 | brelse(bh); | 713 | brelse(bh); |
724 | 714 | ||
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 8d5f98a01c74..51f702700308 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c | |||
@@ -205,6 +205,7 @@ static int ufs_mkdir(struct inode * dir, struct dentry * dentry, int mode) | |||
205 | 205 | ||
206 | inode->i_op = &ufs_dir_inode_operations; | 206 | inode->i_op = &ufs_dir_inode_operations; |
207 | inode->i_fop = &ufs_dir_operations; | 207 | inode->i_fop = &ufs_dir_operations; |
208 | inode->i_mapping->a_ops = &ufs_aops; | ||
208 | 209 | ||
209 | inode_inc_link_count(inode); | 210 | inode_inc_link_count(inode); |
210 | 211 | ||