Commit 9cfdc7aa9f1b59627029ad00a58c3f59eb2cc383

Authored by Boaz Harrosh
1 parent fe33cc1ee1

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>

Showing 1 changed file with 8 additions and 2 deletions Side-by-side Diff

... ... @@ -908,6 +908,12 @@
908 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 918 * Fill in an inode read from the OSD and set it up for use
913 919 */
914 920  
... ... @@ -925,13 +931,13 @@
925 931 if (!(inode->i_state & I_NEW))
926 932 return inode;
927 933 oi = exofs_i(inode);
  934 + __oi_init(oi);
928 935  
929 936 /* read the inode from the osd */
930 937 ret = exofs_get_inode(sb, oi, &fcb, &sanity);
931 938 if (ret)
932 939 goto bad_inode;
933 940  
934   - init_waitqueue_head(&oi->i_wq);
935 941 set_obj_created(oi);
936 942  
937 943 /* copy stuff from on-disk struct to in-memory struct */
938 944  
... ... @@ -1062,8 +1068,8 @@
1062 1068 return ERR_PTR(-ENOMEM);
1063 1069  
1064 1070 oi = exofs_i(inode);
  1071 + __oi_init(oi);
1065 1072  
1066   - init_waitqueue_head(&oi->i_wq);
1067 1073 set_obj_2bcreated(oi);
1068 1074  
1069 1075 sbi = sb->s_fs_info;