Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version #27

Merged
merged 48 commits into from Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6afb78f
multipathd.service: remove LimitCORE=infinity directive
mwilck Dec 7, 2021
e90c387
multipathd.service: don't load SCSI device handler modules
mwilck Dec 7, 2021
11f0440
multipathd.service: add dependency on initrd-cleanup.service
mwilck Dec 7, 2021
7b251a0
multipathd.service: drop dependencies on iscsi and iscsid
mwilck Dec 7, 2021
cc18bab
libmultipath: embed dm_info in multipath structure
bmarzins Dec 15, 2021
67c86ad
multipathd: update dm_info on multipath change events
bmarzins Dec 15, 2021
6e40bf9
multipathd: avoid unnecessary path read-only reloads
bmarzins Dec 15, 2021
54e7ed6
libmpathpersist: split public and internal API
mwilck Dec 15, 2021
2f7fc4f
multipathd: remove duplicate definitions from main.h
mwilck Dec 16, 2021
ac8da60
libmpathpersist/multipathd: remove duplicate definition
mwilck Dec 16, 2021
e179cb8
libmpathpersist: remove __STDC_FORMAT_MACROS
mwilck Dec 16, 2021
e608144
libmpathpersist: cleanup mpathpr.h
mwilck Dec 16, 2021
69d5e81
multipath-tools: fix misspellings
xosevp Dec 18, 2021
1834dc4
libmultipath: fix DI_NOIO pathinfo PATH_PENDING handling
bmarzins Dec 23, 2021
5c88969
libmultipath: simplify out __set_no_path_retry()
bmarzins Dec 23, 2021
7278108
libmultipath: don't enter recovery mode with pending paths
bmarzins Dec 23, 2021
dd6338d
libmultipath.version: bump major version
mwilck Dec 23, 2021
a220dd1
build: don't compress man pages
thesamesam Jan 3, 2022
c54d933
multipath-tools: remove duplicate headers
xosevp Jan 4, 2022
2316566
kpartx/devmapper.c: fix unused-but-set variable error
trofi Jan 9, 2022
be16f42
kpartx/devmapper.c: fix unused variable error
trofi Jan 9, 2022
921fabd
multipath-tools: autodiscover libdevmapper.h headers
trofi Jan 9, 2022
1017d59
multipath-tools: autodiscover libudev.h headers
trofi Jan 9, 2022
193455b
multipath-tools: allow passing non-standard linux-headers location
trofi Jan 9, 2022
02bc889
multipath-tools: avoid using GZIP Makefile variable
trofi Jan 9, 2022
353419e
libmultipath: fix disassemble status for historical-service-time PS
bmarzins Jan 18, 2022
ad16d0b
libmultipath: make helper function to trigger path uevents
bmarzins Jan 18, 2022
9b634e8
multipathd: trigger udev change on path addition
bmarzins Jan 18, 2022
378932f
libmultipath: use asprintf() to allocate prefixed_uuid
bmarzins Jan 26, 2022
1ef4541
multipath/Makefile: use $(udevrulesdir)
mwilck Feb 1, 2022
41d0b66
multipath-tools: Makefile.inc: delete obsolete comment
mwilck Feb 1, 2022
92f0893
multipath-tools: install modules-load.d/multipath.conf
mwilck Feb 1, 2022
a1eabea
multipathd.service: drop ExecStartPre for loading dm-multipath
mwilck Feb 1, 2022
2159f76
multipath: Makefile: modules-load.d file for SCSI device handlers
mwilck Feb 1, 2022
5e5e51c
README.md: add basic information about building multipath-tools
mwilck Feb 1, 2022
544c4f4
libmultipath: hwtable: use ALUA for all LIO targets
mwilck Feb 2, 2022
4f50e0e
kpartx.rules: skip MD devices
mwilck Feb 7, 2022
cfff03e
multipathd: handle fpin events
muneendramandala Feb 10, 2022
3af023b
multipathd: disallow changing to/from fpin marginal paths on reconfig
bmarzins Feb 14, 2022
852a1df
libmultipath: support host adapter name lookup for s390x ccw bus
steffen-maier Feb 15, 2022
260d7cb
libmultipath: add %L path wildcard for 64-bit hex LUN
steffen-maier Feb 15, 2022
1a2f329
libmultipath: fix printing native nvme multipath topology.
bmarzins Feb 16, 2022
d11793a
Add missing include <assert.h>
Uglymotha Jan 8, 2022
571f28b
libmultipath: enable linear ordering of bus/proto tuple
mwilck Feb 17, 2022
28fcf23
libmultipath: use bus_protocol_id() in snprint_path_protocol()
mwilck Feb 17, 2022
6ae1b0c
libmultipath: enable defining a static bitfield
mwilck Feb 17, 2022
ac61ccc
libmultipath: only warn once about unsupported dev_loss_tmo
mwilck Feb 17, 2022
fc87ba4
Bump version to 0.8.9
mwilck Feb 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
libmultipath: embed dm_info in multipath structure
Instead of having multipath allocate its dm_info structure, it should
just embed it to save on the extra allocations. This also lets us have
only one function that all callers use to fill a dm_info structure.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
  • Loading branch information
bmarzins authored and mwilck committed Dec 17, 2021
commit cc18bab3453532adcfe0eebeef8b044404ea93a1
7 changes: 4 additions & 3 deletions libmultipath/configure.c
Expand Up @@ -450,12 +450,12 @@ get_udev_for_mpp(const struct multipath *mpp)
dev_t devnum;
struct udev_device *udd;

if (!mpp || !mpp->dmi) {
if (!mpp || !has_dm_info(mpp)) {
condlog(1, "%s called with empty mpp", __func__);
return NULL;
}

devnum = makedev(mpp->dmi->major, mpp->dmi->minor);
devnum = makedev(mpp->dmi.major, mpp->dmi.minor);
udd = udev_device_new_from_devnum(udev, 'b', devnum);
if (!udd) {
condlog(1, "failed to get udev device for %s", mpp->alias);
Expand Down Expand Up @@ -574,7 +574,8 @@ sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload)
return 0;
max_sectors_kb = mpp->max_sectors_kb;
if (is_reload) {
if (!mpp->dmi && dm_get_info(mpp->alias, &mpp->dmi) != 0) {
if (!has_dm_info(mpp) &&
dm_get_info(mpp->alias, &mpp->dmi) != 0) {
condlog(1, "failed to get dm info for %s", mpp->alias);
return 1;
}
Expand Down
51 changes: 17 additions & 34 deletions libmultipath/devmapper.c
Expand Up @@ -611,12 +611,21 @@ int dm_addmap_reload(struct multipath *mpp, char *params, int flush)
return 0;
}

static int
do_get_info(const char *name, struct dm_info *info)
bool
has_dm_info(const struct multipath *mpp)
{
return (mpp && mpp->dmi.exists != 0);
}

int
dm_get_info(const char *name, struct dm_info *info)
{
int r = -1;
struct dm_task *dmt;

if (!name || !info)
return r;

if (!(dmt = libmp_dm_task_create(DM_DEVICE_INFO)))
return r;

Expand Down Expand Up @@ -646,7 +655,7 @@ int dm_map_present(const char * str)
{
struct dm_info info;

return (do_get_info(str, &info) == 0);
return (dm_get_info(str, &info) == 0);
}

int dm_get_map(const char *name, unsigned long long *size, char **outparams)
Expand Down Expand Up @@ -969,7 +978,7 @@ dm_dev_t (const char * mapname, char * dev_t, int len)
{
struct dm_info info;

if (do_get_info(mapname, &info) != 0)
if (dm_get_info(mapname, &info) != 0)
return 1;

if (snprintf(dev_t, len, "%i:%i", info.major, info.minor) > len)
Expand Down Expand Up @@ -1013,7 +1022,7 @@ dm_get_major_minor(const char *name, int *major, int *minor)
{
struct dm_info info;

if (do_get_info(name, &info) != 0)
if (dm_get_info(name, &info) != 0)
return -1;

*major = info.major;
Expand Down Expand Up @@ -1367,7 +1376,7 @@ dm_geteventnr (const char *name)
{
struct dm_info info;

if (do_get_info(name, &info) != 0)
if (dm_get_info(name, &info) != 0)
return -1;

return info.event_nr;
Expand All @@ -1378,7 +1387,7 @@ dm_is_suspended(const char *name)
{
struct dm_info info;

if (do_get_info(name, &info) != 0)
if (dm_get_info(name, &info) != 0)
return -1;

return info.suspended;
Expand Down Expand Up @@ -1542,7 +1551,7 @@ dm_get_deferred_remove (const char * mapname)
{
struct dm_info info;

if (do_get_info(mapname, &info) != 0)
if (dm_get_info(mapname, &info) != 0)
return -1;

return info.deferred_remove;
Expand Down Expand Up @@ -1583,32 +1592,6 @@ dm_cancel_deferred_remove (struct multipath *mpp __attribute__((unused)))

#endif

static struct dm_info *
alloc_dminfo (void)
{
return calloc(1, sizeof(struct dm_info));
}

int
dm_get_info (const char * mapname, struct dm_info ** dmi)
{
if (!mapname)
return 1;

if (!*dmi)
*dmi = alloc_dminfo();

if (!*dmi)
return 1;

if (do_get_info(mapname, *dmi) != 0) {
free(*dmi);
*dmi = NULL;
return 1;
}
return 0;
}

struct rename_data {
const char *old;
char *new;
Expand Down
3 changes: 2 additions & 1 deletion libmultipath/devmapper.h
Expand Up @@ -70,7 +70,8 @@ char * dm_mapname(int major, int minor);
int dm_remove_partmaps (const char * mapname, int need_sync,
int deferred_remove);
int dm_get_uuid(const char *name, char *uuid, int uuid_len);
int dm_get_info (const char * mapname, struct dm_info ** dmi);
bool has_dm_info(const struct multipath *mpp);
int dm_get_info (const char * mapname, struct dm_info *dmi);
int dm_rename (const char * old, char * new, char * delim, int skip_kpartx);
int dm_reassign(const char * mapname);
int dm_reassign_table(const char *name, char *old, char *new);
Expand Down
1 change: 1 addition & 0 deletions libmultipath/libmultipath.version
Expand Up @@ -121,6 +121,7 @@ global:
get_used_hwes;
get_vpd_sgio;
group_by_prio;
has_dm_info;
init_checkers;
init_config;
init_foreign;
Expand Down
12 changes: 7 additions & 5 deletions libmultipath/print.c
Expand Up @@ -171,18 +171,18 @@ snprint_name (struct strbuf *buff, const struct multipath * mpp)
static int
snprint_sysfs (struct strbuf *buff, const struct multipath * mpp)
{
if (mpp->dmi)
return print_strbuf(buff, "dm-%i", mpp->dmi->minor);
if (has_dm_info(mpp))
return print_strbuf(buff, "dm-%i", mpp->dmi.minor);
else
return append_strbuf_str(buff, "undef");
}

static int
snprint_ro (struct strbuf *buff, const struct multipath * mpp)
{
if (!mpp->dmi)
if (!has_dm_info(mpp))
return append_strbuf_str(buff, "undef");
if (mpp->dmi->read_only)
if (mpp->dmi.read_only)
return append_strbuf_str(buff, "ro");
else
return append_strbuf_str(buff, "rw");
Expand Down Expand Up @@ -256,7 +256,9 @@ snprint_nb_paths (struct strbuf *buff, const struct multipath * mpp)
static int
snprint_dm_map_state (struct strbuf *buff, const struct multipath * mpp)
{
if (mpp->dmi && mpp->dmi->suspended)
if (!has_dm_info(mpp))
return append_strbuf_str(buff, "undef");
else if (mpp->dmi.suspended)
return append_strbuf_str(buff, "suspend");
else
return append_strbuf_str(buff, "active");
Expand Down
10 changes: 3 additions & 7 deletions libmultipath/structs.c
Expand Up @@ -18,6 +18,7 @@
#include "prio.h"
#include "prioritizers/alua_spc3.h"
#include "dm-generic.h"
#include "devmapper.h"

struct adapter_group *
alloc_adaptergroup(void)
Expand Down Expand Up @@ -278,11 +279,6 @@ free_multipath (struct multipath * mpp, enum free_path_mode free_paths)
mpp->alias = NULL;
}

if (mpp->dmi) {
free(mpp->dmi);
mpp->dmi = NULL;
}

if (!free_paths && mpp->pg) {
struct pathgroup *pgp;
struct path *pp;
Expand Down Expand Up @@ -407,10 +403,10 @@ find_mp_by_minor (const struct _vector *mpvec, unsigned int minor)
return NULL;

vector_foreach_slot (mpvec, mpp, i) {
if (!mpp->dmi)
if (!has_dm_info(mpp))
continue;

if (mpp->dmi->minor == minor)
if (mpp->dmi.minor == minor)
return mpp;
}
return NULL;
Expand Down
3 changes: 2 additions & 1 deletion libmultipath/structs.h
Expand Up @@ -4,6 +4,7 @@
#include <sys/types.h>
#include <inttypes.h>
#include <stdbool.h>
#include <libdevmapper.h>

#include "prio.h"
#include "byteorder.h"
Expand Down Expand Up @@ -386,7 +387,7 @@ struct multipath {
unsigned long long size;
vector paths;
vector pg;
struct dm_info * dmi;
struct dm_info dmi;

/* configlet pointers */
char * alias;
Expand Down
2 changes: 1 addition & 1 deletion multipathd/main.c
Expand Up @@ -908,7 +908,7 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs)
}
if (strcmp(mpp->alias, alias)) {
condlog(2, "%s: minor number mismatch (map %d, event %d)",
mpp->alias, mpp->dmi->minor, minor);
mpp->alias, mpp->dmi.minor, minor);
return 1;
}
return flush_map(mpp, vecs, 0);
Expand Down