diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2009-08-04 13:40:29 -0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2009-12-10 02:59:19 -0500 |
commit | 9cfdc7aa9f1b59627029ad00a58c3f59eb2cc383 (patch) | |
tree | 62b60dccb98ff71a332fbccd5f69e6a6416818c9 /fs/exofs/inode.c | |
parent | fe33cc1ee170c0e3b47ab9cbac07083b3446961c (diff) |
exofs: refactor exofs_i_info initialization into common helper
There are two places that initialize inodes: exofs_iget() and
exofs_new_inode()
As more members of exofs_i_info that need initialization are
added this code will grow. (soon)
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/inode.c')
-rw-r--r-- | fs/exofs/inode.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 01fa798e8fd..7bc71a7d30a 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c | |||
@@ -908,6 +908,12 @@ out: | |||
908 | return ret; | 908 | return ret; |
909 | } | 909 | } |
910 | 910 | ||
911 | |||
912 | static void __oi_init(struct exofs_i_info *oi) | ||
913 | { | ||
914 | init_waitqueue_head(&oi->i_wq); | ||
915 | oi->i_flags = 0; | ||
916 | } | ||
911 | /* | 917 | /* |
912 | * Fill in an inode read from the OSD and set it up for use | 918 | * Fill in an inode read from the OSD and set it up for use |
913 | */ | 919 | */ |
@@ -925,13 +931,13 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino) | |||
925 | if (!(inode->i_state & I_NEW)) | 931 | if (!(inode->i_state & I_NEW)) |
926 | return inode; | 932 | return inode; |
927 | oi = exofs_i(inode); | 933 | oi = exofs_i(inode); |
934 | __oi_init(oi); | ||
928 | 935 | ||
929 | /* read the inode from the osd */ | 936 | /* read the inode from the osd */ |
930 | ret = exofs_get_inode(sb, oi, &fcb, &sanity); | 937 | ret = exofs_get_inode(sb, oi, &fcb, &sanity); |
931 | if (ret) | 938 | if (ret) |
932 | goto bad_inode; | 939 | goto bad_inode; |
933 | 940 | ||
934 | init_waitqueue_head(&oi->i_wq); | ||
935 | set_obj_created(oi); | 941 | set_obj_created(oi); |
936 | 942 | ||
937 | /* copy stuff from on-disk struct to in-memory struct */ | 943 | /* copy stuff from on-disk struct to in-memory struct */ |
@@ -1062,8 +1068,8 @@ struct inode *exofs_new_inode(struct inode *dir, int mode) | |||
1062 | return ERR_PTR(-ENOMEM); | 1068 | return ERR_PTR(-ENOMEM); |
1063 | 1069 | ||
1064 | oi = exofs_i(inode); | 1070 | oi = exofs_i(inode); |
1071 | __oi_init(oi); | ||
1065 | 1072 | ||
1066 | init_waitqueue_head(&oi->i_wq); | ||
1067 | set_obj_2bcreated(oi); | 1073 | set_obj_2bcreated(oi); |
1068 | 1074 | ||
1069 | sbi = sb->s_fs_info; | 1075 | sbi = sb->s_fs_info; |