diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2015-11-09 16:06:53 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2016-01-08 11:34:17 -0500 |
commit | a333e4bf2556b93c908e56b39be7bbd555f1b6cc (patch) | |
tree | ed776b1a18cc9654c2c8ec536081d31e222df33e | |
parent | 3053600ed4f71115631258f0d64eca0d10b11bdc (diff) |
fs/9p: use fscache mutex rather than spinlock
We may sleep inside a the lock, so use a mutex rather than spinlock.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r-- | fs/9p/cache.c | 8 | ||||
-rw-r--r-- | fs/9p/v9fs.h | 2 | ||||
-rw-r--r-- | fs/9p/vfs_inode.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/9p/cache.c b/fs/9p/cache.c index a69260f27555..103ca5e1267b 100644 --- a/fs/9p/cache.c +++ b/fs/9p/cache.c | |||
@@ -243,14 +243,14 @@ void v9fs_cache_inode_set_cookie(struct inode *inode, struct file *filp) | |||
243 | if (!v9inode->fscache) | 243 | if (!v9inode->fscache) |
244 | return; | 244 | return; |
245 | 245 | ||
246 | spin_lock(&v9inode->fscache_lock); | 246 | mutex_lock(&v9inode->fscache_lock); |
247 | 247 | ||
248 | if ((filp->f_flags & O_ACCMODE) != O_RDONLY) | 248 | if ((filp->f_flags & O_ACCMODE) != O_RDONLY) |
249 | v9fs_cache_inode_flush_cookie(inode); | 249 | v9fs_cache_inode_flush_cookie(inode); |
250 | else | 250 | else |
251 | v9fs_cache_inode_get_cookie(inode); | 251 | v9fs_cache_inode_get_cookie(inode); |
252 | 252 | ||
253 | spin_unlock(&v9inode->fscache_lock); | 253 | mutex_unlock(&v9inode->fscache_lock); |
254 | } | 254 | } |
255 | 255 | ||
256 | void v9fs_cache_inode_reset_cookie(struct inode *inode) | 256 | void v9fs_cache_inode_reset_cookie(struct inode *inode) |
@@ -264,7 +264,7 @@ void v9fs_cache_inode_reset_cookie(struct inode *inode) | |||
264 | 264 | ||
265 | old = v9inode->fscache; | 265 | old = v9inode->fscache; |
266 | 266 | ||
267 | spin_lock(&v9inode->fscache_lock); | 267 | mutex_lock(&v9inode->fscache_lock); |
268 | fscache_relinquish_cookie(v9inode->fscache, 1); | 268 | fscache_relinquish_cookie(v9inode->fscache, 1); |
269 | 269 | ||
270 | v9ses = v9fs_inode2v9ses(inode); | 270 | v9ses = v9fs_inode2v9ses(inode); |
@@ -274,7 +274,7 @@ void v9fs_cache_inode_reset_cookie(struct inode *inode) | |||
274 | p9_debug(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p\n", | 274 | p9_debug(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p\n", |
275 | inode, old, v9inode->fscache); | 275 | inode, old, v9inode->fscache); |
276 | 276 | ||
277 | spin_unlock(&v9inode->fscache_lock); | 277 | mutex_unlock(&v9inode->fscache_lock); |
278 | } | 278 | } |
279 | 279 | ||
280 | int __v9fs_fscache_release_page(struct page *page, gfp_t gfp) | 280 | int __v9fs_fscache_release_page(struct page *page, gfp_t gfp) |
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h index 0923f2cf3c80..6877050384a1 100644 --- a/fs/9p/v9fs.h +++ b/fs/9p/v9fs.h | |||
@@ -123,7 +123,7 @@ struct v9fs_session_info { | |||
123 | 123 | ||
124 | struct v9fs_inode { | 124 | struct v9fs_inode { |
125 | #ifdef CONFIG_9P_FSCACHE | 125 | #ifdef CONFIG_9P_FSCACHE |
126 | spinlock_t fscache_lock; | 126 | struct mutex fscache_lock; |
127 | struct fscache_cookie *fscache; | 127 | struct fscache_cookie *fscache; |
128 | #endif | 128 | #endif |
129 | struct p9_qid qid; | 129 | struct p9_qid qid; |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 699941e90667..b0358db2f472 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -244,7 +244,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb) | |||
244 | return NULL; | 244 | return NULL; |
245 | #ifdef CONFIG_9P_FSCACHE | 245 | #ifdef CONFIG_9P_FSCACHE |
246 | v9inode->fscache = NULL; | 246 | v9inode->fscache = NULL; |
247 | spin_lock_init(&v9inode->fscache_lock); | 247 | mutex_init(&v9inode->fscache_lock); |
248 | #endif | 248 | #endif |
249 | v9inode->writeback_fid = NULL; | 249 | v9inode->writeback_fid = NULL; |
250 | v9inode->cache_validity = 0; | 250 | v9inode->cache_validity = 0; |