Merge branch 'for-2.6.37' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.37' of git://linux-nfs.org/~bfields/linux: (99 commits) svcrpc: svc_tcp_sendto XPT_DEAD check is redundant svcrpc: no need for XPT_DEAD check in svc_xprt_enqueue svcrpc: assume svc_delete_xprt() called only once svcrpc: never clear XPT_BUSY on dead xprt nfsd4: fix connection allocation in sequence() nfsd4: only require krb5 principal for NFSv4.0 callbacks nfsd4: move minorversion to client nfsd4: delay session removal till free_client nfsd4: separate callback change and callback probe nfsd4: callback program number is per-session nfsd4: track backchannel connections nfsd4: confirm only on succesful create_session nfsd4: make backchannel sequence number per-session nfsd4: use client pointer to backchannel session nfsd4: move callback setup into session init code nfsd4: don't cache seq_misordered replies SUNRPC: Properly initialize sock_xprt.srcaddr in all cases SUNRPC: Use conventional switch statement when reclassifying sockets sunrpc/xprtrdma: clean up workqueue usage sunrpc: Turn list_for_each-s into the ..._entry-s ... Fix up trivial conflicts (two different deprecation notices added in separate branches) in Documentation/feature-removal-schedule.txt
This commit is contained in:
@@ -353,6 +353,7 @@ nlm_bind_host(struct nlm_host *host)
|
||||
.to_retries = 5U,
|
||||
};
|
||||
struct rpc_create_args args = {
|
||||
.net = &init_net,
|
||||
.protocol = host->h_proto,
|
||||
.address = nlm_addr(host),
|
||||
.addrsize = host->h_addrlen,
|
||||
|
@@ -69,6 +69,7 @@ static struct rpc_clnt *nsm_create(void)
|
||||
.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
|
||||
};
|
||||
struct rpc_create_args args = {
|
||||
.net = &init_net,
|
||||
.protocol = XPRT_TRANSPORT_UDP,
|
||||
.address = (struct sockaddr *)&sin,
|
||||
.addrsize = sizeof(sin),
|
||||
|
@@ -206,7 +206,7 @@ static int create_lockd_listener(struct svc_serv *serv, const char *name,
|
||||
|
||||
xprt = svc_find_xprt(serv, name, family, 0);
|
||||
if (xprt == NULL)
|
||||
return svc_create_xprt(serv, name, family, port,
|
||||
return svc_create_xprt(serv, name, &init_net, family, port,
|
||||
SVC_SOCK_DEFAULTS);
|
||||
svc_xprt_put(xprt);
|
||||
return 0;
|
||||
|
@@ -230,9 +230,7 @@ static void nlm4svc_callback_exit(struct rpc_task *task, void *data)
|
||||
|
||||
static void nlm4svc_callback_release(void *data)
|
||||
{
|
||||
lock_kernel();
|
||||
nlm_release_call(data);
|
||||
unlock_kernel();
|
||||
}
|
||||
|
||||
static const struct rpc_call_ops nlm4svc_callback_ops = {
|
||||
|
@@ -52,12 +52,13 @@ static const struct rpc_call_ops nlmsvc_grant_ops;
|
||||
* The list of blocked locks to retry
|
||||
*/
|
||||
static LIST_HEAD(nlm_blocked);
|
||||
static DEFINE_SPINLOCK(nlm_blocked_lock);
|
||||
|
||||
/*
|
||||
* Insert a blocked lock into the global list
|
||||
*/
|
||||
static void
|
||||
nlmsvc_insert_block(struct nlm_block *block, unsigned long when)
|
||||
nlmsvc_insert_block_locked(struct nlm_block *block, unsigned long when)
|
||||
{
|
||||
struct nlm_block *b;
|
||||
struct list_head *pos;
|
||||
@@ -87,6 +88,13 @@ nlmsvc_insert_block(struct nlm_block *block, unsigned long when)
|
||||
block->b_when = when;
|
||||
}
|
||||
|
||||
static void nlmsvc_insert_block(struct nlm_block *block, unsigned long when)
|
||||
{
|
||||
spin_lock(&nlm_blocked_lock);
|
||||
nlmsvc_insert_block_locked(block, when);
|
||||
spin_unlock(&nlm_blocked_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove a block from the global list
|
||||
*/
|
||||
@@ -94,7 +102,9 @@ static inline void
|
||||
nlmsvc_remove_block(struct nlm_block *block)
|
||||
{
|
||||
if (!list_empty(&block->b_list)) {
|
||||
spin_lock(&nlm_blocked_lock);
|
||||
list_del_init(&block->b_list);
|
||||
spin_unlock(&nlm_blocked_lock);
|
||||
nlmsvc_release_block(block);
|
||||
}
|
||||
}
|
||||
@@ -651,7 +661,7 @@ static int nlmsvc_grant_deferred(struct file_lock *fl, struct file_lock *conf,
|
||||
struct nlm_block *block;
|
||||
int rc = -ENOENT;
|
||||
|
||||
lock_kernel();
|
||||
spin_lock(&nlm_blocked_lock);
|
||||
list_for_each_entry(block, &nlm_blocked, b_list) {
|
||||
if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) {
|
||||
dprintk("lockd: nlmsvc_notify_blocked block %p flags %d\n",
|
||||
@@ -665,13 +675,13 @@ static int nlmsvc_grant_deferred(struct file_lock *fl, struct file_lock *conf,
|
||||
} else if (result == 0)
|
||||
block->b_granted = 1;
|
||||
|
||||
nlmsvc_insert_block(block, 0);
|
||||
nlmsvc_insert_block_locked(block, 0);
|
||||
svc_wake_up(block->b_daemon);
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
unlock_kernel();
|
||||
spin_unlock(&nlm_blocked_lock);
|
||||
if (rc == -ENOENT)
|
||||
printk(KERN_WARNING "lockd: grant for unknown block\n");
|
||||
return rc;
|
||||
@@ -803,7 +813,7 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
|
||||
|
||||
dprintk("lockd: GRANT_MSG RPC callback\n");
|
||||
|
||||
lock_kernel();
|
||||
spin_lock(&nlm_blocked_lock);
|
||||
/* if the block is not on a list at this point then it has
|
||||
* been invalidated. Don't try to requeue it.
|
||||
*
|
||||
@@ -825,19 +835,20 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
|
||||
/* Call was successful, now wait for client callback */
|
||||
timeout = 60 * HZ;
|
||||
}
|
||||
nlmsvc_insert_block(block, timeout);
|
||||
nlmsvc_insert_block_locked(block, timeout);
|
||||
svc_wake_up(block->b_daemon);
|
||||
out:
|
||||
unlock_kernel();
|
||||
spin_unlock(&nlm_blocked_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: nlmsvc_release_block() grabs a mutex. This is not allowed for an
|
||||
* .rpc_release rpc_call_op
|
||||
*/
|
||||
static void nlmsvc_grant_release(void *data)
|
||||
{
|
||||
struct nlm_rqst *call = data;
|
||||
|
||||
lock_kernel();
|
||||
nlmsvc_release_block(call->a_block);
|
||||
unlock_kernel();
|
||||
}
|
||||
|
||||
static const struct rpc_call_ops nlmsvc_grant_ops = {
|
||||
|
@@ -260,9 +260,7 @@ static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
|
||||
|
||||
static void nlmsvc_callback_release(void *data)
|
||||
{
|
||||
lock_kernel();
|
||||
nlm_release_call(data);
|
||||
unlock_kernel();
|
||||
}
|
||||
|
||||
static const struct rpc_call_ops nlmsvc_callback_ops = {
|
||||
|
Reference in New Issue
Block a user