diff options
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 84 |
1 files changed, 2 insertions, 82 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index fa49cff5ee65..dab350dfc376 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -406,7 +406,7 @@ static ssize_t write_threads(struct file *file, char *buf, size_t size) | |||
406 | return rv; | 406 | return rv; |
407 | if (newthreads < 0) | 407 | if (newthreads < 0) |
408 | return -EINVAL; | 408 | return -EINVAL; |
409 | rv = nfsd_svc(NFS_PORT, newthreads); | 409 | rv = nfsd_svc(newthreads); |
410 | if (rv < 0) | 410 | if (rv < 0) |
411 | return rv; | 411 | return rv; |
412 | } else | 412 | } else |
@@ -683,25 +683,6 @@ static ssize_t __write_ports_addfd(char *buf) | |||
683 | } | 683 | } |
684 | 684 | ||
685 | /* | 685 | /* |
686 | * A '-' followed by the 'name' of a socket means we close the socket. | ||
687 | */ | ||
688 | static ssize_t __write_ports_delfd(char *buf) | ||
689 | { | ||
690 | char *toclose; | ||
691 | int len = 0; | ||
692 | |||
693 | toclose = kstrdup(buf + 1, GFP_KERNEL); | ||
694 | if (toclose == NULL) | ||
695 | return -ENOMEM; | ||
696 | |||
697 | if (nfsd_serv != NULL) | ||
698 | len = svc_sock_names(nfsd_serv, buf, | ||
699 | SIMPLE_TRANSACTION_LIMIT, toclose); | ||
700 | kfree(toclose); | ||
701 | return len; | ||
702 | } | ||
703 | |||
704 | /* | ||
705 | * A transport listener is added by writing it's transport name and | 686 | * A transport listener is added by writing it's transport name and |
706 | * a port number. | 687 | * a port number. |
707 | */ | 688 | */ |
@@ -712,7 +693,7 @@ static ssize_t __write_ports_addxprt(char *buf) | |||
712 | int port, err; | 693 | int port, err; |
713 | struct net *net = &init_net; | 694 | struct net *net = &init_net; |
714 | 695 | ||
715 | if (sscanf(buf, "%15s %4u", transport, &port) != 2) | 696 | if (sscanf(buf, "%15s %5u", transport, &port) != 2) |
716 | return -EINVAL; | 697 | return -EINVAL; |
717 | 698 | ||
718 | if (port < 1 || port > USHRT_MAX) | 699 | if (port < 1 || port > USHRT_MAX) |
@@ -746,31 +727,6 @@ out_err: | |||
746 | return err; | 727 | return err; |
747 | } | 728 | } |
748 | 729 | ||
749 | /* | ||
750 | * A transport listener is removed by writing a "-", it's transport | ||
751 | * name, and it's port number. | ||
752 | */ | ||
753 | static ssize_t __write_ports_delxprt(char *buf) | ||
754 | { | ||
755 | struct svc_xprt *xprt; | ||
756 | char transport[16]; | ||
757 | int port; | ||
758 | |||
759 | if (sscanf(&buf[1], "%15s %4u", transport, &port) != 2) | ||
760 | return -EINVAL; | ||
761 | |||
762 | if (port < 1 || port > USHRT_MAX || nfsd_serv == NULL) | ||
763 | return -EINVAL; | ||
764 | |||
765 | xprt = svc_find_xprt(nfsd_serv, transport, &init_net, AF_UNSPEC, port); | ||
766 | if (xprt == NULL) | ||
767 | return -ENOTCONN; | ||
768 | |||
769 | svc_close_xprt(xprt); | ||
770 | svc_xprt_put(xprt); | ||
771 | return 0; | ||
772 | } | ||
773 | |||
774 | static ssize_t __write_ports(struct file *file, char *buf, size_t size) | 730 | static ssize_t __write_ports(struct file *file, char *buf, size_t size) |
775 | { | 731 | { |
776 | if (size == 0) | 732 | if (size == 0) |
@@ -779,15 +735,9 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size) | |||
779 | if (isdigit(buf[0])) | 735 | if (isdigit(buf[0])) |
780 | return __write_ports_addfd(buf); | 736 | return __write_ports_addfd(buf); |
781 | 737 | ||
782 | if (buf[0] == '-' && isdigit(buf[1])) | ||
783 | return __write_ports_delfd(buf); | ||
784 | |||
785 | if (isalpha(buf[0])) | 738 | if (isalpha(buf[0])) |
786 | return __write_ports_addxprt(buf); | 739 | return __write_ports_addxprt(buf); |
787 | 740 | ||
788 | if (buf[0] == '-' && isalpha(buf[1])) | ||
789 | return __write_ports_delxprt(buf); | ||
790 | |||
791 | return -EINVAL; | 741 | return -EINVAL; |
792 | } | 742 | } |
793 | 743 | ||
@@ -825,21 +775,6 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size) | |||
825 | * OR | 775 | * OR |
826 | * | 776 | * |
827 | * Input: | 777 | * Input: |
828 | * buf: C string containing a "-" followed | ||
829 | * by an integer value representing a | ||
830 | * previously passed in socket file | ||
831 | * descriptor | ||
832 | * size: non-zero length of C string in @buf | ||
833 | * Output: | ||
834 | * On success: NFS service no longer listens on that socket; | ||
835 | * passed-in buffer filled with a '\n'-terminated C | ||
836 | * string containing a unique name of the listener; | ||
837 | * return code is the size in bytes of the string | ||
838 | * On error: return code is a negative errno value | ||
839 | * | ||
840 | * OR | ||
841 | * | ||
842 | * Input: | ||
843 | * buf: C string containing a transport | 778 | * buf: C string containing a transport |
844 | * name and an unsigned integer value | 779 | * name and an unsigned integer value |
845 | * representing the port to listen on, | 780 | * representing the port to listen on, |
@@ -848,19 +783,6 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size) | |||
848 | * Output: | 783 | * Output: |
849 | * On success: returns zero; NFS service is started | 784 | * On success: returns zero; NFS service is started |
850 | * On error: return code is a negative errno value | 785 | * On error: return code is a negative errno value |
851 | * | ||
852 | * OR | ||
853 | * | ||
854 | * Input: | ||
855 | * buf: C string containing a "-" followed | ||
856 | * by a transport name and an unsigned | ||
857 | * integer value representing the port | ||
858 | * to listen on, separated by whitespace | ||
859 | * size: non-zero length of C string in @buf | ||
860 | * Output: | ||
861 | * On success: returns zero; NFS service no longer listens | ||
862 | * on that transport | ||
863 | * On error: return code is a negative errno value | ||
864 | */ | 786 | */ |
865 | static ssize_t write_ports(struct file *file, char *buf, size_t size) | 787 | static ssize_t write_ports(struct file *file, char *buf, size_t size) |
866 | { | 788 | { |
@@ -1008,8 +930,6 @@ static ssize_t write_gracetime(struct file *file, char *buf, size_t size) | |||
1008 | return nfsd4_write_time(file, buf, size, &nfsd4_grace); | 930 | return nfsd4_write_time(file, buf, size, &nfsd4_grace); |
1009 | } | 931 | } |
1010 | 932 | ||
1011 | extern char *nfs4_recoverydir(void); | ||
1012 | |||
1013 | static ssize_t __write_recoverydir(struct file *file, char *buf, size_t size) | 933 | static ssize_t __write_recoverydir(struct file *file, char *buf, size_t size) |
1014 | { | 934 | { |
1015 | char *mesg = buf; | 935 | char *mesg = buf; |