Error occur when build kernel driver with open_bdev_excl function,why?

I write a driver in kernel,which use open_bdev_excl function to read block device
but when i build my driver,there are some error,as follow:
: ERROR: implicit declaration of function ‘open_bdev_excl’; did you mean ‘open_exec’? [-Werror=implicit-function-declaration]
bdev = open_bdev_excl(PATH, NULL, NULL);
^~~~~~~~~~~~~~
open_exec
/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/nvidia/drivers/media/i2c/ar0233.c:1069:8: ERROR: assignment makes pointer from integer without a cast [-Werror=int-conversion]
bdev = open_bdev_excl(PATH, NULL, NULL);
^
/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/nvidia/drivers/media/i2c/ar0233.c:1076:8: ERROR: implicit declaration of function ‘__bread’; did you mean ‘vread’? [-Werror=implicit-function-declaration]
bh = __bread(bdev, j, block_size);
^~~~~~~
vread
/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/nvidia/drivers/media/i2c/ar0233.c:1076:6: ERROR: assignment makes pointer from integer without a cast [-Werror=int-conversion]
bh = __bread(bdev, j, block_size);
^
/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/nvidia/drivers/media/i2c/ar0233.c:1082:17: ERROR: dereferencing pointer to incomplete type ‘struct buffer_head’
p = (char *)(bh->b_data);
^~
/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/nvidia/drivers/media/i2c/ar0233.c:1091:3: ERROR: Implicit function declaration ‘brelse’ [-Werror=implicit-function-declaration]
brelse(bh);
^~~~~~
/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/nvidia/drivers/media/i2c/ar0233.c:1096:1: ERROR: Implicit function declaration‘close_bdev_excl’ [-Werror=implicit-function-declaration]
close_bdev_excl(bdev);
^~~~~~~~~~~~~~~
cc1:所有的警告都被当作是错误
…/scripts/Makefile.build:341: recipe for target ‘drivers/media/i2c/ar0233.o’ failed
make[4]: *** [drivers/media/i2c/ar0233.o] Error 1
…/scripts/Makefile.build:649: recipe for target ‘drivers/media/i2c’ failed
make[3]: *** [drivers/media/i2c] Error 2
make[3]: *** 正在等待未完成的任务…
…/scripts/Makefile.build:649: recipe for target ‘drivers/media’ failed
make[2]: *** [drivers/media] Error 2
make[2]: *** 正在等待未完成的任务…
/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/kernel-4.9/Makefile:1104: recipe for target ‘drivers’ failed
make[1]: *** [drivers] Error 2
make[1]: 离开目录“/home/autel-lee/dolphin_project/git/optimus-kernel/kernel/kernel-4.9/build”
Makefile:171: recipe for target ‘sub-make’ failed
make: *** [sub-make] Error 2

I check my kernel is kernel 4.9, is this function(open_bdev_excl) available in current kernel version?

Looks like didn’t include correct include file.

I searched this in 4.9.10 kernel source code,but i didn’t find it

Why need this API for a sensor driver? You may change an API that include in the kernel.

i need API for disk partition read/write in kernel space,because i set a specified partition ,and write a config yaml file to this partition with dd command in user space.i want to read this config yaml file in my kernel driver.

OK, you may need to make sure this API have include in the kernel space otherwise you may need other solution.