Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153653
b: refs/heads/master
c: 82d5659
h: refs/heads/master
i:
  153651: 48d974a
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Apr 28, 2009
1 parent 87cd26a commit c1208cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 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: 4eb68c266cb1754ffa0040e882882680ece8cf34
refs/heads/master: 82d565919aa4138bc481a7473491b71385af4018
36 changes: 24 additions & 12 deletions trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,27 @@ static ssize_t write_versions(struct file *file, char *buf, size_t size)
return rv;
}

/*
* A '-' followed by the 'name' of a socket means we close the socket.
*/
static ssize_t __write_ports_delfd(char *buf)
{
char *toclose;
int len = 0;

toclose = kstrdup(buf + 1, GFP_KERNEL);
if (toclose == NULL)
return -ENOMEM;

if (nfsd_serv != NULL)
len = svc_sock_names(buf, nfsd_serv, toclose);
if (len >= 0)
lockd_down();

kfree(toclose);
return len;
}

/*
* A transport listener is added by writing it's transport name and
* a port number.
Expand Down Expand Up @@ -1004,18 +1025,9 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size)
}
return err < 0 ? err : 0;
}
if (buf[0] == '-' && isdigit(buf[1])) {
char *toclose = kstrdup(buf+1, GFP_KERNEL);
int len = 0;
if (!toclose)
return -ENOMEM;
if (nfsd_serv)
len = svc_sock_names(buf, nfsd_serv, toclose);
if (len >= 0)
lockd_down();
kfree(toclose);
return len;
}

if (buf[0] == '-' && isdigit(buf[1]))
return __write_ports_delfd(buf);

if (isalpha(buf[0]))
return __write_ports_addxprt(buf);
Expand Down

0 comments on commit c1208cb

Please sign in to comment.