···7070 part_stat_inc(cpu, part, merges[rw]);7171 } else {7272 part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));7373- if (!kref_test_and_get(&part->ref)) {7373+ if (!hd_struct_try_get(part)) {7474 /*7575 * The partition is already being removed,7676 * the request will be accounted on the disk only···8080 * it as any other partition.8181 */8282 part = &rq->rq_disk->part0;8383- kref_get(&part->ref);8383+ hd_struct_get(part);8484 }8585 part_round_stats(cpu, part);8686 part_inc_in_flight(part, rw);···18181818 part_round_stats(cpu, part);18191819 part_dec_in_flight(part, rw);1820182018211821- kref_put(&part->ref, __delete_partition);18211821+ hd_struct_put(part);18221822 part_stat_unlock();18231823 }18241824}
···3737}38383939/**4040- * kref_test_and_get - increment refcount for object only if refcount is not4141- * zero.4242- * @kref: object.4343- *4444- * Return non-zero if the refcount was incremented, 0 otherwise4545- */4646-int kref_test_and_get(struct kref *kref)4747-{4848- return atomic_inc_not_zero(&kref->refcount);4949-}5050-5151-/**5240 * kref_put - decrement refcount for object.5341 * @kref: object.5442 * @release: pointer to the function that will clean up the object when the