linux/drivers/block/aoe/aoedev.c

/* Copyright (c) 2013 Coraid, Inc.  See COPYING for GPL terms. */
/*
 * aoedev.c
 * AoE device utility functions; maintains device list.
 */

#include <linux/hdreg.h>
#include <linux/blk-mq.h>
#include <linux/netdevice.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/bitmap.h>
#include <linux/kdev_t.h>
#include <linux/moduleparam.h>
#include <linux/string.h>
#include "aoe.h"

static void freetgt(struct aoedev *d, struct aoetgt *t);
static void skbpoolfree(struct aoedev *d);

static int aoe_dyndevs =;
module_param(aoe_dyndevs, int, 0644);
MODULE_PARM_DESC();

static struct aoedev *devlist;
static DEFINE_SPINLOCK(devlist_lock);

/* Because some systems will have one, many, or no
 *   - partitions,
 *   - slots per shelf,
 *   - or shelves,
 * we need some flexibility in the way the minor numbers
 * are allocated.  So they are dynamic.
 */
#define N_DEVS

static DEFINE_SPINLOCK(used_minors_lock);
static DECLARE_BITMAP(used_minors, N_DEVS);

static int
minor_get_dyn(ulong *sysminor)
{}

static int
minor_get_static(ulong *sysminor, ulong aoemaj, int aoemin)
{}

static int
minor_get(ulong *sysminor, ulong aoemaj, int aoemin)
{}

static void
minor_free(ulong minor)
{}

/*
 * Users who grab a pointer to the device with aoedev_by_aoeaddr
 * automatically get a reference count and must be responsible
 * for performing a aoedev_put.  With the addition of async
 * kthread processing I'm no longer confident that we can
 * guarantee consistency in the face of device flushes.
 *
 * For the time being, we only bother to add extra references for
 * frames sitting on the iocq.  When the kthreads finish processing
 * these frames, they will aoedev_put the device.
 */

void
aoedev_put(struct aoedev *d)
{}

static void
dummy_timer(struct timer_list *t)
{}

static void
aoe_failip(struct aoedev *d)
{}

static void
downdev_frame(struct list_head *pos)
{}

void
aoedev_downdev(struct aoedev *d)
{}

/* return whether the user asked for this particular
 * device to be flushed
 */
static int
user_req(char *s, size_t slen, struct aoedev *d)
{}

static void
freedev(struct aoedev *d)
{}

enum flush_parms {};

static int
flush(const char __user *str, size_t cnt, int exiting)
{}

int
aoedev_flush(const char __user *str, size_t cnt)
{}

/* This has been confirmed to occur once with Tms=3*1000 due to the
 * driver changing link and not processing its transmit ring.  The
 * problem is hard enough to solve by returning an error that I'm
 * still punting on "solving" this.
 */
static void
skbfree(struct sk_buff *skb)
{}

static void
skbpoolfree(struct aoedev *d)
{}

/* find it or allocate it */
struct aoedev *
aoedev_by_aoeaddr(ulong maj, int min, int do_alloc)
{}

static void
freetgt(struct aoedev *d, struct aoetgt *t)
{}

void
aoedev_exit(void)
{}

int __init
aoedev_init(void)
{}