]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd: fix unused function warning when WITH_KRBD is disabled 64137/head
authorKefu Chai <tchaikov@gmail.com>
Tue, 24 Jun 2025 14:38:13 +0000 (22:38 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 24 Jun 2025 14:44:16 +0000 (22:44 +0800)
commit9362ecc36407186182be2a967422a8bca1467cc9
treefb3b62a8296cf33adb33bdf6a30a0d4bde93d224
parent555b14f71dd6bfab735e061eaa8959ac664a332e
rbd: fix unused function warning when WITH_KRBD is disabled

Guard print_error_description() and get_unsupported_features() with
`#ifdef WITH_KRBD` to prevent compiler warnings when KRBD support is
not enabled.

These functions are only called by do_kernel_map(), which is itself
conditionally compiled. When WITH_KRBD is not defined, the compiler
generates unused function warnings for these helper functions.

Fixes warning:

```
/home/kefu/dev/ceph/src/tools/rbd/action/Kernel.cc:305:13: warning: ‘void rbd::action::kernel::print_error_description(const char*, const char*, const char*, const char*, int)’ defined but not used [-Wunused-function]
  305 | static void print_error_description(const char *poolname,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
```

this silences the warning.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/tools/rbd/action/Kernel.cc