License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2009-10-07 02:31:10 +08:00
|
|
|
#ifndef _FS_CEPH_OSDMAP_H
|
|
|
|
#define _FS_CEPH_OSDMAP_H
|
|
|
|
|
|
|
|
#include <linux/rbtree.h>
|
2012-10-03 01:01:25 +08:00
|
|
|
#include <linux/ceph/types.h>
|
2013-04-02 07:58:26 +08:00
|
|
|
#include <linux/ceph/decode.h>
|
2010-04-07 06:14:15 +08:00
|
|
|
#include <linux/crush/crush.h>
|
2009-10-07 02:31:10 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The osd map describes the current membership of the osd cluster and
|
|
|
|
* specifies the mapping of objects to placement groups and placement
|
|
|
|
* groups to (sets of) osds. That is, it completely specifies the
|
|
|
|
* (desired) distribution of all data objects in the system at some
|
|
|
|
* point in time.
|
|
|
|
*
|
|
|
|
* Each map version is identified by an epoch, which increases monotonically.
|
|
|
|
*
|
|
|
|
* The map can be updated either via an incremental map (diff) describing
|
|
|
|
* the change between two successive epochs, or as a fully encoded map.
|
|
|
|
*/
|
2013-02-24 02:38:16 +08:00
|
|
|
struct ceph_pg {
|
|
|
|
uint64_t pool;
|
|
|
|
uint32_t seed;
|
|
|
|
};
|
|
|
|
|
2017-06-15 22:30:53 +08:00
|
|
|
#define CEPH_SPG_NOSHARD -1
|
|
|
|
|
|
|
|
struct ceph_spg {
|
|
|
|
struct ceph_pg pgid;
|
|
|
|
s8 shard;
|
|
|
|
};
|
|
|
|
|
2016-04-28 22:07:23 +08:00
|
|
|
int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs);
|
2017-06-19 18:18:05 +08:00
|
|
|
int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs);
|
2016-04-28 22:07:23 +08:00
|
|
|
|
2016-04-28 22:07:23 +08:00
|
|
|
#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id
|
|
|
|
together */
|
2016-04-28 22:07:23 +08:00
|
|
|
#define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */
|
2013-02-27 02:39:09 +08:00
|
|
|
|
2009-10-07 02:31:10 +08:00
|
|
|
struct ceph_pg_pool_info {
|
2010-02-17 07:55:03 +08:00
|
|
|
struct rb_node node;
|
2013-02-24 02:41:09 +08:00
|
|
|
s64 id;
|
2016-04-28 22:07:23 +08:00
|
|
|
u8 type; /* CEPH_POOL_TYPE_* */
|
2013-02-24 02:41:09 +08:00
|
|
|
u8 size;
|
2016-04-28 22:07:23 +08:00
|
|
|
u8 min_size;
|
2013-02-24 02:41:09 +08:00
|
|
|
u8 crush_ruleset;
|
|
|
|
u8 object_hash;
|
2016-04-28 22:07:23 +08:00
|
|
|
u32 last_force_request_resend;
|
2013-02-24 02:41:09 +08:00
|
|
|
u32 pg_num, pgp_num;
|
|
|
|
int pg_num_mask, pgp_num_mask;
|
2014-01-27 23:40:19 +08:00
|
|
|
s64 read_tier;
|
|
|
|
s64 write_tier; /* wins for read+write ops */
|
2016-04-28 22:07:23 +08:00
|
|
|
u64 flags; /* CEPH_POOL_FLAG_* */
|
2010-04-10 06:46:42 +08:00
|
|
|
char *name;
|
2016-04-28 22:07:25 +08:00
|
|
|
|
|
|
|
bool was_full; /* for handle_one_map() */
|
2009-10-07 02:31:10 +08:00
|
|
|
};
|
|
|
|
|
2014-03-24 23:12:47 +08:00
|
|
|
static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool)
|
|
|
|
{
|
|
|
|
switch (pool->type) {
|
|
|
|
case CEPH_POOL_TYPE_REP:
|
|
|
|
return true;
|
|
|
|
case CEPH_POOL_TYPE_EC:
|
|
|
|
return false;
|
|
|
|
default:
|
2017-01-16 19:06:09 +08:00
|
|
|
BUG();
|
2014-03-24 23:12:47 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-24 02:41:09 +08:00
|
|
|
struct ceph_object_locator {
|
2014-01-27 23:40:18 +08:00
|
|
|
s64 pool;
|
2016-02-14 11:24:31 +08:00
|
|
|
struct ceph_string *pool_ns;
|
2013-02-24 02:41:09 +08:00
|
|
|
};
|
|
|
|
|
2016-04-28 22:07:23 +08:00
|
|
|
static inline void ceph_oloc_init(struct ceph_object_locator *oloc)
|
|
|
|
{
|
|
|
|
oloc->pool = -1;
|
2016-02-14 11:24:31 +08:00
|
|
|
oloc->pool_ns = NULL;
|
2016-04-28 22:07:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool ceph_oloc_empty(const struct ceph_object_locator *oloc)
|
|
|
|
{
|
|
|
|
return oloc->pool == -1;
|
|
|
|
}
|
|
|
|
|
2016-02-14 11:24:31 +08:00
|
|
|
void ceph_oloc_copy(struct ceph_object_locator *dest,
|
|
|
|
const struct ceph_object_locator *src);
|
|
|
|
void ceph_oloc_destroy(struct ceph_object_locator *oloc);
|
2016-04-28 22:07:23 +08:00
|
|
|
|
2016-04-30 01:54:20 +08:00
|
|
|
/*
|
|
|
|
* 51-char inline_name is long enough for all cephfs and all but one
|
|
|
|
* rbd requests: <imgname> in "<imgname>.rbd"/"rbd_id.<imgname>" can be
|
|
|
|
* arbitrarily long (~PAGE_SIZE). It's done once during rbd map; all
|
|
|
|
* other rbd requests fit into inline_name.
|
|
|
|
*
|
|
|
|
* Makes ceph_object_id 64 bytes on 64-bit.
|
|
|
|
*/
|
|
|
|
#define CEPH_OID_INLINE_LEN 52
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Both inline and external buffers have space for a NUL-terminator,
|
|
|
|
* which is carried around. It's not required though - RADOS object
|
|
|
|
* names don't have to be NUL-terminated and may contain NULs.
|
|
|
|
*/
|
2014-01-27 23:40:18 +08:00
|
|
|
struct ceph_object_id {
|
2016-04-30 01:54:20 +08:00
|
|
|
char *name;
|
|
|
|
char inline_name[CEPH_OID_INLINE_LEN];
|
2014-01-27 23:40:18 +08:00
|
|
|
int name_len;
|
|
|
|
};
|
|
|
|
|
2019-03-25 20:51:43 +08:00
|
|
|
#define __CEPH_OID_INITIALIZER(oid) { .name = (oid).inline_name }
|
|
|
|
|
|
|
|
#define CEPH_DEFINE_OID_ONSTACK(oid) \
|
|
|
|
struct ceph_object_id oid = __CEPH_OID_INITIALIZER(oid)
|
|
|
|
|
2016-04-30 01:54:20 +08:00
|
|
|
static inline void ceph_oid_init(struct ceph_object_id *oid)
|
|
|
|
{
|
2019-03-25 20:51:43 +08:00
|
|
|
*oid = (struct ceph_object_id) __CEPH_OID_INITIALIZER(*oid);
|
2016-04-30 01:54:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool ceph_oid_empty(const struct ceph_object_id *oid)
|
|
|
|
{
|
|
|
|
return oid->name == oid->inline_name && !oid->name_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ceph_oid_copy(struct ceph_object_id *dest,
|
|
|
|
const struct ceph_object_id *src);
|
|
|
|
__printf(2, 3)
|
|
|
|
void ceph_oid_printf(struct ceph_object_id *oid, const char *fmt, ...);
|
|
|
|
__printf(3, 4)
|
|
|
|
int ceph_oid_aprintf(struct ceph_object_id *oid, gfp_t gfp,
|
|
|
|
const char *fmt, ...);
|
|
|
|
void ceph_oid_destroy(struct ceph_object_id *oid);
|
|
|
|
|
2009-10-07 02:31:10 +08:00
|
|
|
struct ceph_pg_mapping {
|
|
|
|
struct rb_node node;
|
2013-02-24 02:38:16 +08:00
|
|
|
struct ceph_pg pgid;
|
2014-03-22 01:05:29 +08:00
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
int len;
|
|
|
|
int osds[];
|
2017-06-21 23:27:18 +08:00
|
|
|
} pg_temp, pg_upmap;
|
2014-03-22 01:05:29 +08:00
|
|
|
struct {
|
|
|
|
int osd;
|
|
|
|
} primary_temp;
|
2017-06-21 23:27:18 +08:00
|
|
|
struct {
|
|
|
|
int len;
|
|
|
|
int from_to[][2];
|
|
|
|
} pg_upmap_items;
|
2014-03-22 01:05:29 +08:00
|
|
|
};
|
2009-10-07 02:31:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ceph_osdmap {
|
|
|
|
struct ceph_fsid fsid;
|
|
|
|
u32 epoch;
|
|
|
|
struct ceph_timespec created, modified;
|
|
|
|
|
|
|
|
u32 flags; /* CEPH_OSDMAP_* */
|
|
|
|
|
|
|
|
u32 max_osd; /* size of osd_state, _offload, _addr arrays */
|
2017-06-23 01:44:06 +08:00
|
|
|
u32 *osd_state; /* CEPH_OSD_* */
|
2009-10-07 02:31:10 +08:00
|
|
|
u32 *osd_weight; /* 0 = failed, 0x10000 = 100% normal */
|
|
|
|
struct ceph_entity_addr *osd_addr;
|
|
|
|
|
|
|
|
struct rb_root pg_temp;
|
2014-03-22 01:05:29 +08:00
|
|
|
struct rb_root primary_temp;
|
|
|
|
|
2017-06-21 23:27:18 +08:00
|
|
|
/* remap (post-CRUSH, pre-up) */
|
|
|
|
struct rb_root pg_upmap; /* PG := raw set */
|
|
|
|
struct rb_root pg_upmap_items; /* from -> to within raw set */
|
|
|
|
|
2014-03-22 01:05:30 +08:00
|
|
|
u32 *osd_primary_affinity;
|
|
|
|
|
2010-02-17 07:55:03 +08:00
|
|
|
struct rb_root pg_pools;
|
|
|
|
u32 pool_max;
|
2009-10-07 02:31:10 +08:00
|
|
|
|
|
|
|
/* the CRUSH map specifies the mapping of placement groups to
|
|
|
|
* the list of osds that store+replicate them. */
|
|
|
|
struct crush_map *crush;
|
2014-01-31 23:54:26 +08:00
|
|
|
|
2017-01-31 22:55:06 +08:00
|
|
|
struct mutex crush_workspace_mutex;
|
2017-01-31 22:55:06 +08:00
|
|
|
void *crush_workspace;
|
2009-10-07 02:31:10 +08:00
|
|
|
};
|
|
|
|
|
2016-03-25 17:18:39 +08:00
|
|
|
static inline bool ceph_osd_exists(struct ceph_osdmap *map, int osd)
|
2014-03-24 23:12:46 +08:00
|
|
|
{
|
|
|
|
return osd >= 0 && osd < map->max_osd &&
|
|
|
|
(map->osd_state[osd] & CEPH_OSD_EXISTS);
|
|
|
|
}
|
|
|
|
|
2016-03-25 17:18:39 +08:00
|
|
|
static inline bool ceph_osd_is_up(struct ceph_osdmap *map, int osd)
|
2009-10-07 02:31:10 +08:00
|
|
|
{
|
2014-03-24 23:12:46 +08:00
|
|
|
return ceph_osd_exists(map, osd) &&
|
|
|
|
(map->osd_state[osd] & CEPH_OSD_UP);
|
|
|
|
}
|
|
|
|
|
2016-03-25 17:18:39 +08:00
|
|
|
static inline bool ceph_osd_is_down(struct ceph_osdmap *map, int osd)
|
2014-03-24 23:12:46 +08:00
|
|
|
{
|
|
|
|
return !ceph_osd_is_up(map, osd);
|
2009-10-07 02:31:10 +08:00
|
|
|
}
|
|
|
|
|
2017-06-23 01:44:06 +08:00
|
|
|
char *ceph_osdmap_state_str(char *str, int len, u32 state);
|
2014-03-22 01:05:30 +08:00
|
|
|
extern u32 ceph_get_primary_affinity(struct ceph_osdmap *map, int osd);
|
2009-10-07 02:31:10 +08:00
|
|
|
|
|
|
|
static inline struct ceph_entity_addr *ceph_osd_addr(struct ceph_osdmap *map,
|
|
|
|
int osd)
|
|
|
|
{
|
|
|
|
if (osd >= map->max_osd)
|
|
|
|
return NULL;
|
|
|
|
return &map->osd_addr[osd];
|
|
|
|
}
|
|
|
|
|
2017-06-15 22:30:54 +08:00
|
|
|
#define CEPH_PGID_ENCODING_LEN (1 + 8 + 4 + 4)
|
|
|
|
|
2013-04-02 07:58:26 +08:00
|
|
|
static inline int ceph_decode_pgid(void **p, void *end, struct ceph_pg *pgid)
|
|
|
|
{
|
|
|
|
__u8 version;
|
|
|
|
|
2017-06-15 22:30:54 +08:00
|
|
|
if (!ceph_has_room(p, end, CEPH_PGID_ENCODING_LEN)) {
|
2015-03-24 04:35:03 +08:00
|
|
|
pr_warn("incomplete pg encoding\n");
|
2013-04-02 07:58:26 +08:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
version = ceph_decode_8(p);
|
|
|
|
if (version > 1) {
|
2015-03-24 04:35:03 +08:00
|
|
|
pr_warn("do not understand pg encoding %d > 1\n",
|
2013-04-02 07:58:26 +08:00
|
|
|
(int)version);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
pgid->pool = ceph_decode_64(p);
|
|
|
|
pgid->seed = ceph_decode_32(p);
|
|
|
|
*p += 4; /* skip deprecated preferred value */
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-04-28 22:07:25 +08:00
|
|
|
struct ceph_osdmap *ceph_osdmap_alloc(void);
|
2014-03-13 22:36:13 +08:00
|
|
|
extern struct ceph_osdmap *ceph_osdmap_decode(void **p, void *end);
|
2016-04-28 22:07:21 +08:00
|
|
|
struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
|
|
|
|
struct ceph_osdmap *map);
|
2009-10-07 02:31:10 +08:00
|
|
|
extern void ceph_osdmap_destroy(struct ceph_osdmap *map);
|
|
|
|
|
2016-04-28 22:07:22 +08:00
|
|
|
struct ceph_osds {
|
|
|
|
int osds[CEPH_PG_MAX_SIZE];
|
|
|
|
int size;
|
|
|
|
int primary; /* id, NOT index */
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline void ceph_osds_init(struct ceph_osds *set)
|
|
|
|
{
|
|
|
|
set->size = 0;
|
|
|
|
set->primary = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ceph_osds_copy(struct ceph_osds *dest, const struct ceph_osds *src);
|
|
|
|
|
2017-06-15 22:30:54 +08:00
|
|
|
bool ceph_pg_is_split(const struct ceph_pg *pgid, u32 old_pg_num,
|
|
|
|
u32 new_pg_num);
|
2016-04-28 22:07:23 +08:00
|
|
|
bool ceph_is_new_interval(const struct ceph_osds *old_acting,
|
|
|
|
const struct ceph_osds *new_acting,
|
|
|
|
const struct ceph_osds *old_up,
|
|
|
|
const struct ceph_osds *new_up,
|
|
|
|
int old_size,
|
|
|
|
int new_size,
|
|
|
|
int old_min_size,
|
|
|
|
int new_min_size,
|
|
|
|
u32 old_pg_num,
|
|
|
|
u32 new_pg_num,
|
|
|
|
bool old_sort_bitwise,
|
|
|
|
bool new_sort_bitwise,
|
2017-07-27 23:59:14 +08:00
|
|
|
bool old_recovery_deletes,
|
|
|
|
bool new_recovery_deletes,
|
2016-04-28 22:07:23 +08:00
|
|
|
const struct ceph_pg *pgid);
|
|
|
|
bool ceph_osds_changed(const struct ceph_osds *old_acting,
|
|
|
|
const struct ceph_osds *new_acting,
|
|
|
|
bool any_change);
|
|
|
|
|
2018-05-23 20:46:53 +08:00
|
|
|
void __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi,
|
|
|
|
const struct ceph_object_id *oid,
|
|
|
|
const struct ceph_object_locator *oloc,
|
|
|
|
struct ceph_pg *raw_pgid);
|
2016-04-28 22:07:22 +08:00
|
|
|
int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap,
|
2017-06-15 22:30:56 +08:00
|
|
|
const struct ceph_object_id *oid,
|
|
|
|
const struct ceph_object_locator *oloc,
|
2016-04-28 22:07:22 +08:00
|
|
|
struct ceph_pg *raw_pgid);
|
2014-01-27 23:40:19 +08:00
|
|
|
|
2016-04-28 22:07:22 +08:00
|
|
|
void ceph_pg_to_up_acting_osds(struct ceph_osdmap *osdmap,
|
2017-06-15 22:30:56 +08:00
|
|
|
struct ceph_pg_pool_info *pi,
|
2016-04-28 22:07:22 +08:00
|
|
|
const struct ceph_pg *raw_pgid,
|
|
|
|
struct ceph_osds *up,
|
|
|
|
struct ceph_osds *acting);
|
2017-06-15 22:30:53 +08:00
|
|
|
bool ceph_pg_to_primary_shard(struct ceph_osdmap *osdmap,
|
2017-06-15 22:30:56 +08:00
|
|
|
struct ceph_pg_pool_info *pi,
|
2017-06-15 22:30:53 +08:00
|
|
|
const struct ceph_pg *raw_pgid,
|
|
|
|
struct ceph_spg *spgid);
|
2016-04-28 22:07:23 +08:00
|
|
|
int ceph_pg_to_acting_primary(struct ceph_osdmap *osdmap,
|
|
|
|
const struct ceph_pg *raw_pgid);
|
2009-10-07 02:31:10 +08:00
|
|
|
|
2014-01-27 23:40:19 +08:00
|
|
|
extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map,
|
|
|
|
u64 id);
|
|
|
|
|
2012-10-31 08:40:33 +08:00
|
|
|
extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
|
2010-05-18 03:31:35 +08:00
|
|
|
extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
|
|
|
|
|
2009-10-07 02:31:10 +08:00
|
|
|
#endif
|