Lines Matching +full:non +full:- +full:negative

1 // SPDX-License-Identifier: GPL-2.0-only
100 ino_t ino = file_inode(file)->i_ino; in nfsctl_transaction_write()
105 return -EINVAL; in nfsctl_transaction_write()
121 if (! file->private_data) { in nfsctl_transaction_read()
123 * causes a 0-byte write so that the file can return in nfsctl_transaction_read()
150 seq = file->private_data; in exports_net_open()
151 seq->private = nn->svc_export_cache; in exports_net_open()
157 return exports_net_open(inode->i_sb->s_fs_info, file); in exports_nfsd_open()
177 struct nfsd_net *nn = net_generic(inode->i_sb->s_fs_info, nfsd_net_id); in nfsd_pool_stats_open()
179 return svc_pool_stats_open(&nn->nfsd_info, file); in nfsd_pool_stats_open()
193 /*----------------------------------------------------------------------------*/
195 * payload - write methods
200 return file_inode(file)->i_sb->s_fs_info; in netns()
204 * write_unlock_ip - Release all locks used by a client
209 * buf: '\n'-terminated C string containing a
215 * On error: return code is negative errno value
227 return -EINVAL; in write_unlock_ip()
229 if (buf[size-1] != '\n') in write_unlock_ip()
230 return -EINVAL; in write_unlock_ip()
234 return -EINVAL; in write_unlock_ip()
237 return -EINVAL; in write_unlock_ip()
244 * write_unlock_fs - Release all locks on a local file system
249 * buf: '\n'-terminated C string containing the
255 * On error: return code is negative errno value
265 return -EINVAL; in write_unlock_fs()
267 if (buf[size-1] != '\n') in write_unlock_fs()
268 return -EINVAL; in write_unlock_fs()
272 return -EINVAL; in write_unlock_fs()
287 error = nlmsvc_unlock_all_by_sb(path.dentry->d_sb); in write_unlock_fs()
288 nfsd4_revoke_states(netns(file), path.dentry->d_sb); in write_unlock_fs()
295 * write_filehandle - Get a variable-length NFS file handle by path
297 * On input, the buffer contains a '\n'-terminated C string comprised of
309 * On success: passed-in buffer filled with '\n'-terminated C
313 * On error: return code is negative errno value
325 return -EINVAL; in write_filehandle()
327 if (buf[size-1] != '\n') in write_filehandle()
328 return -EINVAL; in write_filehandle()
329 buf[size-1] = 0; in write_filehandle()
334 return -EINVAL; in write_filehandle()
339 return -EINVAL; in write_filehandle()
346 return -EINVAL; in write_filehandle()
350 return -EINVAL; in write_filehandle()
357 return -ENOMEM; in write_filehandle()
367 mesg[-1] = '\n'; in write_filehandle()
368 return mesg - buf; in write_filehandle()
372 * write_threads - Start NFSD, or report the current number of running threads
378 * On success: passed-in buffer filled with '\n'-terminated C
390 * size: non-zero length of C string in @buf
393 * passed-in buffer filled with '\n'-terminated C
397 * On error: return code is zero or a negative errno value
411 return -EINVAL; in write_threads()
414 rv = nfsd_svc(1, &newthreads, net, file->f_cred, NULL); in write_threads()
425 * write_pool_threads - Set or report the current number of threads per pool
434 * buf: C string containing whitespace-
438 * size: non-zero length of C string in @buf
440 * On success: passed-in buffer filled with '\n'-terminated C
444 * On error: return code is zero or a negative errno value
473 rv = -ENOMEM; in write_pool_threads()
480 if (rv == -ENOENT) in write_pool_threads()
484 rv = -EINVAL; in write_pool_threads()
509 snprintf(mesg, size, "%d%c", nthreads[i], (i == npools-1 ? '\n' : ' ')); in write_pool_threads()
511 size -= len; in write_pool_threads()
514 rv = mesg - buf; in write_pool_threads()
535 * +4, unless -4.0 is present. in nfsd_print_version_support()
539 supported ? '+' : '-', vers, minor); in nfsd_print_version_support()
552 if (nn->nfsd_serv) in __write_versions()
554 * nn->nfsd_serv->sv_xdrsize, and reallocing in __write_versions()
557 return -EBUSY; in __write_versions()
558 if (buf[size-1] != '\n') in __write_versions()
559 return -EINVAL; in __write_versions()
560 buf[size-1] = 0; in __write_versions()
565 if (len <= 0) return -EINVAL; in __write_versions()
570 if (sign == '+' || sign == '-') in __write_versions()
576 return -EINVAL; in __write_versions()
578 return -EINVAL; in __write_versions()
581 cmd = sign == '-' ? NFSD_CLEAR : NFSD_SET; in __write_versions()
592 return -EINVAL; in __write_versions()
596 * or we have -4 and at least one minor is enabled. in __write_versions()
605 /* Ignore requests to disable non-existent versions */ in __write_versions()
607 return -EINVAL; in __write_versions()
625 minor = -1; in __write_versions()
631 remaining -= len; in __write_versions()
642 return -EINVAL; in __write_versions()
647 * write_versions - Set or report the available NFS protocol versions
653 * On success: passed-in buffer filled with '\n'-terminated C
654 * string containing positive or negative integer
658 * On error: return code is zero or a negative errno value
663 * buf: C string containing whitespace-
664 * separated positive or negative
667 * or disable ("-n")
668 * size: non-zero length of C string in @buf
671 * been updated; passed-in buffer filled with
672 * '\n'-terminated C string containing positive
673 * or negative integer values representing the
676 * On error: return code is zero or a negative errno value
689 * Zero-length write. Return a list of NFSD's current listener
696 if (nn->nfsd_serv == NULL) in __write_ports_names()
698 return svc_xprt_names(nn->nfsd_serv, buf, SIMPLE_TRANSACTION_LIMIT); in __write_ports_names()
715 return -EINVAL; in __write_ports_addfd()
722 serv = nn->nfsd_serv; in __write_ports_addfd()
725 if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks)) in __write_ports_addfd()
744 return -EINVAL; in __write_ports_addxprt()
747 return -EINVAL; in __write_ports_addxprt()
754 serv = nn->nfsd_serv; in __write_ports_addxprt()
762 if (err < 0 && err != -EAFNOSUPPORT) in __write_ports_addxprt()
773 if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks)) in __write_ports_addxprt()
786 return __write_ports_addfd(buf, net, file->f_cred); in __write_ports()
789 return __write_ports_addxprt(buf, net, file->f_cred); in __write_ports()
791 return -EINVAL; in __write_ports()
795 * write_ports - Pass a socket file descriptor or transport name to listen on
801 * On success: passed-in buffer filled with a '\n'-terminated C
802 * string containing a whitespace-separated list of
805 * On error: return code is zero or a negative errno value
816 * size: non-zero length of C string in @buf
819 * passed-in buffer filled with a '\n'-terminated C
823 * On error: return code is a negative errno value
832 * size: non-zero length of C string in @buf
835 * On error: return code is a negative errno value
851 * write_maxblksize - Set or report the current NFS blksize
863 * size: non-zero length of C string in @buf
865 * On success: passed-in buffer filled with '\n'-terminated C string
869 * On error: return code is zero or a negative errno value
888 bsize &= ~(1024-1); in write_maxblksize()
890 if (nn->nfsd_serv) { in write_maxblksize()
892 return -EBUSY; in write_maxblksize()
911 if (nn->nfsd_serv) in __nfsd4_write_time()
912 return -EBUSY; in __nfsd4_write_time()
916 trace_nfsd_ctl_time(netns(file), dentry->d_name.name, in __nfsd4_write_time()
917 dentry->d_name.len, i); in __nfsd4_write_time()
923 * - Too short: the briefest network outage may in __nfsd4_write_time()
926 * - Too long: do you really want reboot recovery in __nfsd4_write_time()
932 return -EINVAL; in __nfsd4_write_time()
951 * write_leasetime - Set or report the current NFSv4 lease time
963 * size: non-zero length of C string in @buf
965 * On success: passed-in buffer filled with '\n'-terminated C
969 * On error: return code is zero or a negative errno value
974 return nfsd4_write_time(file, buf, size, &nn->nfsd4_lease, nn); in write_leasetime()
978 * write_gracetime - Set or report current NFSv4 grace period time
983 * lease-period time, but we don't try to enforce this. (In the common
990 return nfsd4_write_time(file, buf, size, &nn->nfsd4_grace, nn); in write_gracetime()
1002 if (nn->nfsd_serv) in __write_recoverydir()
1003 return -EBUSY; in __write_recoverydir()
1004 if (size > PATH_MAX || buf[size-1] != '\n') in __write_recoverydir()
1005 return -EINVAL; in __write_recoverydir()
1006 buf[size-1] = 0; in __write_recoverydir()
1011 return -EINVAL; in __write_recoverydir()
1024 * write_recoverydir - Set or report the pathname of the recovery directory
1037 * size: non-zero length of C string in @buf
1039 * On success: passed-in buffer filled with '\n'-terminated C string
1042 * On error: return code is zero or a negative errno value
1057 * write_v4_end_grace - release grace period for nfsd's v4.x lock manager
1066 * size: non-zero length of C string in @buf
1068 * passed-in buffer filled with "Y" or "N" with a newline
1069 * and NULL-terminated C string. This indicates whether
1085 if (!nn->nfsd_serv) in write_v4_end_grace()
1086 return -EBUSY; in write_v4_end_grace()
1091 return -EINVAL; in write_v4_end_grace()
1096 nn->grace_ended ? 'Y' : 'N'); in write_v4_end_grace()
1101 /*----------------------------------------------------------------------------*/
1113 inode->i_ino = iunique(sb, NFSD_MaxReserved); in nfsd_get_inode()
1114 inode->i_mode = mode; in nfsd_get_inode()
1118 inode->i_fop = &simple_dir_operations; in nfsd_get_inode()
1119 inode->i_op = &simple_dir_inode_operations; in nfsd_get_inode()
1123 inode->i_op = &simple_symlink_inode_operations; in nfsd_get_inode()
1135 inode = nfsd_get_inode(dir->i_sb, mode); in __nfsd_mkdir()
1137 return -ENOMEM; in __nfsd_mkdir()
1139 inode->i_private = ncl; in __nfsd_mkdir()
1140 kref_get(&ncl->cl_ref); in __nfsd_mkdir()
1150 struct inode *dir = parent->d_inode; in nfsd_mkdir()
1152 int ret = -ENOMEM; in nfsd_mkdir()
1176 inode = nfsd_get_inode(dir->i_sb, mode); in __nfsd_symlink()
1178 return -ENOMEM; in __nfsd_symlink()
1180 inode->i_link = (char *)content; in __nfsd_symlink()
1181 inode->i_size = strlen(content); in __nfsd_symlink()
1190 * @content is assumed to be a NUL-terminated string that lives
1196 struct inode *dir = parent->d_inode; in _nfsd_symlink()
1221 struct nfsdfs_client *ncl = inode->i_private; in clear_ncl()
1223 spin_lock(&inode->i_lock); in clear_ncl()
1224 inode->i_private = NULL; in clear_ncl()
1225 spin_unlock(&inode->i_lock); in clear_ncl()
1226 kref_put(&ncl->cl_ref, ncl->cl_release); in clear_ncl()
1233 spin_lock(&inode->i_lock); in get_nfsdfs_client()
1234 nc = inode->i_private; in get_nfsdfs_client()
1236 kref_get(&nc->cl_ref); in get_nfsdfs_client()
1237 spin_unlock(&inode->i_lock); in get_nfsdfs_client()
1254 for (i = 0; files->name && files->name[0]; i++, files++) { in nfsdfs_create_files()
1255 dentry = d_alloc_name(root, files->name); in nfsdfs_create_files()
1258 inode = nfsd_get_inode(d_inode(root)->i_sb, in nfsdfs_create_files()
1259 S_IFREG | files->mode); in nfsdfs_create_files()
1264 kref_get(&ncl->cl_ref); in nfsdfs_create_files()
1265 inode->i_fop = files->ops; in nfsdfs_create_files()
1266 inode->i_private = ncl; in nfsdfs_create_files()
1276 return -ENOMEM; in nfsdfs_create_files()
1291 dentry = nfsd_mkdir(nn->nfsd_client_dir, ncl, name); in nfsd_client_mkdir()
1310 struct nfsd_net *nn = net_generic(current->nsproxy->net_ns, in nfsd_fill_super()
1317 /* Per-export io stats use same ops as exports file */ in nfsd_fill_super()
1349 _nfsd_symlink(sb->s_root, "supported_krb5_enctypes", in nfsd_fill_super()
1351 dentry = nfsd_mkdir(sb->s_root, NULL, "clients"); in nfsd_fill_super()
1354 nn->nfsd_client_dir = dentry; in nfsd_fill_super()
1360 return get_tree_keyed(fc, nfsd_fill_super, get_net(fc->net_ns)); in nfsd_fs_get_tree()
1365 if (fc->s_fs_info) in nfsd_fs_free_fc()
1366 put_net(fc->s_fs_info); in nfsd_fs_free_fc()
1376 put_user_ns(fc->user_ns); in nfsd_init_fs_context()
1377 fc->user_ns = get_user_ns(fc->net_ns->user_ns); in nfsd_init_fs_context()
1378 fc->ops = &nfsd_fs_context_ops; in nfsd_init_fs_context()
1384 struct net *net = sb->s_fs_info; in nfsd_umount()
1404 return exports_net_open(current->nsproxy->net_ns, file); in exports_proc_open()
1420 return -ENOMEM; in create_proc_exports_entry()
1424 return -ENOMEM; in create_proc_exports_entry()
1444 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, in nfsd_genl_rpc_status_compose_msg()
1447 return -ENOBUFS; in nfsd_genl_rpc_status_compose_msg()
1449 if (nla_put_be32(skb, NFSD_A_RPC_STATUS_XID, rqstp->rq_xid) || in nfsd_genl_rpc_status_compose_msg()
1450 nla_put_u32(skb, NFSD_A_RPC_STATUS_FLAGS, rqstp->rq_flags) || in nfsd_genl_rpc_status_compose_msg()
1451 nla_put_u32(skb, NFSD_A_RPC_STATUS_PROG, rqstp->rq_prog) || in nfsd_genl_rpc_status_compose_msg()
1452 nla_put_u32(skb, NFSD_A_RPC_STATUS_PROC, rqstp->rq_proc) || in nfsd_genl_rpc_status_compose_msg()
1453 nla_put_u8(skb, NFSD_A_RPC_STATUS_VERSION, rqstp->rq_vers) || in nfsd_genl_rpc_status_compose_msg()
1455 ktime_to_us(rqstp->rq_stime), in nfsd_genl_rpc_status_compose_msg()
1457 return -ENOBUFS; in nfsd_genl_rpc_status_compose_msg()
1459 switch (rqstp->rq_saddr.sa_family) { in nfsd_genl_rpc_status_compose_msg()
1463 s_in = (const struct sockaddr_in *)&rqstp->rq_saddr; in nfsd_genl_rpc_status_compose_msg()
1464 d_in = (const struct sockaddr_in *)&rqstp->rq_daddr; in nfsd_genl_rpc_status_compose_msg()
1466 s_in->sin_addr.s_addr) || in nfsd_genl_rpc_status_compose_msg()
1468 d_in->sin_addr.s_addr) || in nfsd_genl_rpc_status_compose_msg()
1470 s_in->sin_port) || in nfsd_genl_rpc_status_compose_msg()
1472 d_in->sin_port)) in nfsd_genl_rpc_status_compose_msg()
1473 return -ENOBUFS; in nfsd_genl_rpc_status_compose_msg()
1479 s_in = (const struct sockaddr_in6 *)&rqstp->rq_saddr; in nfsd_genl_rpc_status_compose_msg()
1480 d_in = (const struct sockaddr_in6 *)&rqstp->rq_daddr; in nfsd_genl_rpc_status_compose_msg()
1482 &s_in->sin6_addr) || in nfsd_genl_rpc_status_compose_msg()
1484 &d_in->sin6_addr) || in nfsd_genl_rpc_status_compose_msg()
1486 s_in->sin6_port) || in nfsd_genl_rpc_status_compose_msg()
1488 d_in->sin6_port)) in nfsd_genl_rpc_status_compose_msg()
1489 return -ENOBUFS; in nfsd_genl_rpc_status_compose_msg()
1494 for (i = 0; i < rqstp->rq_opcnt; i++) in nfsd_genl_rpc_status_compose_msg()
1496 rqstp->rq_opnum[i])) in nfsd_genl_rpc_status_compose_msg()
1497 return -ENOBUFS; in nfsd_genl_rpc_status_compose_msg()
1504 * nfsd_nl_rpc_status_get_dumpit - Handle rpc_status_get dumpit
1508 * Returns the size of the reply or a negative errno.
1518 nn = net_generic(sock_net(skb->sk), nfsd_net_id); in nfsd_nl_rpc_status_get_dumpit()
1519 if (!nn->nfsd_serv) { in nfsd_nl_rpc_status_get_dumpit()
1520 ret = -ENODEV; in nfsd_nl_rpc_status_get_dumpit()
1526 for (i = 0; i < nn->nfsd_serv->sv_nrpools; i++) { in nfsd_nl_rpc_status_get_dumpit()
1529 if (i < cb->args[0]) /* already consumed */ in nfsd_nl_rpc_status_get_dumpit()
1534 &nn->nfsd_serv->sv_pools[i].sp_all_threads, in nfsd_nl_rpc_status_get_dumpit()
1539 if (rqstp_index++ < cb->args[1]) /* already consumed */ in nfsd_nl_rpc_status_get_dumpit()
1548 smp_load_acquire(&rqstp->rq_status_counter); in nfsd_nl_rpc_status_get_dumpit()
1552 genl_rqstp.rq_xid = rqstp->rq_xid; in nfsd_nl_rpc_status_get_dumpit()
1553 genl_rqstp.rq_flags = rqstp->rq_flags; in nfsd_nl_rpc_status_get_dumpit()
1554 genl_rqstp.rq_vers = rqstp->rq_vers; in nfsd_nl_rpc_status_get_dumpit()
1555 genl_rqstp.rq_prog = rqstp->rq_prog; in nfsd_nl_rpc_status_get_dumpit()
1556 genl_rqstp.rq_proc = rqstp->rq_proc; in nfsd_nl_rpc_status_get_dumpit()
1557 genl_rqstp.rq_stime = rqstp->rq_stime; in nfsd_nl_rpc_status_get_dumpit()
1565 if (rqstp->rq_vers == NFS4_VERSION && in nfsd_nl_rpc_status_get_dumpit()
1566 rqstp->rq_proc == NFSPROC4_COMPOUND) { in nfsd_nl_rpc_status_get_dumpit()
1571 args = rqstp->rq_argp; in nfsd_nl_rpc_status_get_dumpit()
1572 genl_rqstp.rq_opcnt = args->opcnt; in nfsd_nl_rpc_status_get_dumpit()
1575 args->ops[j].opnum; in nfsd_nl_rpc_status_get_dumpit()
1583 if (smp_load_acquire(&rqstp->rq_status_counter) != in nfsd_nl_rpc_status_get_dumpit()
1594 cb->args[0] = i; in nfsd_nl_rpc_status_get_dumpit()
1595 cb->args[1] = rqstp_index; in nfsd_nl_rpc_status_get_dumpit()
1596 ret = skb->len; in nfsd_nl_rpc_status_get_dumpit()
1606 * nfsd_nl_threads_set_doit - set the number of running threads
1610 * Return 0 on success or a negative errno.
1614 int *nthreads, count = 0, nrpools, i, ret = -EOPNOTSUPP, rem; in nfsd_nl_threads_set_doit()
1621 return -EINVAL; in nfsd_nl_threads_set_doit()
1624 nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) { in nfsd_nl_threads_set_doit()
1634 ret = -ENOMEM; in nfsd_nl_threads_set_doit()
1639 nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) { in nfsd_nl_threads_set_doit()
1647 if (info->attrs[NFSD_A_SERVER_GRACETIME] || in nfsd_nl_threads_set_doit()
1648 info->attrs[NFSD_A_SERVER_LEASETIME] || in nfsd_nl_threads_set_doit()
1649 info->attrs[NFSD_A_SERVER_SCOPE]) { in nfsd_nl_threads_set_doit()
1650 ret = -EBUSY; in nfsd_nl_threads_set_doit()
1651 if (nn->nfsd_serv && nn->nfsd_serv->sv_nrthreads) in nfsd_nl_threads_set_doit()
1654 ret = -EINVAL; in nfsd_nl_threads_set_doit()
1655 attr = info->attrs[NFSD_A_SERVER_GRACETIME]; in nfsd_nl_threads_set_doit()
1662 nn->nfsd4_grace = gracetime; in nfsd_nl_threads_set_doit()
1665 attr = info->attrs[NFSD_A_SERVER_LEASETIME]; in nfsd_nl_threads_set_doit()
1672 nn->nfsd4_lease = leasetime; in nfsd_nl_threads_set_doit()
1675 attr = info->attrs[NFSD_A_SERVER_SCOPE]; in nfsd_nl_threads_set_doit()
1690 * nfsd_nl_threads_get_doit - get the number of running threads
1694 * Return 0 on success or a negative errno.
1705 return -ENOMEM; in nfsd_nl_threads_get_doit()
1709 err = -EMSGSIZE; in nfsd_nl_threads_get_doit()
1716 nn->nfsd4_grace) || in nfsd_nl_threads_get_doit()
1718 nn->nfsd4_lease) || in nfsd_nl_threads_get_doit()
1720 nn->nfsd_name); in nfsd_nl_threads_get_doit()
1724 if (nn->nfsd_serv) { in nfsd_nl_threads_get_doit()
1728 struct svc_pool *sp = &nn->nfsd_serv->sv_pools[i]; in nfsd_nl_threads_get_doit()
1731 sp->sp_nrthreads); in nfsd_nl_threads_get_doit()
1756 * nfsd_nl_version_set_doit - set the nfs enabled versions
1760 * Return 0 on success or a negative errno.
1769 return -EINVAL; in nfsd_nl_version_set_doit()
1774 if (nn->nfsd_serv) { in nfsd_nl_version_set_doit()
1776 return -EBUSY; in nfsd_nl_version_set_doit()
1785 nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) { in nfsd_nl_version_set_doit()
1794 nfsd_version_nl_policy, info->extack) < 0) in nfsd_nl_version_set_doit()
1826 * nfsd_nl_version_get_doit - get the enabled status for all supported nfs versions
1830 * Return 0 on success or a negative errno.
1840 return -ENOMEM; in nfsd_nl_version_get_doit()
1844 err = -EMSGSIZE; in nfsd_nl_version_get_doit()
1870 err = -EINVAL; in nfsd_nl_version_get_doit()
1876 err = -EINVAL; in nfsd_nl_version_get_doit()
1884 err = -EINVAL; in nfsd_nl_version_get_doit()
1906 * nfsd_nl_listener_set_doit - set the nfs running sockets
1910 * Return 0 on success or a negative errno.
1932 serv = nn->nfsd_serv; in nfsd_nl_listener_set_doit()
1934 spin_lock_bh(&serv->sv_lock); in nfsd_nl_listener_set_doit()
1937 list_splice_init(&serv->sv_permsocks, &permsocks); in nfsd_nl_listener_set_doit()
1943 nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) { in nfsd_nl_listener_set_doit()
1952 nfsd_sock_nl_policy, info->extack) < 0) in nfsd_nl_listener_set_doit()
1967 if (WARN_ON_ONCE(xprt->xpt_net != net)) { in nfsd_nl_listener_set_doit()
1968 list_move(&xprt->xpt_list, &serv->sv_permsocks); in nfsd_nl_listener_set_doit()
1973 if (!strcmp(xprt->xpt_class->xcl_name, xcl_name) && in nfsd_nl_listener_set_doit()
1974 rpc_cmp_addr_port(sa, (struct sockaddr *)&xprt->xpt_local)) { in nfsd_nl_listener_set_doit()
1975 list_move(&xprt->xpt_list, &serv->sv_permsocks); in nfsd_nl_listener_set_doit()
1986 list_splice_init(&permsocks, &serv->sv_permsocks); in nfsd_nl_listener_set_doit()
1989 spin_unlock_bh(&serv->sv_lock); in nfsd_nl_listener_set_doit()
1992 if (serv->sv_nrthreads) { in nfsd_nl_listener_set_doit()
1993 err = -EBUSY; in nfsd_nl_listener_set_doit()
2005 nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) { in nfsd_nl_listener_set_doit()
2015 nfsd_sock_nl_policy, info->extack) < 0) in nfsd_nl_listener_set_doit()
2043 if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks)) in nfsd_nl_listener_set_doit()
2053 * nfsd_nl_listener_get_doit - get the nfs running listeners
2057 * Return 0 on success or a negative errno.
2069 return -ENOMEM; in nfsd_nl_listener_get_doit()
2073 err = -EMSGSIZE; in nfsd_nl_listener_get_doit()
2081 if (!nn->nfsd_serv) in nfsd_nl_listener_get_doit()
2084 serv = nn->nfsd_serv; in nfsd_nl_listener_get_doit()
2085 spin_lock_bh(&serv->sv_lock); in nfsd_nl_listener_get_doit()
2086 list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) { in nfsd_nl_listener_get_doit()
2091 err = -EINVAL; in nfsd_nl_listener_get_doit()
2096 xprt->xpt_class->xcl_name) || in nfsd_nl_listener_get_doit()
2099 &xprt->xpt_local)) { in nfsd_nl_listener_get_doit()
2100 err = -EINVAL; in nfsd_nl_listener_get_doit()
2106 spin_unlock_bh(&serv->sv_lock); in nfsd_nl_listener_get_doit()
2114 spin_unlock_bh(&serv->sv_lock); in nfsd_nl_listener_get_doit()
2123 * nfsd_nl_pool_mode_set_doit - set the number of running threads
2127 * Return 0 on success or a negative errno.
2134 return -EINVAL; in nfsd_nl_pool_mode_set_doit()
2136 attr = info->attrs[NFSD_A_POOL_MODE_MODE]; in nfsd_nl_pool_mode_set_doit()
2141 * nfsd_nl_pool_mode_get_doit - get info about pool_mode
2145 * Return 0 on success or a negative errno.
2155 return -ERANGE; in nfsd_nl_pool_mode_get_doit()
2159 return -ENOMEM; in nfsd_nl_pool_mode_get_doit()
2161 err = -EMSGSIZE; in nfsd_nl_pool_mode_get_doit()
2180 * nfsd_net_init - Prepare the nfsd_net portion of a new net namespace
2181 * @net: a freshly-created network namespace
2187 * Returns zero on success, or a negative errno otherwise.
2201 retval = percpu_counter_init_many(nn->counter, 0, GFP_KERNEL, in nfsd_net_init()
2206 memset(&nn->nfsd_svcstats, 0, sizeof(nn->nfsd_svcstats)); in nfsd_net_init()
2207 nn->nfsd_svcstats.program = &nfsd_programs[0]; in nfsd_net_init()
2209 retval = -ENOMEM; in nfsd_net_init()
2213 for (i = 0; i < sizeof(nn->nfsd_versions); i++) in nfsd_net_init()
2214 nn->nfsd_versions[i] = nfsd_support_version(i); in nfsd_net_init()
2215 for (i = 0; i < sizeof(nn->nfsd4_minorversions); i++) in nfsd_net_init()
2216 nn->nfsd4_minorversions[i] = nfsd_support_version(4); in nfsd_net_init()
2217 nn->nfsd_info.mutex = &nfsd_mutex; in nfsd_net_init()
2218 nn->nfsd_serv = NULL; in nfsd_net_init()
2220 get_random_bytes(&nn->siphash_key, sizeof(nn->siphash_key)); in nfsd_net_init()
2221 seqlock_init(&nn->writeverf_lock); in nfsd_net_init()
2223 spin_lock_init(&nn->local_clients_lock); in nfsd_net_init()
2224 INIT_LIST_HEAD(&nn->local_clients); in nfsd_net_init()
2229 percpu_counter_destroy_many(nn->counter, NFSD_STATS_COUNTERS_NUM); in nfsd_net_init()
2240 * nfsd_net_pre_exit - Disconnect localio clients from net namespace
2243 * This invalidates ->net pointers held by localio clients
2244 * while they can still safely access nn->counter.
2250 nfs_localio_invalidate_clients(&nn->local_clients, in nfsd_net_pre_exit()
2251 &nn->local_clients_lock); in nfsd_net_pre_exit()
2256 * nfsd_net_exit - Release the nfsd_net portion of a net namespace
2265 percpu_counter_destroy_many(nn->counter, NFSD_STATS_COUNTERS_NUM); in nfsd_net_exit()
2293 nfsd_lockd_init(); /* lockd->nfsd callbacks */ in init_nfsd()
2350 MODULE_DESCRIPTION("In-kernel NFS server");