diff --git a/block/blk.h b/block/blk.h index 3f1c76b55336983acd79aaa0e0f09498ac350d8d..9269bb6b14f811059ab2f95879bffcada4bee4de 100644 --- a/block/blk.h +++ b/block/blk.h @@ -214,7 +214,6 @@ unsigned int blk_plug_queued_count(struct request_queue *q); void blk_account_io_start(struct request *req, bool new_io); void blk_account_io_completion(struct request *req, unsigned int bytes); void blk_account_io_done(struct request *req, u64 now); -int disk_scan_partitions(struct gendisk *disk, fmode_t mode); /* * EH timer and IO completion will both attempt to 'grab' the request, make diff --git a/block/blk_extra_api.h b/block/blk_extra_api.h new file mode 100644 index 0000000000000000000000000000000000000000..704d2a61bf12f61d87ed4ffe265b5ccd6c1f1d9b --- /dev/null +++ b/block/blk_extra_api.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023. Huawei Technologies Co., Ltd. All rights reserved. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef BLK_EXTRA_API_H +#define BLK_EXTRA_API_H + +/* + * Include blk.h will cause kabi broken in some contexts because it will expose + * definitions for some data structure. This file is used for the apis that + * can't be placed in blk.h. + */ + +#include + +int disk_scan_partitions(struct gendisk *disk, fmode_t mode); + +#endif /* BLK_EXTRA_API_H */ diff --git a/block/ioctl.c b/block/ioctl.c index da8d0914638569d9718c66ae796f63c4fa9cce0f..ddc6d340e87679bcaa62e855a6d1b58e76f37c09 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -10,7 +10,7 @@ #include #include -#include "blk.h" +#include "blk_extra_api.h" static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user *arg) {