Skip to content

Commit

Permalink
Remove the separate configure option for LVM cache support
Browse files Browse the repository at this point in the history
We don't need any special dependency for LVM cache so it doesn't
make sense to make the support optional.
  • Loading branch information
vojtechtrefny committed Mar 8, 2023
1 parent 6991f77 commit da71fbe
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 47 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To build UDisks with (a) chosen module(s), provide or leave these
configuration options for the `configure` script:

$ ./configure --enable-btrfs --enable-iscsi --enable-lsm
--enable-lvm2 --enable-lvmcache
--enable-lvm2

It is possible to enable all the modules at once:

Expand Down
18 changes: 0 additions & 18 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -310,23 +310,6 @@ if test "x$enable_lvm2" = "xyes" \
fi
AM_CONDITIONAL(HAVE_LVM2, [test "$have_lvm2" = "yes"])

# LVMCache
have_lvmcache=no
AC_ARG_ENABLE(lvmcache, AS_HELP_STRING([--enable-lvmcache], [enable LVMCache support]))
if test "x$enable_lvmcache" = "xyes" \
-o "x$enable_modules" = "xyes" \
-o "x$enable_available_modules" = "xyes"; then

if test "x$have_lvm2" = "xno"; then
if test "x$enable_lvmcache" = "xyes" -o "x$enable_modules" = "xyes"; then
AC_MSG_ERROR([lvmcache support requested, but lvm2 module not enabled])
fi
fi
have_lvmcache=yes
AC_DEFINE(HAVE_LVMCACHE, 1, [Define if lvmcache is available])
fi
AM_CONDITIONAL(HAVE_LVMCACHE, [test "$have_lvmcache" = "yes"])

# iSCSI module
have_iscsi=no
have_libiscsi_session_info="no"
Expand Down Expand Up @@ -712,6 +695,5 @@ echo "
BTRFS module: ${have_btrfs}
iSCSI module: ${have_iscsi}${have_libiscsi_session_info_msg}
LVM2 module: ${have_lvm2}
LVMCache: ${have_lvmcache}
LibStorageMgmt module: ${have_lsm}
"
24 changes: 0 additions & 24 deletions modules/lvm2/udiskslinuxlogicalvolume.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,16 +1088,6 @@ handle_cache_attach (UDisksLogicalVolume *volume_,
const gchar *cache_name,
GVariant *options)
{
#ifndef HAVE_LVMCACHE

g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
N_("LVMCache not enabled at compile time."));
return TRUE;

#else

GError *error = NULL;
UDisksLinuxLogicalVolume *volume = UDISKS_LINUX_LOGICAL_VOLUME (volume_);
UDisksLinuxLogicalVolumeObject *object = NULL;
Expand Down Expand Up @@ -1140,8 +1130,6 @@ handle_cache_attach (UDisksLogicalVolume *volume_,
g_clear_object (&object);

return TRUE;

#endif /* HAVE_LVMCACHE */
}


Expand All @@ -1151,16 +1139,6 @@ handle_cache_detach_or_split (UDisksLogicalVolume *volume_,
GVariant *options,
gboolean destroy)
{
#ifndef HAVE_LVMCACHE

g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
N_("LVMCache not enabled at compile time."));
return TRUE;

#else

GError *error = NULL;
UDisksLinuxLogicalVolume *volume = UDISKS_LINUX_LOGICAL_VOLUME (volume_);
UDisksLinuxLogicalVolumeObject *object = NULL;
Expand Down Expand Up @@ -1203,8 +1181,6 @@ handle_cache_detach_or_split (UDisksLogicalVolume *volume_,
g_clear_object (&object);

return TRUE;

#endif /* HAVE_LVMCACHE */
}

static gboolean
Expand Down
4 changes: 0 additions & 4 deletions packaging/udisks2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

%define with_btrfs 1
%define with_lsm 1
%define with_lvmcache 1

%define is_fedora 0%{?rhel} == 0
%define is_git %(git show > /dev/null 2>&1 && echo 1 || echo 0)
Expand Down Expand Up @@ -208,9 +207,6 @@ autoreconf -ivf
%endif
%if 0%{?with_lsm}
--enable-lsm \
%endif
%if 0%{?with_lvmcache}
--enable-lvmcache \
%endif
--enable-lvm2 \
--enable-iscsi
Expand Down

0 comments on commit da71fbe

Please sign in to comment.