147272813e
Define and create server-level cache index objects (as managed by nfs_client structs). Each server object is created in the NFS top-level index object and is itself an index into which superblock-level objects are inserted. Ideally there would be one superblock-level object per server, and the former would be folded into the latter; however, since the "nosharecache" option exists this isn't possible. The server object key is a sequence consisting of: (1) NFS version (2) Server address family (eg: AF_INET or AF_INET6) (3) Server port. (4) Server IP address. The key blob is of variable length, depending on the length of (4). The server object is given no coherency data to carry in the auxiliary data permitted by the cache. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
/* NFS filesystem cache interface definitions
|
|
*
|
|
* Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public Licence
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the Licence, or (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef _NFS_FSCACHE_H
|
|
#define _NFS_FSCACHE_H
|
|
|
|
#include <linux/nfs_fs.h>
|
|
#include <linux/nfs_mount.h>
|
|
#include <linux/nfs4_mount.h>
|
|
#include <linux/fscache.h>
|
|
|
|
#ifdef CONFIG_NFS_FSCACHE
|
|
|
|
/*
|
|
* fscache-index.c
|
|
*/
|
|
extern struct fscache_netfs nfs_fscache_netfs;
|
|
extern const struct fscache_cookie_def nfs_fscache_server_index_def;
|
|
|
|
extern int nfs_fscache_register(void);
|
|
extern void nfs_fscache_unregister(void);
|
|
|
|
/*
|
|
* fscache.c
|
|
*/
|
|
extern void nfs_fscache_get_client_cookie(struct nfs_client *);
|
|
extern void nfs_fscache_release_client_cookie(struct nfs_client *);
|
|
|
|
#else /* CONFIG_NFS_FSCACHE */
|
|
static inline int nfs_fscache_register(void) { return 0; }
|
|
static inline void nfs_fscache_unregister(void) {}
|
|
|
|
static inline void nfs_fscache_get_client_cookie(struct nfs_client *clp) {}
|
|
static inline void nfs_fscache_release_client_cookie(struct nfs_client *clp) {}
|
|
|
|
#endif /* CONFIG_NFS_FSCACHE */
|
|
#endif /* _NFS_FSCACHE_H */
|