Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127468
b: refs/heads/master
c: 92fd91b
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Jan 6, 2009
1 parent 312d989 commit ba70125
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 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: 8c7378fd2a5f22016542931b887a2ae98d146eaf
refs/heads/master: 92fd91b998a5216a6d6606704e71d541a180216c
4 changes: 2 additions & 2 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
atomic_inc(&nsm->sm_count);
else {
host = NULL;
nsm = nsm_find(ni->sap, ni->salen,
ni->hostname, ni->hostname_len, 1);
nsm = nsm_get_handle(ni->sap, ni->salen,
ni->hostname, ni->hostname_len);
if (!nsm) {
dprintk("lockd: nlm_lookup_host failed; "
"no nsm handle\n");
Expand Down
23 changes: 9 additions & 14 deletions trunk/fs/lockd/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,24 +240,22 @@ static void nsm_init_private(struct nsm_handle *nsm)
}

/**
* nsm_find - Find or create a cached nsm_handle
* nsm_get_handle - Find or create a cached nsm_handle
* @sap: pointer to socket address of handle to find
* @salen: length of socket address
* @hostname: pointer to C string containing hostname to find
* @hostname_len: length of C string
* @create: one means create new handle if not found in cache
*
* Behavior is modulated by the global nsm_use_hostnames variable
* and by the @create argument.
* Behavior is modulated by the global nsm_use_hostnames variable.
*
* Returns a cached nsm_handle after bumping its ref count, or if
* @create is set, returns a fresh nsm_handle if a handle that
* matches @sap and/or @hostname cannot be found in the handle cache.
* Returns NULL if an error occurs.
* Returns a cached nsm_handle after bumping its ref count, or
* returns a fresh nsm_handle if a handle that matches @sap and/or
* @hostname cannot be found in the handle cache. Returns NULL if
* an error occurs.
*/
struct nsm_handle *nsm_find(const struct sockaddr *sap, const size_t salen,
const char *hostname, const size_t hostname_len,
const int create)
struct nsm_handle *nsm_get_handle(const struct sockaddr *sap,
const size_t salen, const char *hostname,
const size_t hostname_len)
{
struct nsm_handle *nsm = NULL;
struct nsm_handle *pos;
Expand Down Expand Up @@ -297,9 +295,6 @@ struct nsm_handle *nsm_find(const struct sockaddr *sap, const size_t salen,
}
spin_unlock(&nsm_lock);

if (!create)
return NULL;

nsm = kzalloc(sizeof(*nsm) + hostname_len + 1, GFP_KERNEL);
if (nsm == NULL)
return NULL;
Expand Down
6 changes: 3 additions & 3 deletions trunk/include/linux/lockd/lockd.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ void nlm_host_rebooted(const struct nlm_reboot *);
int nsm_monitor(const struct nlm_host *host);
void nsm_unmonitor(const struct nlm_host *host);

struct nsm_handle *nsm_find(const struct sockaddr *sap, const size_t salen,
struct nsm_handle *nsm_get_handle(const struct sockaddr *sap,
const size_t salen,
const char *hostname,
const size_t hostname_len,
const int create);
const size_t hostname_len);
struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info);
void nsm_release(struct nsm_handle *nsm);

Expand Down

0 comments on commit ba70125

Please sign in to comment.