|
@@ -682,25 +682,6 @@ static ssize_t __write_ports_addfd(char *buf)
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * 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(nfsd_serv, buf,
|
|
|
- SIMPLE_TRANSACTION_LIMIT, toclose);
|
|
|
- kfree(toclose);
|
|
|
- return len;
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* A transport listener is added by writing it's transport name and
|
|
|
* a port number.
|
|
@@ -746,31 +727,6 @@ out_err:
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * A transport listener is removed by writing a "-", it's transport
|
|
|
- * name, and it's port number.
|
|
|
- */
|
|
|
-static ssize_t __write_ports_delxprt(char *buf)
|
|
|
-{
|
|
|
- struct svc_xprt *xprt;
|
|
|
- char transport[16];
|
|
|
- int port;
|
|
|
-
|
|
|
- if (sscanf(&buf[1], "%15s %4u", transport, &port) != 2)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- if (port < 1 || port > USHRT_MAX || nfsd_serv == NULL)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- xprt = svc_find_xprt(nfsd_serv, transport, &init_net, AF_UNSPEC, port);
|
|
|
- if (xprt == NULL)
|
|
|
- return -ENOTCONN;
|
|
|
-
|
|
|
- svc_close_xprt(xprt);
|
|
|
- svc_xprt_put(xprt);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
static ssize_t __write_ports(struct file *file, char *buf, size_t size)
|
|
|
{
|
|
|
if (size == 0)
|
|
@@ -779,15 +735,9 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size)
|
|
|
if (isdigit(buf[0]))
|
|
|
return __write_ports_addfd(buf);
|
|
|
|
|
|
- if (buf[0] == '-' && isdigit(buf[1]))
|
|
|
- return __write_ports_delfd(buf);
|
|
|
-
|
|
|
if (isalpha(buf[0]))
|
|
|
return __write_ports_addxprt(buf);
|
|
|
|
|
|
- if (buf[0] == '-' && isalpha(buf[1]))
|
|
|
- return __write_ports_delxprt(buf);
|
|
|
-
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
@@ -825,21 +775,6 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size)
|
|
|
* OR
|
|
|
*
|
|
|
* Input:
|
|
|
- * buf: C string containing a "-" followed
|
|
|
- * by an integer value representing a
|
|
|
- * previously passed in socket file
|
|
|
- * descriptor
|
|
|
- * size: non-zero length of C string in @buf
|
|
|
- * Output:
|
|
|
- * On success: NFS service no longer listens on that socket;
|
|
|
- * passed-in buffer filled with a '\n'-terminated C
|
|
|
- * string containing a unique name of the listener;
|
|
|
- * return code is the size in bytes of the string
|
|
|
- * On error: return code is a negative errno value
|
|
|
- *
|
|
|
- * OR
|
|
|
- *
|
|
|
- * Input:
|
|
|
* buf: C string containing a transport
|
|
|
* name and an unsigned integer value
|
|
|
* representing the port to listen on,
|
|
@@ -848,19 +783,6 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size)
|
|
|
* Output:
|
|
|
* On success: returns zero; NFS service is started
|
|
|
* On error: return code is a negative errno value
|
|
|
- *
|
|
|
- * OR
|
|
|
- *
|
|
|
- * Input:
|
|
|
- * buf: C string containing a "-" followed
|
|
|
- * by a transport name and an unsigned
|
|
|
- * integer value representing the port
|
|
|
- * to listen on, separated by whitespace
|
|
|
- * size: non-zero length of C string in @buf
|
|
|
- * Output:
|
|
|
- * On success: returns zero; NFS service no longer listens
|
|
|
- * on that transport
|
|
|
- * On error: return code is a negative errno value
|
|
|
*/
|
|
|
static ssize_t write_ports(struct file *file, char *buf, size_t size)
|
|
|
{
|