File: dm-generic.h

package info (click to toggle)
multipath-tools 0.14.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,088 kB
  • sloc: ansic: 64,885; perl: 1,622; makefile: 742; sh: 732; pascal: 155
file content (27 lines) | stat: -rw-r--r-- 879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: GPL-2.0-or-later
/*
  Copyright (c) 2018 Martin Wilck, SUSE Linux GmbH
 */
#ifndef DM_GENERIC_H_INCLUDED
#define DM_GENERIC_H_INCLUDED
#include "generic.h"
#include "list.h" /* for container_of */
#include "structs.h"

#define dm_multipath_to_gen(mpp) (&((mpp)->generic_mp))
#define gen_multipath_to_dm(gm) \
	container_of_const((gm), struct multipath, generic_mp)

#define dm_pathgroup_to_gen(pg) (&(pg->generic_pg))
#define gen_pathgroup_to_dm(gpg) \
	container_of_const((gpg), struct pathgroup, generic_pg)

#define dm_path_to_gen(pp) (&((pp)->generic_path))
#define gen_path_to_dm(gp) \
	container_of_const((gp), struct path, generic_path)

extern const struct gen_multipath_ops dm_gen_multipath_ops;
extern const struct gen_pathgroup_ops dm_gen_pathgroup_ops;
extern const struct gen_path_ops dm_gen_path_ops;

#endif /* DM_GENERIC_H_INCLUDED */