Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
host.c File Reference
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
#include <linux/lockd/lockd.h>
#include <linux/mutex.h>
#include <linux/sunrpc/svc_xprt.h>
#include <net/ipv6.h>
#include "netns.h"

Go to the source code of this file.

Data Structures

struct  nlm_lookup_host_info
 

Macros

#define NLMDBG_FACILITY   NLMDBG_HOSTCACHE
 
#define NLM_HOST_NRHASH   32
 
#define NLM_HOST_REBIND   (60 * HZ)
 
#define NLM_HOST_EXPIRE   (300 * HZ)
 
#define NLM_HOST_COLLECT   (120 * HZ)
 
#define for_each_host(host, pos, chain, table)
 
#define for_each_host_safe(host, pos, next, chain, table)
 

Functions

struct nlm_host * nlmclnt_lookup_host (const struct sockaddr *sap, const size_t salen, const unsigned short protocol, const u32 version, const char *hostname, int noresvport, struct net *net)
 
void nlmclnt_release_host (struct nlm_host *host)
 
struct nlm_host * nlmsvc_lookup_host (const struct svc_rqst *rqstp, const char *hostname, const size_t hostname_len)
 
void nlmsvc_release_host (struct nlm_host *host)
 
struct rpc_clntnlm_bind_host (struct nlm_host *host)
 
void nlm_rebind_host (struct nlm_host *host)
 
struct nlm_host * nlm_get_host (struct nlm_host *host)
 
void nlm_host_rebooted (const struct nlm_reboot *info)
 
void nlm_shutdown_hosts_net (struct net *net)
 
void nlm_shutdown_hosts (void)
 

Macro Definition Documentation

#define for_each_host (   host,
  pos,
  chain,
  table 
)
Value:
for ((chain) = (table); \
(chain) < (table) + NLM_HOST_NRHASH; ++(chain)) \
hlist_for_each_entry((host), (pos), (chain), h_hash)

Definition at line 35 of file host.c.

#define for_each_host_safe (   host,
  pos,
  next,
  chain,
  table 
)
Value:
for ((chain) = (table); \
(chain) < (table) + NLM_HOST_NRHASH; ++(chain)) \
hlist_for_each_entry_safe((host), (pos), (next), \
(chain), h_hash)

Definition at line 40 of file host.c.

#define NLM_HOST_COLLECT   (120 * HZ)

Definition at line 30 of file host.c.

#define NLM_HOST_EXPIRE   (300 * HZ)

Definition at line 29 of file host.c.

#define NLM_HOST_NRHASH   32

Definition at line 27 of file host.c.

#define NLM_HOST_REBIND   (60 * HZ)

Definition at line 28 of file host.c.

#define NLMDBG_FACILITY   NLMDBG_HOSTCACHE

Definition at line 26 of file host.c.

Function Documentation

struct rpc_clnt* nlm_bind_host ( struct nlm_host *  host)
read

Definition at line 424 of file host.c.

struct nlm_host* nlm_get_host ( struct nlm_host *  host)
read

Definition at line 507 of file host.c.

void nlm_host_rebooted ( const struct nlm_reboot info)

nlm_host_rebooted - Release all resources held by rebooted host : pointer to decoded results of NLM_SM_NOTIFY call

We were notified that the specified host has rebooted. Release all resources held by that peer.

Definition at line 549 of file host.c.

void nlm_rebind_host ( struct nlm_host *  host)

Definition at line 495 of file host.c.

void nlm_shutdown_hosts ( void  )

Definition at line 637 of file host.c.

void nlm_shutdown_hosts_net ( struct net net)

Definition at line 605 of file host.c.

struct nlm_host* nlmclnt_lookup_host ( const struct sockaddr sap,
const size_t  salen,
const unsigned short  protocol,
const u32  version,
const char hostname,
int  noresvport,
struct net net 
)
read

Definition at line 211 of file host.c.

void nlmclnt_release_host ( struct nlm_host *  host)

nlmclnt_release_host - release client nlm_host : nlm_host to release

Definition at line 285 of file host.c.

struct nlm_host* nlmsvc_lookup_host ( const struct svc_rqst rqstp,
const char hostname,
const size_t  hostname_len 
)
read

nlmsvc_lookup_host - Find an NLM host handle matching a remote client : incoming NLM request : name of client host : length of client hostname

Returns an nlm_host structure that matches the [client address, transport protocol, NLM version, client hostname] of the passed-in NLM request. If one doesn't already exist in the host cache, a new handle is created and returned.

Before possibly creating a new nlm_host, construct a sockaddr for a specific source address in case the local system has multiple network addresses. The family of the address in rq_daddr is guaranteed to be the same as the family of the address in rq_addr, so it's safe to use the same family for the source address.

Definition at line 324 of file host.c.

void nlmsvc_release_host ( struct nlm_host *  host)

nlmsvc_release_host - release server nlm_host : nlm_host to release

Host is destroyed later in nlm_gc_host().

Definition at line 408 of file host.c.