[openeuler:openEuler-1.0-LTS 1743/1743] fs/block_dev.c:1075:5: warning: no previous prototype for 'bd_prepare_to_claim'

tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 58693b1f5fa8f02b34ab9a02096472232731e864 commit: fb5186196e267b3cd58b3ef31951427e8b153d05 [1743/1743] block: fix scan partition for exclusively open device again config: x86_64-buildonly-randconfig-2004-20250802 (https://download.01.org/0day-ci/archive/20250805/202508051928.DGkSyfnv-lkp@i...) compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250805/202508051928.DGkSyfnv-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202508051928.DGkSyfnv-lkp@intel.com/ All warnings (new ones prefixed by >>):
fs/block_dev.c:1075:5: warning: no previous prototype for 'bd_prepare_to_claim' [-Wmissing-prototypes] 1075 | int bd_prepare_to_claim(struct block_device *bdev, | ^~~~~~~~~~~~~~~~~~~ fs/block_dev.c:1123:6: warning: no previous prototype for 'bd_abort_claiming' [-Wmissing-prototypes] 1123 | void bd_abort_claiming(struct block_device *bdev, struct block_device *whole, | ^~~~~~~~~~~~~~~~~
vim +/bd_prepare_to_claim +1075 fs/block_dev.c 1061 1062 /** 1063 * bd_prepare_to_claim - claim a block device 1064 * @bdev: block device of interest 1065 * @whole: the whole device containing @bdev, may equal @bdev 1066 * @holder: holder trying to claim @bdev 1067 * 1068 * Claim @bdev. This function fails if @bdev is already claimed by another 1069 * holder and waits if another claiming is in progress. return, the caller 1070 * has ownership of bd_claiming and bd_holder[s]. 1071 * 1072 * RETURNS: 1073 * 0 if @bdev can be claimed, -EBUSY otherwise. 1074 */
1075 int bd_prepare_to_claim(struct block_device *bdev, 1076 struct block_device *whole, void *holder) 1077 { 1078 retry: 1079 spin_lock(&bdev_lock); 1080 /* if someone else claimed, fail */ 1081 if (!bd_may_claim(bdev, whole, holder)) { 1082 spin_unlock(&bdev_lock); 1083 return -EBUSY; 1084 } 1085 1086 /* if claiming is already in progress, wait for it to finish */ 1087 if (whole->bd_claiming) { 1088 wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0); 1089 DEFINE_WAIT(wait); 1090 1091 prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE); 1092 spin_unlock(&bdev_lock); 1093 schedule(); 1094 finish_wait(wq, &wait); 1095 goto retry; 1096 } 1097 1098 /* yay, all mine */ 1099 whole->bd_claiming = holder; 1100 spin_unlock(&bdev_lock); 1101 return 0; 1102 } 1103
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot