aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/cache.c')
-rw-r--r--net/sunrpc/cache.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 5e4f815c2b34..2b32fd602669 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -771,7 +771,7 @@ static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
771 if (count == 0) 771 if (count == 0)
772 return 0; 772 return 0;
773 773
774 mutex_lock(&inode->i_mutex); /* protect against multiple concurrent 774 inode_lock(inode); /* protect against multiple concurrent
775 * readers on this file */ 775 * readers on this file */
776 again: 776 again:
777 spin_lock(&queue_lock); 777 spin_lock(&queue_lock);
@@ -784,7 +784,7 @@ static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
784 } 784 }
785 if (rp->q.list.next == &cd->queue) { 785 if (rp->q.list.next == &cd->queue) {
786 spin_unlock(&queue_lock); 786 spin_unlock(&queue_lock);
787 mutex_unlock(&inode->i_mutex); 787 inode_unlock(inode);
788 WARN_ON_ONCE(rp->offset); 788 WARN_ON_ONCE(rp->offset);
789 return 0; 789 return 0;
790 } 790 }
@@ -838,7 +838,7 @@ static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
838 } 838 }
839 if (err == -EAGAIN) 839 if (err == -EAGAIN)
840 goto again; 840 goto again;
841 mutex_unlock(&inode->i_mutex); 841 inode_unlock(inode);
842 return err ? err : count; 842 return err ? err : count;
843} 843}
844 844
@@ -909,9 +909,9 @@ static ssize_t cache_write(struct file *filp, const char __user *buf,
909 if (!cd->cache_parse) 909 if (!cd->cache_parse)
910 goto out; 910 goto out;
911 911
912 mutex_lock(&inode->i_mutex); 912 inode_lock(inode);
913 ret = cache_downcall(mapping, buf, count, cd); 913 ret = cache_downcall(mapping, buf, count, cd);
914 mutex_unlock(&inode->i_mutex); 914 inode_unlock(inode);
915out: 915out:
916 return ret; 916 return ret;
917} 917}