Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114327
b: refs/heads/master
c: bc48e4d
h: refs/heads/master
i:
  114325: f2c414f
  114323: db354ef
  114319: 3a92718
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Sep 29, 2008
1 parent c8f0805 commit a500b36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ede2fea099cf1dabe41e5b9563558bc7aee82248
refs/heads/master: bc48e4d6371137b1b06e985ea76c1254e9c06e83
32 changes: 11 additions & 21 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ static unsigned long next_gc;
static int nrhosts;
static DEFINE_MUTEX(nlm_host_mutex);


static void nlm_gc_hosts(void);
static struct nsm_handle * __nsm_find(const struct sockaddr_in *,
const char *, unsigned int, int);
static struct nsm_handle * nsm_find(const struct sockaddr_in *sin,
const char *hostname,
unsigned int hostname_len);
static struct nsm_handle *nsm_find(const struct sockaddr_in *sin,
const char *hostname,
const size_t hostname_len,
const int create);

/*
* Hash function must work well on big- and little-endian platforms
Expand Down Expand Up @@ -187,7 +185,7 @@ static struct nlm_host *nlm_lookup_host(int server,
atomic_inc(&nsm->sm_count);
else {
host = NULL;
nsm = nsm_find(sin, hostname, hostname_len);
nsm = nsm_find(sin, hostname, hostname_len, 1);
if (!nsm) {
dprintk("lockd: nlm_lookup_host failed; "
"no nsm handle\n");
Expand Down Expand Up @@ -419,8 +417,7 @@ void nlm_host_rebooted(const struct sockaddr_in *sin,
struct nsm_handle *nsm;
struct nlm_host *host;

/* Find the NSM handle for this peer */
nsm = __nsm_find(sin, hostname, hostname_len, 0);
nsm = nsm_find(sin, hostname, hostname_len, 0);
if (nsm == NULL) {
dprintk("lockd: never saw rebooted peer '%.*s' before\n",
hostname_len, hostname);
Expand Down Expand Up @@ -560,10 +557,10 @@ nlm_gc_hosts(void)
static LIST_HEAD(nsm_handles);
static DEFINE_SPINLOCK(nsm_lock);

static struct nsm_handle *
__nsm_find(const struct sockaddr_in *sin,
const char *hostname, unsigned int hostname_len,
int create)
static struct nsm_handle *nsm_find(const struct sockaddr_in *sin,
const char *hostname,
const size_t hostname_len,
const int create)
{
struct nsm_handle *nsm = NULL;
struct nsm_handle *pos;
Expand All @@ -575,7 +572,7 @@ __nsm_find(const struct sockaddr_in *sin,
if (printk_ratelimit()) {
printk(KERN_WARNING "Invalid hostname \"%.*s\" "
"in NFS lock request\n",
hostname_len, hostname);
(int)hostname_len, hostname);
}
return NULL;
}
Expand Down Expand Up @@ -623,13 +620,6 @@ __nsm_find(const struct sockaddr_in *sin,
return nsm;
}

static struct nsm_handle *
nsm_find(const struct sockaddr_in *sin, const char *hostname,
unsigned int hostname_len)
{
return __nsm_find(sin, hostname, hostname_len, 1);
}

/*
* Release an NSM handle
*/
Expand Down

0 comments on commit a500b36

Please sign in to comment.