linux/fs/nfs/pnfs_dev.c

/*
 *  Device operations for the pnfs client.
 *
 *  Copyright (c) 2002
 *  The Regents of the University of Michigan
 *  All Rights Reserved
 *
 *  Dean Hildebrand <[email protected]>
 *  Garth Goodson   <[email protected]>
 *
 *  Permission is granted to use, copy, create derivative works, and
 *  redistribute this software and such derivative works for any purpose,
 *  so long as the name of the University of Michigan is not used in
 *  any advertising or publicity pertaining to the use or distribution
 *  of this software without specific, written prior authorization. If
 *  the above copyright notice or any other identification of the
 *  University of Michigan is included in any copy of any portion of
 *  this software, then the disclaimer below must also be included.
 *
 *  This software is provided as is, without representation or warranty
 *  of any kind either express or implied, including without limitation
 *  the implied warranties of merchantability, fitness for a particular
 *  purpose, or noninfringement.  The Regents of the University of
 *  Michigan shall not be liable for any damages, including special,
 *  indirect, incidental, or consequential damages, with respect to any
 *  claim arising out of or in connection with the use of the software,
 *  even if it has been or is hereafter advised of the possibility of
 *  such damages.
 */

#include <linux/export.h>
#include <linux/nfs_fs.h>
#include "nfs4session.h"
#include "internal.h"
#include "pnfs.h"

#include "nfs4trace.h"

#define NFSDBG_FACILITY

/*
 * Device ID RCU cache. A device ID is unique per server and layout type.
 */
#define NFS4_DEVICE_ID_HASH_BITS
#define NFS4_DEVICE_ID_HASH_SIZE
#define NFS4_DEVICE_ID_HASH_MASK


static struct hlist_head nfs4_deviceid_cache[NFS4_DEVICE_ID_HASH_SIZE];
static DEFINE_SPINLOCK(nfs4_deviceid_lock);

#ifdef NFS_DEBUG
void
nfs4_print_deviceid(const struct nfs4_deviceid *id)
{}
EXPORT_SYMBOL_GPL();
#endif

static inline u32
nfs4_deviceid_hash(const struct nfs4_deviceid *id)
{}

static struct nfs4_deviceid_node *
_lookup_deviceid(const struct pnfs_layoutdriver_type *ld,
		 const struct nfs_client *clp, const struct nfs4_deviceid *id,
		 long hash)
{}

static struct nfs4_deviceid_node *
nfs4_get_device_info(struct nfs_server *server,
		const struct nfs4_deviceid *dev_id,
		const struct cred *cred, gfp_t gfp_flags)
{}

/*
 * Lookup a deviceid in cache and get a reference count on it if found
 *
 * @clp nfs_client associated with deviceid
 * @id deviceid to look up
 */
static struct nfs4_deviceid_node *
__nfs4_find_get_deviceid(struct nfs_server *server,
		const struct nfs4_deviceid *id, long hash)
{}

struct nfs4_deviceid_node *
nfs4_find_get_deviceid(struct nfs_server *server,
		const struct nfs4_deviceid *id, const struct cred *cred,
		gfp_t gfp_mask)
{}
EXPORT_SYMBOL_GPL();

/*
 * Remove a deviceid from cache
 *
 * @clp nfs_client associated with deviceid
 * @id the deviceid to unhash
 *
 * @ret the unhashed node, if found and dereferenced to zero, NULL otherwise.
 */
void
nfs4_delete_deviceid(const struct pnfs_layoutdriver_type *ld,
			 const struct nfs_client *clp, const struct nfs4_deviceid *id)
{}
EXPORT_SYMBOL_GPL();

void
nfs4_init_deviceid_node(struct nfs4_deviceid_node *d, struct nfs_server *server,
			const struct nfs4_deviceid *id)
{}
EXPORT_SYMBOL_GPL();

/*
 * Dereference a deviceid node and delete it when its reference count drops
 * to zero.
 *
 * @d deviceid node to put
 *
 * return true iff the node was deleted
 * Note that since the test for d->ref == 0 is sufficient to establish
 * that the node is no longer hashed in the global device id cache.
 */
bool
nfs4_put_deviceid_node(struct nfs4_deviceid_node *d)
{}
EXPORT_SYMBOL_GPL();

void
nfs4_mark_deviceid_available(struct nfs4_deviceid_node *node)
{}
EXPORT_SYMBOL_GPL();

void
nfs4_mark_deviceid_unavailable(struct nfs4_deviceid_node *node)
{}
EXPORT_SYMBOL_GPL();

bool
nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node)
{}
EXPORT_SYMBOL_GPL();

static void
_deviceid_purge_client(const struct nfs_client *clp, long hash)
{}

void
nfs4_deviceid_purge_client(const struct nfs_client *clp)
{}

/*
 * Stop use of all deviceids associated with an nfs_client
 */
void
nfs4_deviceid_mark_client_invalid(struct nfs_client *clp)
{}