#include <linux/ceph/libceph.h>
#include <linux/ceph/osd_client.h>
#include <linux/ceph/mon_client.h>
#include <linux/ceph/cls_lock_client.h>
#include <linux/ceph/striper.h>
#include <linux/ceph/decode.h>
#include <linux/fs_parser.h>
#include <linux/bsearch.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/blk-mq.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/slab.h>
#include <linux/idr.h>
#include <linux/workqueue.h>
#include "rbd_types.h"
#define RBD_DEBUG …
static int atomic_inc_return_safe(atomic_t *v)
{ … }
static int atomic_dec_return_safe(atomic_t *v)
{ … }
#define RBD_DRV_NAME …
#define RBD_MINORS_PER_MAJOR …
#define RBD_SINGLE_MAJOR_PART_SHIFT …
#define RBD_MAX_PARENT_CHAIN_LEN …
#define RBD_SNAP_DEV_NAME_PREFIX …
#define RBD_MAX_SNAP_NAME_LEN …
#define RBD_MAX_SNAP_COUNT …
#define RBD_SNAP_HEAD_NAME …
#define BAD_SNAP_INDEX …
#define RBD_IMAGE_NAME_LEN_MAX …
#define RBD_IMAGE_ID_LEN_MAX …
#define RBD_OBJ_PREFIX_LEN_MAX …
#define RBD_NOTIFY_TIMEOUT …
#define RBD_RETRY_DELAY …
#define RBD_FEATURE_LAYERING …
#define RBD_FEATURE_STRIPINGV2 …
#define RBD_FEATURE_EXCLUSIVE_LOCK …
#define RBD_FEATURE_OBJECT_MAP …
#define RBD_FEATURE_FAST_DIFF …
#define RBD_FEATURE_DEEP_FLATTEN …
#define RBD_FEATURE_DATA_POOL …
#define RBD_FEATURE_OPERATIONS …
#define RBD_FEATURES_ALL …
#define RBD_FEATURES_SUPPORTED …
#define DEV_NAME_LEN …
struct rbd_image_header { … };
struct rbd_spec { … };
struct rbd_client { … };
struct pending_result { … };
struct rbd_img_request;
enum obj_request_type { … };
enum obj_operation_type { … };
#define RBD_OBJ_FLAG_DELETION …
#define RBD_OBJ_FLAG_COPYUP_ENABLED …
#define RBD_OBJ_FLAG_COPYUP_ZEROS …
#define RBD_OBJ_FLAG_MAY_EXIST …
#define RBD_OBJ_FLAG_NOOP_FOR_NONEXISTENT …
enum rbd_obj_read_state { … };
enum rbd_obj_write_state { … };
enum rbd_obj_copyup_state { … };
struct rbd_obj_request { … };
enum img_req_flags { … };
enum rbd_img_state { … };
struct rbd_img_request { … };
#define for_each_obj_request(ireq, oreq) …
#define for_each_obj_request_safe(ireq, oreq, n) …
enum rbd_watch_state { … };
enum rbd_lock_state { … };
struct rbd_client_id { … };
struct rbd_mapping { … };
struct rbd_device { … };
enum rbd_dev_flags { … };
static DEFINE_MUTEX(client_mutex);
static LIST_HEAD(rbd_dev_list);
static DEFINE_SPINLOCK(rbd_dev_list_lock);
static LIST_HEAD(rbd_client_list);
static DEFINE_SPINLOCK(rbd_client_list_lock);
static struct kmem_cache *rbd_img_request_cache;
static struct kmem_cache *rbd_obj_request_cache;
static int rbd_major;
static DEFINE_IDA(rbd_dev_id_ida);
static struct workqueue_struct *rbd_wq;
static struct ceph_snap_context rbd_empty_snapc = …;
static bool single_major = …;
module_param(single_major, bool, 0444);
MODULE_PARM_DESC(…) …;
static ssize_t add_store(const struct bus_type *bus, const char *buf, size_t count);
static ssize_t remove_store(const struct bus_type *bus, const char *buf,
size_t count);
static ssize_t add_single_major_store(const struct bus_type *bus, const char *buf,
size_t count);
static ssize_t remove_single_major_store(const struct bus_type *bus, const char *buf,
size_t count);
static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth);
static int rbd_dev_id_to_minor(int dev_id)
{ … }
static int minor_to_rbd_dev_id(int minor)
{ … }
static bool rbd_is_ro(struct rbd_device *rbd_dev)
{ … }
static bool rbd_is_snap(struct rbd_device *rbd_dev)
{ … }
static bool __rbd_is_lock_owner(struct rbd_device *rbd_dev)
{ … }
static bool rbd_is_lock_owner(struct rbd_device *rbd_dev)
{ … }
static ssize_t supported_features_show(const struct bus_type *bus, char *buf)
{ … }
static BUS_ATTR_WO(add);
static BUS_ATTR_WO(remove);
static BUS_ATTR_WO(add_single_major);
static BUS_ATTR_WO(remove_single_major);
static BUS_ATTR_RO(supported_features);
static struct attribute *rbd_bus_attrs[] = …;
static umode_t rbd_bus_is_visible(struct kobject *kobj,
struct attribute *attr, int index)
{ … }
static const struct attribute_group rbd_bus_group = …;
__ATTRIBUTE_GROUPS(…);
static const struct bus_type rbd_bus_type = …;
static void rbd_root_dev_release(struct device *dev)
{ … }
static struct device rbd_root_dev = …;
static __printf(2, 3)
void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
{ … }
#ifdef RBD_DEBUG
#define rbd_assert(expr) …
#else
#define rbd_assert …
#endif
static void rbd_dev_remove_parent(struct rbd_device *rbd_dev);
static int rbd_dev_refresh(struct rbd_device *rbd_dev);
static int rbd_dev_v2_header_onetime(struct rbd_device *rbd_dev,
struct rbd_image_header *header);
static const char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev,
u64 snap_id);
static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
u8 *order, u64 *snap_size);
static int rbd_dev_v2_get_flags(struct rbd_device *rbd_dev);
static void rbd_obj_handle_request(struct rbd_obj_request *obj_req, int result);
static void rbd_img_handle_request(struct rbd_img_request *img_req, int result);
static bool pending_result_dec(struct pending_result *pending, int *result)
{ … }
static int rbd_open(struct gendisk *disk, blk_mode_t mode)
{ … }
static void rbd_release(struct gendisk *disk)
{ … }
static const struct block_device_operations rbd_bd_ops = …;
static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts)
{ … }
static struct rbd_client *__rbd_get_client(struct rbd_client *rbdc)
{ … }
static struct rbd_client *rbd_client_find(struct ceph_options *ceph_opts)
{ … }
enum { … };
enum { … };
static const struct constant_table rbd_param_compression_hint[] = …;
static const struct fs_parameter_spec rbd_parameters[] = …;
struct rbd_options { … };
#define RBD_QUEUE_DEPTH_DEFAULT …
#define RBD_ALLOC_SIZE_DEFAULT …
#define RBD_LOCK_TIMEOUT_DEFAULT …
#define RBD_READ_ONLY_DEFAULT …
#define RBD_LOCK_ON_READ_DEFAULT …
#define RBD_EXCLUSIVE_DEFAULT …
#define RBD_TRIM_DEFAULT …
struct rbd_parse_opts_ctx { … };
static char* obj_op_name(enum obj_operation_type op_type)
{ … }
static void rbd_client_release(struct kref *kref)
{ … }
static void rbd_put_client(struct rbd_client *rbdc)
{ … }
static struct rbd_client *rbd_get_client(struct ceph_options *ceph_opts)
{ … }
static bool rbd_image_format_valid(u32 image_format)
{ … }
static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk)
{ … }
static u32 rbd_obj_bytes(struct rbd_image_header *header)
{ … }
static void rbd_init_layout(struct rbd_device *rbd_dev)
{ … }
static void rbd_image_header_cleanup(struct rbd_image_header *header)
{ … }
static int rbd_header_from_disk(struct rbd_image_header *header,
struct rbd_image_header_ondisk *ondisk,
bool first_time)
{ … }
static const char *_rbd_dev_v1_snap_name(struct rbd_device *rbd_dev, u32 which)
{ … }
static int snapid_compare_reverse(const void *s1, const void *s2)
{ … }
static u32 rbd_dev_snap_index(struct rbd_device *rbd_dev, u64 snap_id)
{ … }
static const char *rbd_dev_v1_snap_name(struct rbd_device *rbd_dev,
u64 snap_id)
{ … }
static const char *rbd_snap_name(struct rbd_device *rbd_dev, u64 snap_id)
{ … }
static int rbd_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
u64 *snap_size)
{ … }
static int rbd_dev_mapping_set(struct rbd_device *rbd_dev)
{ … }
static void rbd_dev_mapping_clear(struct rbd_device *rbd_dev)
{ … }
static void zero_bios(struct ceph_bio_iter *bio_pos, u32 off, u32 bytes)
{ … }
static void zero_bvecs(struct ceph_bvec_iter *bvec_pos, u32 off, u32 bytes)
{ … }
static void rbd_obj_zero_range(struct rbd_obj_request *obj_req, u32 off,
u32 bytes)
{ … }
static void rbd_obj_request_destroy(struct kref *kref);
static void rbd_obj_request_put(struct rbd_obj_request *obj_request)
{ … }
static inline void rbd_img_obj_request_add(struct rbd_img_request *img_request,
struct rbd_obj_request *obj_request)
{ … }
static inline void rbd_img_obj_request_del(struct rbd_img_request *img_request,
struct rbd_obj_request *obj_request)
{ … }
static void rbd_osd_submit(struct ceph_osd_request *osd_req)
{ … }
static void img_request_layered_set(struct rbd_img_request *img_request)
{ … }
static bool img_request_layered_test(struct rbd_img_request *img_request)
{ … }
static bool rbd_obj_is_entire(struct rbd_obj_request *obj_req)
{ … }
static bool rbd_obj_is_tail(struct rbd_obj_request *obj_req)
{ … }
static void rbd_obj_set_copyup_enabled(struct rbd_obj_request *obj_req)
{ … }
static u64 rbd_obj_img_extents_bytes(struct rbd_obj_request *obj_req)
{ … }
static bool rbd_img_is_write(struct rbd_img_request *img_req)
{ … }
static void rbd_osd_req_callback(struct ceph_osd_request *osd_req)
{ … }
static void rbd_osd_format_read(struct ceph_osd_request *osd_req)
{ … }
static void rbd_osd_format_write(struct ceph_osd_request *osd_req)
{ … }
static struct ceph_osd_request *
__rbd_obj_add_osd_request(struct rbd_obj_request *obj_req,
struct ceph_snap_context *snapc, int num_ops)
{ … }
static struct ceph_osd_request *
rbd_obj_add_osd_request(struct rbd_obj_request *obj_req, int num_ops)
{ … }
static struct rbd_obj_request *rbd_obj_request_create(void)
{ … }
static void rbd_obj_request_destroy(struct kref *kref)
{ … }
static void rbd_spec_put(struct rbd_spec *spec);
static void rbd_dev_unparent(struct rbd_device *rbd_dev)
{ … }
static void rbd_dev_parent_put(struct rbd_device *rbd_dev)
{ … }
static bool rbd_dev_parent_get(struct rbd_device *rbd_dev)
{ … }
static void rbd_img_request_init(struct rbd_img_request *img_request,
struct rbd_device *rbd_dev,
enum obj_operation_type op_type)
{ … }
static void rbd_img_capture_header(struct rbd_img_request *img_req)
{ … }
static void rbd_img_request_destroy(struct rbd_img_request *img_request)
{ … }
#define BITS_PER_OBJ …
#define OBJS_PER_BYTE …
#define OBJ_MASK …
static void __rbd_object_map_index(struct rbd_device *rbd_dev, u64 objno,
u64 *index, u8 *shift)
{ … }
static u8 __rbd_object_map_get(struct rbd_device *rbd_dev, u64 objno)
{ … }
static void __rbd_object_map_set(struct rbd_device *rbd_dev, u64 objno, u8 val)
{ … }
static u8 rbd_object_map_get(struct rbd_device *rbd_dev, u64 objno)
{ … }
static bool use_object_map(struct rbd_device *rbd_dev)
{ … }
static bool rbd_object_map_may_exist(struct rbd_device *rbd_dev, u64 objno)
{ … }
static void rbd_object_map_name(struct rbd_device *rbd_dev, u64 snap_id,
struct ceph_object_id *oid)
{ … }
static int rbd_object_map_lock(struct rbd_device *rbd_dev)
{ … }
static void rbd_object_map_unlock(struct rbd_device *rbd_dev)
{ … }
static int decode_object_map_header(void **p, void *end, u64 *object_map_size)
{ … }
static int __rbd_object_map_load(struct rbd_device *rbd_dev)
{ … }
static void rbd_object_map_free(struct rbd_device *rbd_dev)
{ … }
static int rbd_object_map_load(struct rbd_device *rbd_dev)
{ … }
static int rbd_object_map_open(struct rbd_device *rbd_dev)
{ … }
static void rbd_object_map_close(struct rbd_device *rbd_dev)
{ … }
static int rbd_object_map_update_finish(struct rbd_obj_request *obj_req,
struct ceph_osd_request *osd_req)
{ … }
static void rbd_object_map_callback(struct ceph_osd_request *osd_req)
{ … }
static bool update_needed(struct rbd_device *rbd_dev, u64 objno, u8 new_state)
{ … }
static int rbd_cls_object_map_update(struct ceph_osd_request *req,
int which, u64 objno, u8 new_state,
const u8 *current_state)
{ … }
static int rbd_object_map_update(struct rbd_obj_request *obj_req, u64 snap_id,
u8 new_state, const u8 *current_state)
{ … }
static void prune_extents(struct ceph_file_extent *img_extents,
u32 *num_img_extents, u64 overlap)
{ … }
static int rbd_obj_calc_img_extents(struct rbd_obj_request *obj_req,
bool entire)
{ … }
static void rbd_osd_setup_data(struct ceph_osd_request *osd_req, int which)
{ … }
static int rbd_osd_setup_stat(struct ceph_osd_request *osd_req, int which)
{ … }
static int rbd_osd_setup_copyup(struct ceph_osd_request *osd_req, int which,
u32 bytes)
{ … }
static int rbd_obj_init_read(struct rbd_obj_request *obj_req)
{ … }
static void __rbd_osd_setup_write_ops(struct ceph_osd_request *osd_req,
int which)
{ … }
static int rbd_obj_init_write(struct rbd_obj_request *obj_req)
{ … }
static u16 truncate_or_zero_opcode(struct rbd_obj_request *obj_req)
{ … }
static void __rbd_osd_setup_discard_ops(struct ceph_osd_request *osd_req,
int which)
{ … }
static int rbd_obj_init_discard(struct rbd_obj_request *obj_req)
{ … }
static void __rbd_osd_setup_zeroout_ops(struct ceph_osd_request *osd_req,
int which)
{ … }
static int rbd_obj_init_zeroout(struct rbd_obj_request *obj_req)
{ … }
static int count_write_ops(struct rbd_obj_request *obj_req)
{ … }
static void rbd_osd_setup_write_ops(struct ceph_osd_request *osd_req,
int which)
{ … }
static int __rbd_img_fill_request(struct rbd_img_request *img_req)
{ … }
rbd_img_fill_iter;
struct rbd_img_fill_ctx { … };
static struct ceph_object_extent *alloc_object_extent(void *arg)
{ … }
static bool rbd_layout_is_fancy(struct ceph_file_layout *l)
{ … }
static int rbd_img_fill_request_nocopy(struct rbd_img_request *img_req,
struct ceph_file_extent *img_extents,
u32 num_img_extents,
struct rbd_img_fill_ctx *fctx)
{ … }
static int rbd_img_fill_request(struct rbd_img_request *img_req,
struct ceph_file_extent *img_extents,
u32 num_img_extents,
struct rbd_img_fill_ctx *fctx)
{ … }
static int rbd_img_fill_nodata(struct rbd_img_request *img_req,
u64 off, u64 len)
{ … }
static void set_bio_pos(struct ceph_object_extent *ex, u32 bytes, void *arg)
{ … }
static void count_bio_bvecs(struct ceph_object_extent *ex, u32 bytes, void *arg)
{ … }
static void copy_bio_bvecs(struct ceph_object_extent *ex, u32 bytes, void *arg)
{ … }
static int __rbd_img_fill_from_bio(struct rbd_img_request *img_req,
struct ceph_file_extent *img_extents,
u32 num_img_extents,
struct ceph_bio_iter *bio_pos)
{ … }
static int rbd_img_fill_from_bio(struct rbd_img_request *img_req,
u64 off, u64 len, struct bio *bio)
{ … }
static void set_bvec_pos(struct ceph_object_extent *ex, u32 bytes, void *arg)
{ … }
static void count_bvecs(struct ceph_object_extent *ex, u32 bytes, void *arg)
{ … }
static void copy_bvecs(struct ceph_object_extent *ex, u32 bytes, void *arg)
{ … }
static int __rbd_img_fill_from_bvecs(struct rbd_img_request *img_req,
struct ceph_file_extent *img_extents,
u32 num_img_extents,
struct ceph_bvec_iter *bvec_pos)
{ … }
static int rbd_img_fill_from_bvecs(struct rbd_img_request *img_req,
struct ceph_file_extent *img_extents,
u32 num_img_extents,
struct bio_vec *bvecs)
{ … }
static void rbd_img_handle_request_work(struct work_struct *work)
{ … }
static void rbd_img_schedule(struct rbd_img_request *img_req, int result)
{ … }
static bool rbd_obj_may_exist(struct rbd_obj_request *obj_req)
{ … }
static int rbd_obj_read_object(struct rbd_obj_request *obj_req)
{ … }
static int rbd_obj_read_from_parent(struct rbd_obj_request *obj_req)
{ … }
static bool rbd_obj_advance_read(struct rbd_obj_request *obj_req, int *result)
{ … }
static bool rbd_obj_write_is_noop(struct rbd_obj_request *obj_req)
{ … }
static int rbd_obj_write_pre_object_map(struct rbd_obj_request *obj_req)
{ … }
static int rbd_obj_write_object(struct rbd_obj_request *obj_req)
{ … }
static bool is_zero_bvecs(struct bio_vec *bvecs, u32 bytes)
{ … }
#define MODS_ONLY …
static int rbd_obj_copyup_empty_snapc(struct rbd_obj_request *obj_req,
u32 bytes)
{ … }
static int rbd_obj_copyup_current_snapc(struct rbd_obj_request *obj_req,
u32 bytes)
{ … }
static int setup_copyup_bvecs(struct rbd_obj_request *obj_req, u64 obj_overlap)
{ … }
static int rbd_obj_copyup_read_parent(struct rbd_obj_request *obj_req)
{ … }
static void rbd_obj_copyup_object_maps(struct rbd_obj_request *obj_req)
{ … }
static void rbd_obj_copyup_write_object(struct rbd_obj_request *obj_req)
{ … }
static bool rbd_obj_advance_copyup(struct rbd_obj_request *obj_req, int *result)
{ … }
static int rbd_obj_write_post_object_map(struct rbd_obj_request *obj_req)
{ … }
static bool rbd_obj_advance_write(struct rbd_obj_request *obj_req, int *result)
{ … }
static bool __rbd_obj_handle_request(struct rbd_obj_request *obj_req,
int *result)
{ … }
static void rbd_obj_handle_request(struct rbd_obj_request *obj_req, int result)
{ … }
static bool need_exclusive_lock(struct rbd_img_request *img_req)
{ … }
static bool rbd_lock_add_request(struct rbd_img_request *img_req)
{ … }
static void rbd_lock_del_request(struct rbd_img_request *img_req)
{ … }
static int rbd_img_exclusive_lock(struct rbd_img_request *img_req)
{ … }
static void rbd_img_object_requests(struct rbd_img_request *img_req)
{ … }
static bool rbd_img_advance(struct rbd_img_request *img_req, int *result)
{ … }
static bool __rbd_img_handle_request(struct rbd_img_request *img_req,
int *result)
{ … }
static void rbd_img_handle_request(struct rbd_img_request *img_req, int result)
{ … }
static const struct rbd_client_id rbd_empty_cid;
static bool rbd_cid_equal(const struct rbd_client_id *lhs,
const struct rbd_client_id *rhs)
{ … }
static struct rbd_client_id rbd_get_cid(struct rbd_device *rbd_dev)
{ … }
static void rbd_set_owner_cid(struct rbd_device *rbd_dev,
const struct rbd_client_id *cid)
{ … }
static void format_lock_cookie(struct rbd_device *rbd_dev, char *buf)
{ … }
static void __rbd_lock(struct rbd_device *rbd_dev, const char *cookie)
{ … }
static int rbd_lock(struct rbd_device *rbd_dev)
{ … }
static void rbd_unlock(struct rbd_device *rbd_dev)
{ … }
static int __rbd_notify_op_lock(struct rbd_device *rbd_dev,
enum rbd_notify_op notify_op,
struct page ***preply_pages,
size_t *preply_len)
{ … }
static void rbd_notify_op_lock(struct rbd_device *rbd_dev,
enum rbd_notify_op notify_op)
{ … }
static void rbd_notify_acquired_lock(struct work_struct *work)
{ … }
static void rbd_notify_released_lock(struct work_struct *work)
{ … }
static int rbd_request_lock(struct rbd_device *rbd_dev)
{ … }
static void wake_lock_waiters(struct rbd_device *rbd_dev, int result)
{ … }
static bool locker_equal(const struct ceph_locker *lhs,
const struct ceph_locker *rhs)
{ … }
static void free_locker(struct ceph_locker *locker)
{ … }
static struct ceph_locker *get_lock_owner_info(struct rbd_device *rbd_dev)
{ … }
static int find_watcher(struct rbd_device *rbd_dev,
const struct ceph_locker *locker)
{ … }
static int rbd_try_lock(struct rbd_device *rbd_dev)
{ … }
static int rbd_post_acquire_action(struct rbd_device *rbd_dev)
{ … }
static int rbd_try_acquire_lock(struct rbd_device *rbd_dev)
{ … }
static void rbd_acquire_lock(struct work_struct *work)
{ … }
static bool rbd_quiesce_lock(struct rbd_device *rbd_dev)
{ … }
static void rbd_pre_release_action(struct rbd_device *rbd_dev)
{ … }
static void __rbd_release_lock(struct rbd_device *rbd_dev)
{ … }
static void rbd_release_lock(struct rbd_device *rbd_dev)
{ … }
static void rbd_release_lock_work(struct work_struct *work)
{ … }
static void maybe_kick_acquire(struct rbd_device *rbd_dev)
{ … }
static void rbd_handle_acquired_lock(struct rbd_device *rbd_dev, u8 struct_v,
void **p)
{ … }
static void rbd_handle_released_lock(struct rbd_device *rbd_dev, u8 struct_v,
void **p)
{ … }
static int rbd_handle_request_lock(struct rbd_device *rbd_dev, u8 struct_v,
void **p)
{ … }
static void __rbd_acknowledge_notify(struct rbd_device *rbd_dev,
u64 notify_id, u64 cookie, s32 *result)
{ … }
static void rbd_acknowledge_notify(struct rbd_device *rbd_dev, u64 notify_id,
u64 cookie)
{ … }
static void rbd_acknowledge_notify_result(struct rbd_device *rbd_dev,
u64 notify_id, u64 cookie, s32 result)
{ … }
static void rbd_watch_cb(void *arg, u64 notify_id, u64 cookie,
u64 notifier_id, void *data, size_t data_len)
{ … }
static void __rbd_unregister_watch(struct rbd_device *rbd_dev);
static void rbd_watch_errcb(void *arg, u64 cookie, int err)
{ … }
static int __rbd_register_watch(struct rbd_device *rbd_dev)
{ … }
static void __rbd_unregister_watch(struct rbd_device *rbd_dev)
{ … }
static int rbd_register_watch(struct rbd_device *rbd_dev)
{ … }
static void cancel_tasks_sync(struct rbd_device *rbd_dev)
{ … }
static void rbd_unregister_watch(struct rbd_device *rbd_dev)
{ … }
static void rbd_reacquire_lock(struct rbd_device *rbd_dev)
{ … }
static void rbd_reregister_watch(struct work_struct *work)
{ … }
static int rbd_obj_method_sync(struct rbd_device *rbd_dev,
struct ceph_object_id *oid,
struct ceph_object_locator *oloc,
const char *method_name,
const void *outbound,
size_t outbound_size,
void *inbound,
size_t inbound_size)
{ … }
static void rbd_queue_workfn(struct work_struct *work)
{ … }
static blk_status_t rbd_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{ … }
static void rbd_free_disk(struct rbd_device *rbd_dev)
{ … }
static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
struct ceph_object_id *oid,
struct ceph_object_locator *oloc,
void *buf, int buf_len)
{ … }
static int rbd_dev_v1_header_info(struct rbd_device *rbd_dev,
struct rbd_image_header *header,
bool first_time)
{ … }
static void rbd_dev_update_size(struct rbd_device *rbd_dev)
{ … }
static const struct blk_mq_ops rbd_mq_ops = …;
static int rbd_init_disk(struct rbd_device *rbd_dev)
{ … }
static struct rbd_device *dev_to_rbd_dev(struct device *dev)
{ … }
static ssize_t rbd_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_features_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_major_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_minor_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_client_addr_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_client_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_cluster_fsid_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_config_info_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_pool_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_pool_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_pool_ns_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_image_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_snap_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t rbd_snap_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rbd_parent_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t rbd_image_refresh(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t size)
{ … }
static DEVICE_ATTR(size, 0444, rbd_size_show, NULL);
static DEVICE_ATTR(features, 0444, rbd_features_show, NULL);
static DEVICE_ATTR(major, 0444, rbd_major_show, NULL);
static DEVICE_ATTR(minor, 0444, rbd_minor_show, NULL);
static DEVICE_ATTR(client_addr, 0444, rbd_client_addr_show, NULL);
static DEVICE_ATTR(client_id, 0444, rbd_client_id_show, NULL);
static DEVICE_ATTR(cluster_fsid, 0444, rbd_cluster_fsid_show, NULL);
static DEVICE_ATTR(config_info, 0400, rbd_config_info_show, NULL);
static DEVICE_ATTR(pool, 0444, rbd_pool_show, NULL);
static DEVICE_ATTR(pool_id, 0444, rbd_pool_id_show, NULL);
static DEVICE_ATTR(pool_ns, 0444, rbd_pool_ns_show, NULL);
static DEVICE_ATTR(name, 0444, rbd_name_show, NULL);
static DEVICE_ATTR(image_id, 0444, rbd_image_id_show, NULL);
static DEVICE_ATTR(refresh, 0200, NULL, rbd_image_refresh);
static DEVICE_ATTR(current_snap, 0444, rbd_snap_show, NULL);
static DEVICE_ATTR(snap_id, 0444, rbd_snap_id_show, NULL);
static DEVICE_ATTR(parent, 0444, rbd_parent_show, NULL);
static struct attribute *rbd_attrs[] = …;
static struct attribute_group rbd_attr_group = …;
static const struct attribute_group *rbd_attr_groups[] = …;
static void rbd_dev_release(struct device *dev);
static const struct device_type rbd_device_type = …;
static struct rbd_spec *rbd_spec_get(struct rbd_spec *spec)
{ … }
static void rbd_spec_free(struct kref *kref);
static void rbd_spec_put(struct rbd_spec *spec)
{ … }
static struct rbd_spec *rbd_spec_alloc(void)
{ … }
static void rbd_spec_free(struct kref *kref)
{ … }
static void rbd_dev_free(struct rbd_device *rbd_dev)
{ … }
static void rbd_dev_release(struct device *dev)
{ … }
static struct rbd_device *__rbd_dev_create(struct rbd_spec *spec)
{ … }
static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc,
struct rbd_spec *spec,
struct rbd_options *opts)
{ … }
static void rbd_dev_destroy(struct rbd_device *rbd_dev)
{ … }
static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
u8 *order, u64 *snap_size)
{ … }
static int rbd_dev_v2_object_prefix(struct rbd_device *rbd_dev,
char **pobject_prefix)
{ … }
static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
bool read_only, u64 *snap_features)
{ … }
static int rbd_dev_v2_get_flags(struct rbd_device *rbd_dev)
{ … }
struct parent_image_info { … };
static void rbd_parent_info_cleanup(struct parent_image_info *pii)
{ … }
static int decode_parent_image_spec(void **p, void *end,
struct parent_image_info *pii)
{ … }
static int __get_parent_info(struct rbd_device *rbd_dev,
struct page *req_page,
struct page *reply_page,
struct parent_image_info *pii)
{ … }
static int __get_parent_info_legacy(struct rbd_device *rbd_dev,
struct page *req_page,
struct page *reply_page,
struct parent_image_info *pii)
{ … }
static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev,
struct parent_image_info *pii)
{ … }
static int rbd_dev_setup_parent(struct rbd_device *rbd_dev)
{ … }
static int rbd_dev_v2_striping_info(struct rbd_device *rbd_dev,
u64 *stripe_unit, u64 *stripe_count)
{ … }
static int rbd_dev_v2_data_pool(struct rbd_device *rbd_dev, s64 *data_pool_id)
{ … }
static char *rbd_dev_image_name(struct rbd_device *rbd_dev)
{ … }
static u64 rbd_v1_snap_id_by_name(struct rbd_device *rbd_dev, const char *name)
{ … }
static u64 rbd_v2_snap_id_by_name(struct rbd_device *rbd_dev, const char *name)
{ … }
static u64 rbd_snap_id_by_name(struct rbd_device *rbd_dev, const char *name)
{ … }
static int rbd_spec_fill_snap_id(struct rbd_device *rbd_dev)
{ … }
static int rbd_spec_fill_names(struct rbd_device *rbd_dev)
{ … }
static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev,
struct ceph_snap_context **psnapc)
{ … }
static const char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev,
u64 snap_id)
{ … }
static int rbd_dev_v2_header_info(struct rbd_device *rbd_dev,
struct rbd_image_header *header,
bool first_time)
{ … }
static int rbd_dev_header_info(struct rbd_device *rbd_dev,
struct rbd_image_header *header,
bool first_time)
{ … }
static inline size_t next_token(const char **buf)
{ … }
static inline char *dup_token(const char **buf, size_t *lenp)
{ … }
static int rbd_parse_param(struct fs_parameter *param,
struct rbd_parse_opts_ctx *pctx)
{ … }
static int rbd_parse_options(char *options, struct rbd_parse_opts_ctx *pctx)
{ … }
static int rbd_add_parse_args(const char *buf,
struct ceph_options **ceph_opts,
struct rbd_options **opts,
struct rbd_spec **rbd_spec)
{ … }
static void rbd_dev_image_unlock(struct rbd_device *rbd_dev)
{ … }
static int rbd_add_acquire_lock(struct rbd_device *rbd_dev)
{ … }
static int rbd_dev_image_id(struct rbd_device *rbd_dev)
{ … }
static void rbd_dev_unprobe(struct rbd_device *rbd_dev)
{ … }
static int rbd_dev_v2_header_onetime(struct rbd_device *rbd_dev,
struct rbd_image_header *header)
{ … }
static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
{ … }
static void rbd_dev_device_release(struct rbd_device *rbd_dev)
{ … }
static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
{ … }
static int rbd_dev_header_name(struct rbd_device *rbd_dev)
{ … }
static void rbd_print_dne(struct rbd_device *rbd_dev, bool is_snap)
{ … }
static void rbd_dev_image_release(struct rbd_device *rbd_dev)
{ … }
static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
{ … }
static void rbd_dev_update_header(struct rbd_device *rbd_dev,
struct rbd_image_header *header)
{ … }
static void rbd_dev_update_parent(struct rbd_device *rbd_dev,
struct parent_image_info *pii)
{ … }
static int rbd_dev_refresh(struct rbd_device *rbd_dev)
{ … }
static ssize_t do_rbd_add(const char *buf, size_t count)
{ … }
static ssize_t add_store(const struct bus_type *bus, const char *buf, size_t count)
{ … }
static ssize_t add_single_major_store(const struct bus_type *bus, const char *buf,
size_t count)
{ … }
static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
{ … }
static ssize_t do_rbd_remove(const char *buf, size_t count)
{ … }
static ssize_t remove_store(const struct bus_type *bus, const char *buf, size_t count)
{ … }
static ssize_t remove_single_major_store(const struct bus_type *bus, const char *buf,
size_t count)
{ … }
static int __init rbd_sysfs_init(void)
{ … }
static void __exit rbd_sysfs_cleanup(void)
{ … }
static int __init rbd_slab_init(void)
{ … }
static void rbd_slab_exit(void)
{ … }
static int __init rbd_init(void)
{ … }
static void __exit rbd_exit(void)
{ … }
module_init(…) …;
module_exit(rbd_exit);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;