rpms/kernel/devel linux-2.6.29-rc6-nfs41-030408.patch, NONE, 1.1.2.1 config-generic, 1.251, 1.251.2.1 kernel.spec, 1.1378, 1.1378.2.1
Steve Dickson
steved at fedoraproject.org
Wed Mar 4 13:42:23 UTC 2009
- Previous message (by thread): rpms/django-tagging/devel django-tagging.spec, NONE, 1.1 import.log, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Next message (by thread): rpms/samba4/devel samba4.spec,1.5,1.6
- 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-serv17377
Modified Files:
Tag: kernel-2_6_29-0_rc7_nfs41_030408
config-generic kernel.spec
Added Files:
Tag: kernel-2_6_29-0_rc7_nfs41_030408
linux-2.6.29-rc6-nfs41-030408.patch
Log Message:
Updated to latest NFSv41 patches
linux-2.6.29-rc6-nfs41-030408.patch:
--- NEW FILE linux-2.6.29-rc6-nfs41-030408.patch ---
diff -up linux-2.6.28.noarch/fs/nfs/callback.c.orig linux-2.6.28.noarch/fs/nfs/callback.c
--- linux-2.6.28.noarch/fs/nfs/callback.c.orig 2009-03-04 07:30:53.737727000 -0500
+++ linux-2.6.28.noarch/fs/nfs/callback.c 2009-03-04 07:34:33.174052000 -0500
@@ -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, para
&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,
nfs_callback_family, NULL);
- ret = -ENOMEM;
- if (!serv)
- goto out_err;
-
- ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport,
- SVC_SOCK_ANONYMOUS);
- if (ret <= 0)
+ if (!serv) {
+ ret = -ENOMEM;
goto out_err;
- nfs_callback_tcpport = ret;
- dprintk("NFS: Callback listener port = %u (af %u)\n",
- nfs_callback_tcpport, nfs_callback_family);
+ }
- nfs_callback_info.rqst = svc_prepare_thread(serv, &serv->sv_pools[0]);
- if (IS_ERR(nfs_callback_info.rqst)) {
- ret = PTR_ERR(nfs_callback_info.rqst);
- nfs_callback_info.rqst = NULL;
+ /* FIXME: either 4.0 or 4.1 callback service can be up at a time
+ * need to monitor and control them both */
+ if (!minorversion) {
+ rqst = nfs4_callback_up(serv);
+ callback_svc = nfs4_callback_svc;
+ } else {
+#if defined(CONFIG_NFS_V4_1)
+ rqst = nfs41_callback_up(serv, xprt);
+ callback_svc = nfs41_callback_svc;
+#else /* CONFIG_NFS_V4_1 */
+ BUG();
[...12206 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,
@@ -1899,11 +2266,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)
{
@@ -2036,13 +2426,31 @@ static struct rpc_xprt *xs_setup_tcp(str
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:
@@ -2050,13 +2458,31 @@ static struct rpc_xprt *xs_setup_tcp(str
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.251
retrieving revision 1.251.2.1
diff -u -r1.251 -r1.251.2.1
--- config-generic 2 Mar 2009 23:09:52 -0000 1.251
+++ config-generic 4 Mar 2009 13:41:52 -0000 1.251.2.1
@@ -3164,6 +3164,12 @@
CONFIG_SUNRPC_REGISTER_V4=y
CONFIG_RPCSEC_GSS_KRB5=m
CONFIG_RPCSEC_GSS_SPKM3=m
+#
+# Needed of 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.1378
retrieving revision 1.1378.2.1
diff -u -r1.1378 -r1.1378.2.1
--- kernel.spec 4 Mar 2009 05:41:36 -0000 1.1378
+++ kernel.spec 4 Mar 2009 13:41:52 -0000 1.1378.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_030408
# 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)
@@ -666,6 +666,8 @@
Patch2300: linux-2.6.28-sunrpc-ipv6-rpcbind.patch
Patch2301: linux-2.6.28-lockd-svc-register.patch
+Patch2400: linux-2.6.29-rc6-nfs41-030408.patch
+
# Quiet boot fixes
# silence the ACPI blacklist code
Patch2802: linux-2.6-silence-acpi-blacklist.patch
@@ -1209,6 +1211,7 @@
ApplyPatch linux-2.6.28-lockd-svc-register.patch
+ApplyPatch linux-2.6.29-rc6-nfs41-030408.patch
# END OF PATCH APPLICATIONS
%endif
@@ -1792,6 +1795,9 @@
# and build.
%changelog
+* Wed Mar 4 2009 Steve Dickson <steved at redhat.com> 2.6.29-0.197.rc7-nfs41
+- Updated to latest NFSv41 patches
+
* Wed Mar 04 2009 Ben Skeggs <bskeggs at redhat.com>
- drm-nouveau.patch: lvds, dpms and gamma_set fixes
- Previous message (by thread): rpms/django-tagging/devel django-tagging.spec, NONE, 1.1 import.log, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Next message (by thread): rpms/samba4/devel samba4.spec,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list