/* Return Value: On success, pointer to the_nilfs is returned. On error, NULL is returned.  */
static struct the_nilfs* alloc_nilfs(struct block_device *bdev)
/* Return Value: On success, pointer to the_nilfs is returned. On error, NULL is returned.  */
static struct the_nilfs* alloc_nilfs(struct block_device *bdev)
{
	struct the_nilfs *nilfs;
	nilfs = kzalloc(sizeof(*nilfs), GFP_KERNEL);
	if (!nilfs)
		return NULL;
	nilfs->ns_bdev = bdev;
	atomic_set(&nilfs->ns_count, 1);
	atomic_set(&nilfs->ns_ndirtyblks, 0);
	init_rwsem(&nilfs->ns_sem);
	init_rwsem(&nilfs->ns_super_sem);
	mutex_init(&nilfs->ns_mount_mutex);
	init_rwsem(&nilfs->ns_writer_sem);
	INIT_LIST_HEAD(&nilfs->ns_list);
	INIT_LIST_HEAD(&nilfs->ns_supers);
	spin_lock_init(&nilfs->ns_last_segment_lock);
	nilfs->ns_gc_inodes_h = NULL;
	init_rwsem(&nilfs->ns_segctor_sem);
	return nilfs;
}