rpms/kernel/devel linux-2.6-nfs41-latest-rc8.patch, NONE, 1.1.2.1 config-generic, 1.262, 1.262.2.1 kernel.spec, 1.1463, 1.1463.2.1
Steve Dickson
steved at fedoraproject.org
Tue Mar 24 14:34:10 UTC 2009
- Previous message (by thread): rpms/selinux-policy/devel policy-20090105.patch, 1.66, 1.67 selinux-policy.spec, 1.809, 1.810
- Next message (by thread): rpms/kernel/devel linux-2.6-pnfs-all-latest-rc8.patch, NONE, 1.1.2.1 config-generic, 1.262, 1.262.4.1 kernel.spec, 1.1463, 1.1463.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: steved
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27736
Modified Files:
Tag: kernel-2_6_29-nfs41_032409
config-generic kernel.spec
Added Files:
Tag: kernel-2_6_29-nfs41_032409
linux-2.6-nfs41-latest-rc8.patch
Log Message:
Updated to latest nfs41 release
linux-2.6-nfs41-latest-rc8.patch:
--- NEW FILE linux-2.6-nfs41-latest-rc8.patch ---
diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
index 36fe20d..055a0aa 100644
--- a/fs/nfs/Kconfig
+++ b/fs/nfs/Kconfig
@@ -74,6 +74,15 @@ config NFS_V4
If unsure, say N.
+config NFS_V4_1
+ bool "NFS client support for NFSv4.1 (DEVELOPER ONLY)"
+ depends on NFS_V4 && EXPERIMENTAL
+ help
+ This option enables support for minor version 1 of the NFSv4 protocol
+ (draft-ietf-nfsv4-minorversion1) in the kernel's NFS client.
+
+ Unless you're an NFS developer, say N.
+
config ROOT_NFS
bool "Root file system on NFS"
depends on NFS_FS=y && IP_PNP
diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile
index ac6170c..de5ea30 100644
--- a/fs/nfs/Makefile
+++ b/fs/nfs/Makefile
@@ -14,4 +14,5 @@ nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \
delegation.o idmap.o \
callback.o callback_xdr.o callback_proc.o \
nfs4namespace.o
+nfs-$(CONFIG_NFS_V4_1) += nfs41_session_recovery.o
nfs-$(CONFIG_SYSCTL) += sysctl.o
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 3e634f2..b6c954d 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -17,6 +17,9 @@
#include <linux/freezer.h>
#include <linux/kthread.h>
#include <linux/sunrpc/svcauth_gss.h>
+#if defined(CONFIG_NFS_V4_1)
+#include <linux/sunrpc/bc_xprt.h>
+#endif
#include <net/inet_sock.h>
@@ -28,11 +31,12 @@
struct nfs_callback_data {
unsigned int users;
+ struct svc_serv *serv;
struct svc_rqst *rqst;
struct task_struct *task;
};
-static struct nfs_callback_data nfs_callback_info;
+static struct nfs_callback_data nfs_callback_info[NFS4_MAX_MINOR_VERSION + 1];
static DEFINE_MUTEX(nfs_callback_mutex);
static struct svc_program nfs4_callback_program;
@@ -65,10 +69,10 @@ module_param_call(callback_tcpport, param_set_port, param_get_int,
&nfs_callback_set_tcpport, 0644);
/*
- * This is the callback kernel thread.
+ * This is the NFSv4 callback kernel thread.
*/
static int
-nfs_callback_svc(void *vrqstp)
+nfs4_callback_svc(void *vrqstp)
{
int err, preverr = 0;
struct svc_rqst *rqstp = vrqstp;
@@ -105,48 +109,163 @@ nfs_callback_svc(void *vrqstp)
return 0;
}
+
+/*
+ * Prepare to bring up the NFSv4 callback service
+ */
+struct svc_rqst *
+nfs4_callback_up(struct svc_serv *serv)
+{
+ int ret;
+
+ ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport,
+ SVC_SOCK_ANONYMOUS);
+ if (unlikely(ret <= 0)) {
+ if (ret == 0)
+ ret = -EIO;
+ return ERR_PTR(ret);
+ }
+ nfs_callback_tcpport = ret;
+ dprintk("NFS: Callback listener port = %u (af %u)\n",
+ nfs_callback_tcpport, nfs_callback_family);
+ return svc_prepare_thread(serv, &serv->sv_pools[0]);
+}
+
+#if defined(CONFIG_NFS_V4_1)
+/*
+ * The callback service for NFSv4.1 callbacks
+ */
+static int
+nfs41_callback_svc(void *vrqstp)
+{
+ struct svc_rqst *rqstp = vrqstp;
+ struct svc_serv *serv = rqstp->rq_server;
+ struct rpc_rqst *req;
+ int error;
+ DEFINE_WAIT(wq);
+
+ set_freezable();
+
+ /*
+ * FIXME: do we really need to run this under the BKL? If so, please
+ * add a comment about what it's intended to protect.
+ */
+ lock_kernel();
+ while (!kthread_should_stop()) {
+ prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE);
+ spin_lock_bh(&serv->sv_cb_lock);
+ if (!list_empty(&serv->sv_cb_list)) {
+ req = list_first_entry(&serv->sv_cb_list,
+ struct rpc_rqst, rq_bc_list);
+ list_del(&req->rq_bc_list);
+ spin_unlock_bh(&serv->sv_cb_lock);
+ dprintk("Invoking bc_svc_process()\n");
+ error = bc_svc_process(serv, req, rqstp);
+ dprintk("bc_svc_process() returned w/ error code= %d\n",
+ error);
+ } else {
+ spin_unlock_bh(&serv->sv_cb_lock);
+ schedule();
+ }
+ finish_wait(&serv->sv_cb_waitq, &wq);
+ }
+ unlock_kernel();
+ return 0;
+}
+
+/*
+ * Bring up the NFSv4.1 callback service
+ */
+struct svc_rqst *
+nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt)
+{
+ struct svc_xprt *bc_xprt;
+ struct svc_rqst *rqstp = ERR_PTR(-ENOMEM);
+
+ dprintk("--> %s\n", __func__);
+ /* Create a svc_sock for the service */
+ bc_xprt = svc_sock_create(serv, xprt->prot);
+ if (!bc_xprt)
+ goto out;
+
+ /*
+ * Save the svc_serv in the transport so that it can
+ * be referenced when the session backchannel is initialized
+ */
+ serv->bc_xprt = bc_xprt;
+ xprt->bc_serv = serv;
+
+ INIT_LIST_HEAD(&serv->sv_cb_list);
+ spin_lock_init(&serv->sv_cb_lock);
+ init_waitqueue_head(&serv->sv_cb_waitq);
+ rqstp = svc_prepare_thread(serv, &serv->sv_pools[0]);
+ if (IS_ERR(rqstp))
+ svc_sock_destroy(bc_xprt);
+out:
+ dprintk("--> %s return %p\n", __func__, rqstp);
+ return rqstp;
+}
+#endif /* CONFIG_NFS_V4_1 */
+
/*
* Bring up the callback thread if it is not already up.
*/
-int nfs_callback_up(void)
+int nfs_callback_up(u32 minorversion, void *args)
{
struct svc_serv *serv = NULL;
+ struct svc_rqst *rqst;
+ int (* callback_svc)(void *vrqstp);
+ struct nfs_callback_data *cb_info = &nfs_callback_info[minorversion];
+ char svc_name[12];
int ret = 0;
+#if defined(CONFIG_NFS_V4_1)
+ struct rpc_xprt *xprt = (struct rpc_xprt *)args;
+#endif /* CONFIG_NFS_V4_1 */
mutex_lock(&nfs_callback_mutex);
- if (nfs_callback_info.users++ || nfs_callback_info.task != NULL)
+ if (cb_info->users++ || cb_info->task != NULL) {
+#if defined(CONFIG_NFS_V4_1)
+ if (minorversion)
+ xprt->bc_serv = cb_info->serv;
+#endif /* CONFIG_NFS_V4_1 */
goto out;
+ }
serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE,
[...12550 lines suppressed...]
+ /*
+ * send page data
+ *
+ * Check the amount of data to be sent. If it is less than the
+ * remaining page, then send it else send the current page
+ */
+
+ size = PAGE_SIZE - base < pglen ? PAGE_SIZE - base : pglen;
+ while (pglen > 0) {
+ if (total_len == size)
+ flags = 0;
+ result = sock->ops->sendpage(sock, *pages, base, size, flags);
+ if (result > 0)
+ len += result;
+ if (result != size)
+ goto out;
+ total_len -= size;
+ pglen -= size;
+ size = PAGE_SIZE < pglen ? PAGE_SIZE : pglen;
+ base = 0;
+ pages++;
+ }
+ /*
+ * send tail
+ */
+ if (xbufp->tail[0].iov_len) {
+ result = sock->ops->sendpage(sock,
+ xbufp->tail[0].iov_base,
+ (unsigned long)xbufp->tail[0].iov_base & ~PAGE_MASK,
+ xbufp->tail[0].iov_len,
+ 0);
+
+ if (result > 0)
+ len += result;
+ }
+out:
+ if (len != xbufp->len)
+ printk(KERN_NOTICE "Error sending entire callback!\n");
+
+ return len;
+}
+
+/*
+ * The send routine. Borrows from svc_send
+ */
+static int bc_send_request(struct rpc_task *task)
+{
+ struct rpc_rqst *req = task->tk_rqstp;
+ struct rpc_xprt *bc_xprt = req->rq_xprt;
+ struct svc_xprt *xprt;
+ struct svc_sock *svsk;
+ u32 len;
+
+ dprintk("sending request with xid: %08x\n", ntohl(req->rq_xid));
+ /*
+ * Get the server socket associated with this callback xprt
+ */
+ svsk = bc_xprt->bc_sock;
+ xprt = &svsk->sk_xprt;
+
+ mutex_lock(&xprt->xpt_mutex);
+ if (test_bit(XPT_DEAD, &xprt->xpt_flags))
+ len = -ENOTCONN;
+ else
+ len = bc_sendto(req);
+ mutex_unlock(&xprt->xpt_mutex);
+
+ return 0;
+
+}
+
+/*
+ * The close routine. Since this is client initiated, we do nothing
+ */
+
+static void bc_close(struct rpc_xprt *xprt)
+{
+ return;
+}
+
+/*
+ * The xprt destroy routine. Again, because this connection is client
+ * initiated, we do nothing
+ */
+
+static void bc_destroy(struct rpc_xprt *xprt)
+{
+ return;
+}
+#endif /* CONFIG_NFSD_V4_1 */
+
static struct rpc_xprt_ops xs_udp_ops = {
.set_buffer_size = xs_udp_set_buffer_size,
.reserve_xprt = xprt_reserve_xprt_cong,
@@ -1912,11 +2279,34 @@ static struct rpc_xprt_ops xs_tcp_ops = {
.buf_free = rpc_free,
.send_request = xs_tcp_send_request,
.set_retrans_timeout = xprt_set_retrans_timeout_def,
+#if defined(CONFIG_NFS_V4_1)
+ .release_request = bc_release_request,
+#endif /* CONFIG_NFS_V4_1 */
.close = xs_tcp_shutdown,
.destroy = xs_destroy,
.print_stats = xs_tcp_print_stats,
};
+#if defined(CONFIG_NFSD_V4_1)
+/*
+ * The rpc_xprt_ops for the server backchannel
+ */
+
+static struct rpc_xprt_ops bc_tcp_ops = {
+ .reserve_xprt = xprt_reserve_xprt,
+ .release_xprt = xprt_release_xprt,
+ .set_port = bc_set_port,
+ .connect = bc_connect,
+ .buf_alloc = bc_malloc,
+ .buf_free = bc_free,
+ .send_request = bc_send_request,
+ .set_retrans_timeout = xprt_set_retrans_timeout_def,
+ .close = bc_close,
+ .destroy = bc_destroy,
+ .print_stats = xs_tcp_print_stats,
+};
+#endif /* CONFIG_NFSD_V4_1 */
+
static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
unsigned int slot_table_size)
{
@@ -2049,13 +2439,31 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
xprt->tsh_size = sizeof(rpc_fraghdr) / sizeof(u32);
xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
- xprt->bind_timeout = XS_BIND_TO;
- xprt->connect_timeout = XS_TCP_CONN_TO;
- xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
- xprt->idle_timeout = XS_IDLE_DISC_TO;
+#ifdef CONFIG_NFSD_V4_1
+ if (args->bc_sock) {
+ /* backchannel */
+ xprt_set_bound(xprt);
+ INIT_DELAYED_WORK(&transport->connect_worker,
+ bc_connect_worker);
+ xprt->bind_timeout = 0;
+ xprt->connect_timeout = 0;
+ xprt->reestablish_timeout = 0;
+ xprt->idle_timeout = (~0);
- xprt->ops = &xs_tcp_ops;
- xprt->timeout = &xs_tcp_default_timeout;
+ /*
+ * The backchannel uses the same socket connection as the
+ * forechannel
+ */
+ xprt->bc_sock = args->bc_sock;
+ xprt->bc_sock->sk_bc_xprt = xprt;
+ transport->sock = xprt->bc_sock->sk_sock;
+ transport->inet = xprt->bc_sock->sk_sk;
+
+ xprt->ops = &bc_tcp_ops;
+
+ goto next;
+ }
+#endif /* CONFIG_NFSD_V4_1 */
switch (addr->sa_family) {
case AF_INET:
@@ -2063,13 +2471,31 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
xprt_set_bound(xprt);
INIT_DELAYED_WORK(&transport->connect_worker, xs_tcp_connect_worker4);
- xs_format_ipv4_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP);
break;
case AF_INET6:
if (((struct sockaddr_in6 *)addr)->sin6_port != htons(0))
xprt_set_bound(xprt);
INIT_DELAYED_WORK(&transport->connect_worker, xs_tcp_connect_worker6);
+ break;
+ }
+ xprt->bind_timeout = XS_BIND_TO;
+ xprt->connect_timeout = XS_TCP_CONN_TO;
+ xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
+ xprt->idle_timeout = XS_IDLE_DISC_TO;
+
+ xprt->ops = &xs_tcp_ops;
+
+#ifdef CONFIG_NFSD_V4_1
+next:
+#endif /* CONFIG_NFSD_V4_1 */
+ xprt->timeout = &xs_tcp_default_timeout;
+
+ switch (addr->sa_family) {
+ case AF_INET:
+ xs_format_ipv4_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP);
+ break;
+ case AF_INET6:
xs_format_ipv6_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP6);
break;
default:
Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.262
retrieving revision 1.262.2.1
diff -u -r1.262 -r1.262.2.1
--- config-generic 24 Mar 2009 01:31:28 -0000 1.262
+++ config-generic 24 Mar 2009 14:33:39 -0000 1.262.2.1
@@ -3093,6 +3093,11 @@
# CONFIG_SUNRPC_REGISTER_V4 is not set
CONFIG_RPCSEC_GSS_KRB5=m
CONFIG_RPCSEC_GSS_SPKM3=m
+#
+# Needed for NFSv4.1
+#
+CONFIG_NFS_V4_1=y
+CONFIG_NFSD_V4_1=y
# CONFIG_SMB_FS is not set
# CONFIG_SMB_NLS_DEFAULT is not set
CONFIG_CIFS=m
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1463
retrieving revision 1.1463.2.1
diff -u -r1.1463 -r1.1463.2.1
--- kernel.spec 24 Mar 2009 01:31:28 -0000 1.1463
+++ kernel.spec 24 Mar 2009 14:33:39 -0000 1.1463.2.1
@@ -12,7 +12,7 @@
# that the kernel isn't the stock distribution kernel, for example,
# by setting the define to ".local" or ".bz123456"
#
-# % define buildid .local
+%define buildid .nfs41.032409
# fedora_build defines which build revision of this kernel version we're
# building. Rather than incrementing forever, as with the prior versioning
@@ -86,7 +86,7 @@
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}
# kernel-firmware
-%define with_firmware %{?_with_firmware: 1} %{?!_with_firmware: 0}
+%define with_firmware %{?_with_firmware: 1} %{?!_with_firmware: 1}
# kernel-debuginfo
%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}
# kernel-bootwrapper (for creating zImages from kernel + initrd)
@@ -685,6 +685,7 @@
Patch9002: cpufreq-add-atom-to-p4-clockmod.patch
+Patch9100: linux-2.6-nfs41-latest-rc8.patch
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1227,6 +1228,7 @@
ApplyPatch cpufreq-add-atom-to-p4-clockmod.patch
+ApplyPatch linux-2.6-nfs41-latest-rc8.patch
# END OF PATCH APPLICATIONS
%endif
@@ -1810,6 +1812,9 @@
# and build.
%changelog
+* Tue Mar 24 2009 Steve Dickson <steved at redhat.com>
+- Updated to latest nfs41 release
+
* Mon Mar 23 2009 Dave Jones <davej at redhat.com>
- 2.6.29
- Previous message (by thread): rpms/selinux-policy/devel policy-20090105.patch, 1.66, 1.67 selinux-policy.spec, 1.809, 1.810
- Next message (by thread): rpms/kernel/devel linux-2.6-pnfs-all-latest-rc8.patch, NONE, 1.1.2.1 config-generic, 1.262, 1.262.4.1 kernel.spec, 1.1463, 1.1463.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list