mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
Merge branch 'linus'
This commit is contained in:
commit
1ebbe2b200
2612 changed files with 133886 additions and 100475 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/proc_fs.h>
|
||||
#include <linux/net.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <asm/ioctls.h>
|
||||
#include <linux/sunrpc/types.h>
|
||||
#include <linux/sunrpc/cache.h>
|
||||
|
|
@ -532,7 +533,7 @@ void cache_clean_deferred(void *owner)
|
|||
*/
|
||||
|
||||
static DEFINE_SPINLOCK(queue_lock);
|
||||
static DECLARE_MUTEX(queue_io_sem);
|
||||
static DEFINE_MUTEX(queue_io_mutex);
|
||||
|
||||
struct cache_queue {
|
||||
struct list_head list;
|
||||
|
|
@ -561,7 +562,7 @@ cache_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos)
|
|||
if (count == 0)
|
||||
return 0;
|
||||
|
||||
down(&queue_io_sem); /* protect against multiple concurrent
|
||||
mutex_lock(&queue_io_mutex); /* protect against multiple concurrent
|
||||
* readers on this file */
|
||||
again:
|
||||
spin_lock(&queue_lock);
|
||||
|
|
@ -574,7 +575,7 @@ cache_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos)
|
|||
}
|
||||
if (rp->q.list.next == &cd->queue) {
|
||||
spin_unlock(&queue_lock);
|
||||
up(&queue_io_sem);
|
||||
mutex_unlock(&queue_io_mutex);
|
||||
BUG_ON(rp->offset);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -621,11 +622,11 @@ cache_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos)
|
|||
}
|
||||
if (err == -EAGAIN)
|
||||
goto again;
|
||||
up(&queue_io_sem);
|
||||
mutex_unlock(&queue_io_mutex);
|
||||
return err ? err : count;
|
||||
}
|
||||
|
||||
static char write_buf[8192]; /* protected by queue_io_sem */
|
||||
static char write_buf[8192]; /* protected by queue_io_mutex */
|
||||
|
||||
static ssize_t
|
||||
cache_write(struct file *filp, const char __user *buf, size_t count,
|
||||
|
|
@ -639,10 +640,10 @@ cache_write(struct file *filp, const char __user *buf, size_t count,
|
|||
if (count >= sizeof(write_buf))
|
||||
return -EINVAL;
|
||||
|
||||
down(&queue_io_sem);
|
||||
mutex_lock(&queue_io_mutex);
|
||||
|
||||
if (copy_from_user(write_buf, buf, count)) {
|
||||
up(&queue_io_sem);
|
||||
mutex_unlock(&queue_io_mutex);
|
||||
return -EFAULT;
|
||||
}
|
||||
write_buf[count] = '\0';
|
||||
|
|
@ -651,7 +652,7 @@ cache_write(struct file *filp, const char __user *buf, size_t count,
|
|||
else
|
||||
err = -EINVAL;
|
||||
|
||||
up(&queue_io_sem);
|
||||
mutex_unlock(&queue_io_mutex);
|
||||
return err ? err : count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#include <linux/sunrpc/clnt.h>
|
||||
#include <linux/sunrpc/xprt.h>
|
||||
|
|
@ -62,7 +63,7 @@ static LIST_HEAD(all_tasks);
|
|||
/*
|
||||
* rpciod-related stuff
|
||||
*/
|
||||
static DECLARE_MUTEX(rpciod_sema);
|
||||
static DEFINE_MUTEX(rpciod_mutex);
|
||||
static unsigned int rpciod_users;
|
||||
struct workqueue_struct *rpciod_workqueue;
|
||||
|
||||
|
|
@ -1055,7 +1056,7 @@ rpciod_up(void)
|
|||
struct workqueue_struct *wq;
|
||||
int error = 0;
|
||||
|
||||
down(&rpciod_sema);
|
||||
mutex_lock(&rpciod_mutex);
|
||||
dprintk("rpciod_up: users %d\n", rpciod_users);
|
||||
rpciod_users++;
|
||||
if (rpciod_workqueue)
|
||||
|
|
@ -1078,14 +1079,14 @@ rpciod_up(void)
|
|||
rpciod_workqueue = wq;
|
||||
error = 0;
|
||||
out:
|
||||
up(&rpciod_sema);
|
||||
mutex_unlock(&rpciod_mutex);
|
||||
return error;
|
||||
}
|
||||
|
||||
void
|
||||
rpciod_down(void)
|
||||
{
|
||||
down(&rpciod_sema);
|
||||
mutex_lock(&rpciod_mutex);
|
||||
dprintk("rpciod_down sema %d\n", rpciod_users);
|
||||
if (rpciod_users) {
|
||||
if (--rpciod_users)
|
||||
|
|
@ -1102,7 +1103,7 @@ rpciod_down(void)
|
|||
destroy_workqueue(rpciod_workqueue);
|
||||
rpciod_workqueue = NULL;
|
||||
out:
|
||||
up(&rpciod_sema);
|
||||
mutex_unlock(&rpciod_mutex);
|
||||
}
|
||||
|
||||
#ifdef RPC_DEBUG
|
||||
|
|
|
|||
|
|
@ -1296,13 +1296,13 @@ svc_send(struct svc_rqst *rqstp)
|
|||
xb->page_len +
|
||||
xb->tail[0].iov_len;
|
||||
|
||||
/* Grab svsk->sk_sem to serialize outgoing data. */
|
||||
down(&svsk->sk_sem);
|
||||
/* Grab svsk->sk_mutex to serialize outgoing data. */
|
||||
mutex_lock(&svsk->sk_mutex);
|
||||
if (test_bit(SK_DEAD, &svsk->sk_flags))
|
||||
len = -ENOTCONN;
|
||||
else
|
||||
len = svsk->sk_sendto(rqstp);
|
||||
up(&svsk->sk_sem);
|
||||
mutex_unlock(&svsk->sk_mutex);
|
||||
svc_sock_release(rqstp);
|
||||
|
||||
if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN)
|
||||
|
|
@ -1351,7 +1351,7 @@ svc_setup_socket(struct svc_serv *serv, struct socket *sock,
|
|||
svsk->sk_lastrecv = get_seconds();
|
||||
INIT_LIST_HEAD(&svsk->sk_deferred);
|
||||
INIT_LIST_HEAD(&svsk->sk_ready);
|
||||
sema_init(&svsk->sk_sem, 1);
|
||||
mutex_init(&svsk->sk_mutex);
|
||||
|
||||
/* Initialize the socket */
|
||||
if (sock->type == SOCK_DGRAM)
|
||||
|
|
|
|||
Loading…
Reference in a new issue