Codebase list tcmu / upstream/1.5.2 libtcmu_priv.h
upstream/1.5.2

Tree @upstream/1.5.2 (Download .tar.gz)

libtcmu_priv.h @upstream/1.5.2

30aa21a
33419b7
30aa21a
33419b7
 
 
 
30aa21a
 
 
 
 
 
 
 
 
 
 
a386ae8
b977779
30aa21a
 
 
 
 
cd7782a
 
30aa21a
 
 
 
 
 
 
a386ae8
30aa21a
 
 
 
b977779
30aa21a
 
b977779
244afa8
 
c8b0183
 
a2eb27b
4ec965e
271b0b9
9bff3c9
3764f24
9d5cad5
9fb4ce8
64f591f
 
a2eb27b
c8b0183
30aa21a
 
 
9a9e5a4
30aa21a
 
8d49d95
30aa21a
 
 
 
 
/*
 * Copyright (c) 2014 Red Hat, Inc.
 *
 * This file is licensed to you under your choice of the GNU Lesser
 * General Public License, version 2.1 or any later version (LGPLv2.1 or
 * later), or the Apache License 2.0.
 */

/*
 * This header defines structures private to libtcmu, and should not
 * be used by anyone else.
 */

#ifndef __LIBTCMU_PRIV_H
#define __LIBTCMU_PRIV_H

#include <stdbool.h>
#include <stdint.h>
#include <gio/gio.h>
#include <pthread.h>

#include "darray.h"

#define KERN_IFACE_VER 2

// The full (private) declaration
struct tcmulib_context {
	darray(struct tcmulib_handler) handlers;

	/* Just keep ptrs b/c we hand these to clients */
	darray(struct tcmu_device*) devices;

	struct nl_sock *nl_sock;

	GDBusConnection *connection;
};

struct tcmu_device {
	int fd;

	struct tcmu_mailbox *map;
	size_t map_len;

	uint32_t cmd_tail;

	uint64_t num_lbas;
	uint32_t block_size;
	uint32_t block_size_shift;
	uint32_t max_xfer_len;
	uint32_t opt_xcopy_rw_len;
	bool split_unmaps;
	uint32_t max_unmap_len;
	uint32_t opt_unmap_gran;
	uint32_t unmap_gran_align;
	unsigned int write_cache_enabled:1;
	unsigned int solid_state_media:1;
	unsigned int unmap_enabled:1;

	char dev_name[16]; /* e.g. "uio14" */
	char tcm_hba_name[16]; /* e.g. "user_8" */
	char tcm_dev_name[128]; /* e.g. "backup2" */
	char cfgstring[PATH_MAX];

	struct tcmulib_handler *handler;
	struct tcmulib_context *ctx;

	void *hm_private; /* private ptr for handler module */
};

#endif