linux/include/linux/ceph/rados.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef CEPH_RADOS_H
#define CEPH_RADOS_H

/*
 * Data types for the Ceph distributed object storage layer RADOS
 * (Reliable Autonomic Distributed Object Store).
 */

#include <linux/ceph/msgr.h>

/*
 * fs id
 */
struct ceph_fsid {};

static inline int ceph_fsid_compare(const struct ceph_fsid *a,
				    const struct ceph_fsid *b)
{}

/*
 * ino, object, etc.
 */
ceph_snapid_t;
#define CEPH_SNAPDIR
#define CEPH_NOSNAP
#define CEPH_MAXSNAP

struct ceph_timespec {} __attribute__ ((packed));


/*
 * object layout - how objects are mapped into PGs
 */
#define CEPH_OBJECT_LAYOUT_HASH
#define CEPH_OBJECT_LAYOUT_LINEAR
#define CEPH_OBJECT_LAYOUT_HASHINO

/*
 * pg layout -- how PGs are mapped onto (sets of) OSDs
 */
#define CEPH_PG_LAYOUT_CRUSH
#define CEPH_PG_LAYOUT_HASH
#define CEPH_PG_LAYOUT_LINEAR
#define CEPH_PG_LAYOUT_HYBRID

#define CEPH_PG_MAX_SIZE

/*
 * placement group.
 * we encode this into one __le64.
 */
struct ceph_pg_v1 {} __attribute__ ((packed));

/*
 * pg_pool is a set of pgs storing a pool of objects
 *
 *  pg_num -- base number of pseudorandomly placed pgs
 *
 *  pgp_num -- effective number when calculating pg placement.  this
 * is used for pg_num increases.  new pgs result in data being "split"
 * into new pgs.  for this to proceed smoothly, new pgs are intiially
 * colocated with their parents; that is, pgp_num doesn't increase
 * until the new pgs have successfully split.  only _then_ are the new
 * pgs placed independently.
 *
 *  lpg_num -- localized pg count (per device).  replicas are randomly
 * selected.
 *
 *  lpgp_num -- as above.
 */
#define CEPH_NOPOOL

#define CEPH_POOL_TYPE_REP
#define CEPH_POOL_TYPE_RAID4
#define CEPH_POOL_TYPE_EC

/*
 * stable_mod func is used to control number of placement groups.
 * similar to straight-up modulo, but produces a stable mapping as b
 * increases over time.  b is the number of bins, and bmask is the
 * containing power of 2 minus 1.
 *
 * b <= bmask and bmask=(2**n)-1
 * e.g., b=12 -> bmask=15, b=123 -> bmask=127
 */
static inline int ceph_stable_mod(int x, int b, int bmask)
{}

/*
 * object layout - how a given object should be stored.
 */
struct ceph_object_layout {} __attribute__ ((packed));

/*
 * compound epoch+version, used by storage layer to serialize mutations
 */
struct ceph_eversion {} __attribute__ ((packed));

/*
 * osd map bits
 */

/* status bits */
#define CEPH_OSD_EXISTS
#define CEPH_OSD_UP
#define CEPH_OSD_AUTOOUT
#define CEPH_OSD_NEW

extern const char *ceph_osd_state_name(int s);

/* osd weights.  fixed point value: 0x10000 == 1.0 ("in"), 0 == "out" */
#define CEPH_OSD_IN
#define CEPH_OSD_OUT

/* osd primary-affinity.  fixed point value: 0x10000 == baseline */
#define CEPH_OSD_MAX_PRIMARY_AFFINITY
#define CEPH_OSD_DEFAULT_PRIMARY_AFFINITY


/*
 * osd map flag bits
 */
#define CEPH_OSDMAP_NEARFULL
#define CEPH_OSDMAP_FULL
#define CEPH_OSDMAP_PAUSERD
#define CEPH_OSDMAP_PAUSEWR
#define CEPH_OSDMAP_PAUSEREC
#define CEPH_OSDMAP_NOUP
#define CEPH_OSDMAP_NODOWN
#define CEPH_OSDMAP_NOOUT
#define CEPH_OSDMAP_NOIN
#define CEPH_OSDMAP_NOBACKFILL
#define CEPH_OSDMAP_NORECOVER
#define CEPH_OSDMAP_NOSCRUB
#define CEPH_OSDMAP_NODEEP_SCRUB
#define CEPH_OSDMAP_NOTIERAGENT
#define CEPH_OSDMAP_NOREBALANCE
#define CEPH_OSDMAP_SORTBITWISE
#define CEPH_OSDMAP_REQUIRE_JEWEL
#define CEPH_OSDMAP_REQUIRE_KRAKEN
#define CEPH_OSDMAP_REQUIRE_LUMINOUS
#define CEPH_OSDMAP_RECOVERY_DELETES

/*
 * The error code to return when an OSD can't handle a write
 * because it is too large.
 */
#define OSD_WRITETOOBIG

/*
 * osd ops
 *
 * WARNING: do not use these op codes directly.  Use the helpers
 * defined below instead.  In certain cases, op code behavior was
 * redefined, resulting in special-cases in the helpers.
 */
#define CEPH_OSD_OP_MODE
#define CEPH_OSD_OP_MODE_RD
#define CEPH_OSD_OP_MODE_WR
#define CEPH_OSD_OP_MODE_RMW
#define CEPH_OSD_OP_MODE_SUB
#define CEPH_OSD_OP_MODE_CACHE

#define CEPH_OSD_OP_TYPE
#define CEPH_OSD_OP_TYPE_LOCK
#define CEPH_OSD_OP_TYPE_DATA
#define CEPH_OSD_OP_TYPE_ATTR
#define CEPH_OSD_OP_TYPE_EXEC
#define CEPH_OSD_OP_TYPE_PG
#define CEPH_OSD_OP_TYPE_MULTI

#define __CEPH_OSD_OP1(mode, nr)

#define __CEPH_OSD_OP(mode, type, nr)

#define __CEPH_FORALL_OSD_OPS(f)

enum {};

static inline int ceph_osd_op_type_lock(int op)
{}
static inline int ceph_osd_op_type_data(int op)
{}
static inline int ceph_osd_op_type_attr(int op)
{}
static inline int ceph_osd_op_type_exec(int op)
{}
static inline int ceph_osd_op_type_pg(int op)
{}
static inline int ceph_osd_op_type_multi(int op)
{}

static inline int ceph_osd_op_mode_subop(int op)
{}
static inline int ceph_osd_op_mode_read(int op)
{}
static inline int ceph_osd_op_mode_modify(int op)
{}

/*
 * note that the following tmap stuff is also defined in the ceph librados.h
 * any modification here needs to be updated there
 */
#define CEPH_OSD_TMAP_HDR
#define CEPH_OSD_TMAP_SET
#define CEPH_OSD_TMAP_CREATE
#define CEPH_OSD_TMAP_RM
#define CEPH_OSD_TMAP_RMSLOPPY

extern const char *ceph_osd_op_name(int op);

/*
 * osd op flags
 *
 * An op may be READ, WRITE, or READ|WRITE.
 */
enum {};

enum {};

#define EOLDSNAPC
#define EBLOCKLISTED

/* xattr comparison */
enum {};

enum {};

enum {};

enum {};

const char *ceph_osd_watch_op_name(int o);

enum {};

enum {};

/*
 * an individual object operation.  each may be accompanied by some data
 * payload
 */
struct ceph_osd_op {} __attribute__ ((packed));


#endif