@@ -125,72 +125,74 @@ static inline int speed_max(struct mddev *mddev)
125125 mddev -> sync_speed_max : sysctl_speed_limit_max ;
126126}
127127
128- static int rdev_init_wb (struct md_rdev * rdev )
128+ static int rdev_init_serial (struct md_rdev * rdev )
129129{
130130 if (rdev -> bdev -> bd_queue -> nr_hw_queues == 1 )
131131 return 0 ;
132132
133- spin_lock_init (& rdev -> wb_list_lock );
134- INIT_LIST_HEAD (& rdev -> wb_list );
135- init_waitqueue_head (& rdev -> wb_io_wait );
136- set_bit (WBCollisionCheck , & rdev -> flags );
133+ spin_lock_init (& rdev -> serial_list_lock );
134+ INIT_LIST_HEAD (& rdev -> serial_list );
135+ init_waitqueue_head (& rdev -> serial_io_wait );
136+ set_bit (CollisionCheck , & rdev -> flags );
137137
138138 return 1 ;
139139}
140140
141141/*
142- * Create wb_info_pool if rdev is the first multi-queue device flaged
142+ * Create serial_info_pool if rdev is the first multi-queue device flaged
143143 * with writemostly, also write-behind mode is enabled.
144144 */
145- void mddev_create_wb_pool (struct mddev * mddev , struct md_rdev * rdev ,
145+ void mddev_create_serial_pool (struct mddev * mddev , struct md_rdev * rdev ,
146146 bool is_suspend )
147147{
148148 if (mddev -> bitmap_info .max_write_behind == 0 )
149149 return ;
150150
151- if (!test_bit (WriteMostly , & rdev -> flags ) || !rdev_init_wb (rdev ))
151+ if (!test_bit (WriteMostly , & rdev -> flags ) || !rdev_init_serial (rdev ))
152152 return ;
153153
154- if (mddev -> wb_info_pool == NULL ) {
154+ if (mddev -> serial_info_pool == NULL ) {
155155 unsigned int noio_flag ;
156156
157157 if (!is_suspend )
158158 mddev_suspend (mddev );
159159 noio_flag = memalloc_noio_save ();
160- mddev -> wb_info_pool = mempool_create_kmalloc_pool (NR_WB_INFOS ,
161- sizeof (struct wb_info ));
160+ mddev -> serial_info_pool =
161+ mempool_create_kmalloc_pool (NR_SERIAL_INFOS ,
162+ sizeof (struct serial_info ));
162163 memalloc_noio_restore (noio_flag );
163- if (!mddev -> wb_info_pool )
164- pr_err ("can't alloc memory pool for writemostly \n" );
164+ if (!mddev -> serial_info_pool )
165+ pr_err ("can't alloc memory pool for serialization \n" );
165166 if (!is_suspend )
166167 mddev_resume (mddev );
167168 }
168169}
169- EXPORT_SYMBOL_GPL (mddev_create_wb_pool );
170+ EXPORT_SYMBOL_GPL (mddev_create_serial_pool );
170171
171172/*
172- * destroy wb_info_pool if rdev is the last device flaged with WBCollisionCheck.
173+ * Destroy serial_info_pool if rdev is the last device flaged with
174+ * CollisionCheck.
173175 */
174- static void mddev_destroy_wb_pool (struct mddev * mddev , struct md_rdev * rdev )
176+ static void mddev_destroy_serial_pool (struct mddev * mddev , struct md_rdev * rdev )
175177{
176- if (!test_and_clear_bit (WBCollisionCheck , & rdev -> flags ))
178+ if (!test_and_clear_bit (CollisionCheck , & rdev -> flags ))
177179 return ;
178180
179- if (mddev -> wb_info_pool ) {
181+ if (mddev -> serial_info_pool ) {
180182 struct md_rdev * temp ;
181183 int num = 0 ;
182184
183185 /*
184- * Check if other rdevs need wb_info_pool .
186+ * Check if other rdevs need serial_info_pool .
185187 */
186188 rdev_for_each (temp , mddev )
187189 if (temp != rdev &&
188- test_bit (WBCollisionCheck , & temp -> flags ))
190+ test_bit (CollisionCheck , & temp -> flags ))
189191 num ++ ;
190192 if (!num ) {
191193 mddev_suspend (rdev -> mddev );
192- mempool_destroy (mddev -> wb_info_pool );
193- mddev -> wb_info_pool = NULL ;
194+ mempool_destroy (mddev -> serial_info_pool );
195+ mddev -> serial_info_pool = NULL ;
194196 mddev_resume (rdev -> mddev );
195197 }
196198 }
@@ -2337,7 +2339,7 @@ static int bind_rdev_to_array(struct md_rdev *rdev, struct mddev *mddev)
23372339 pr_debug ("md: bind<%s>\n" , b );
23382340
23392341 if (mddev -> raid_disks )
2340- mddev_create_wb_pool (mddev , rdev , false);
2342+ mddev_create_serial_pool (mddev , rdev , false);
23412343
23422344 if ((err = kobject_add (& rdev -> kobj , & mddev -> kobj , "dev-%s" , b )))
23432345 goto fail ;
@@ -2375,7 +2377,7 @@ static void unbind_rdev_from_array(struct md_rdev *rdev)
23752377 bd_unlink_disk_holder (rdev -> bdev , rdev -> mddev -> gendisk );
23762378 list_del_rcu (& rdev -> same_set );
23772379 pr_debug ("md: unbind<%s>\n" , bdevname (rdev -> bdev ,b ));
2378- mddev_destroy_wb_pool (rdev -> mddev , rdev );
2380+ mddev_destroy_serial_pool (rdev -> mddev , rdev );
23792381 rdev -> mddev = NULL ;
23802382 sysfs_remove_link (& rdev -> kobj , "block" );
23812383 sysfs_put (rdev -> sysfs_state );
@@ -2888,10 +2890,10 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len)
28882890 }
28892891 } else if (cmd_match (buf , "writemostly" )) {
28902892 set_bit (WriteMostly , & rdev -> flags );
2891- mddev_create_wb_pool (rdev -> mddev , rdev , false);
2893+ mddev_create_serial_pool (rdev -> mddev , rdev , false);
28922894 err = 0 ;
28932895 } else if (cmd_match (buf , "-writemostly" )) {
2894- mddev_destroy_wb_pool (rdev -> mddev , rdev );
2896+ mddev_destroy_serial_pool (rdev -> mddev , rdev );
28952897 clear_bit (WriteMostly , & rdev -> flags );
28962898 err = 0 ;
28972899 } else if (cmd_match (buf , "blocked" )) {
@@ -5773,14 +5775,14 @@ int md_run(struct mddev *mddev)
57735775
57745776 rdev_for_each (rdev , mddev ) {
57755777 if (test_bit (WriteMostly , & rdev -> flags ) &&
5776- rdev_init_wb (rdev ))
5778+ rdev_init_serial (rdev ))
57775779 creat_pool = true;
57785780 }
5779- if (creat_pool && mddev -> wb_info_pool == NULL ) {
5780- mddev -> wb_info_pool =
5781- mempool_create_kmalloc_pool (NR_WB_INFOS ,
5782- sizeof (struct wb_info ));
5783- if (!mddev -> wb_info_pool ) {
5781+ if (creat_pool && mddev -> serial_info_pool == NULL ) {
5782+ mddev -> serial_info_pool =
5783+ mempool_create_kmalloc_pool (NR_SERIAL_INFOS ,
5784+ sizeof (struct serial_info ));
5785+ if (!mddev -> serial_info_pool ) {
57845786 err = - ENOMEM ;
57855787 goto bitmap_abort ;
57865788 }
@@ -6025,8 +6027,8 @@ static void __md_stop_writes(struct mddev *mddev)
60256027 mddev -> in_sync = 1 ;
60266028 md_update_sb (mddev , 1 );
60276029 }
6028- mempool_destroy (mddev -> wb_info_pool );
6029- mddev -> wb_info_pool = NULL ;
6030+ mempool_destroy (mddev -> serial_info_pool );
6031+ mddev -> serial_info_pool = NULL ;
60306032}
60316033
60326034void md_stop_writes (struct mddev * mddev )
0 commit comments