linux/drivers/block/rnbd/rnbd-srv.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * RDMA Network Block Driver
 *
 * Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights reserved.
 * Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights reserved.
 * Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved.
 */
#ifndef RNBD_SRV_H
#define RNBD_SRV_H

#include <linux/types.h>
#include <linux/idr.h>
#include <linux/kref.h>

#include <rtrs.h>
#include "rnbd-proto.h"
#include "rnbd-log.h"

struct rnbd_srv_session {};

struct rnbd_srv_dev {};

/* Structure which binds N devices and N sessions */
struct rnbd_srv_sess_dev {};

void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev,
				   struct kobj_attribute *attr);
/* rnbd-srv-sysfs.c */

int rnbd_srv_create_dev_sysfs(struct rnbd_srv_dev *dev,
			      struct block_device *bdev);
void rnbd_srv_destroy_dev_sysfs(struct rnbd_srv_dev *dev);
int rnbd_srv_create_dev_session_sysfs(struct rnbd_srv_sess_dev *sess_dev);
void rnbd_srv_destroy_dev_session_sysfs(struct rnbd_srv_sess_dev *sess_dev);
int rnbd_srv_create_sysfs_files(void);
void rnbd_srv_destroy_sysfs_files(void);
void rnbd_destroy_sess_dev(struct rnbd_srv_sess_dev *sess_dev, bool keep_id);

#endif /* RNBD_SRV_H */