aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index f3a2abf28a77..98b6e50bde04 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -61,6 +61,14 @@ struct inode *ceph_get_inode(struct super_block *sb, struct ceph_vino vino)
61 return inode; 61 return inode;
62} 62}
63 63
64struct inode *ceph_lookup_inode(struct super_block *sb, struct ceph_vino vino)
65{
66 struct inode *inode;
67 ino_t t = ceph_vino_to_ino(vino);
68 inode = ilookup5_nowait(sb, t, ceph_ino_compare, &vino);
69 return inode;
70}
71
64/* 72/*
65 * get/constuct snapdir inode for a given directory 73 * get/constuct snapdir inode for a given directory
66 */ 74 */
@@ -1465,7 +1473,14 @@ static void ceph_vmtruncate_work(struct work_struct *work)
1465 struct inode *inode = &ci->vfs_inode; 1473 struct inode *inode = &ci->vfs_inode;
1466 1474
1467 dout("vmtruncate_work %p\n", inode); 1475 dout("vmtruncate_work %p\n", inode);
1468 mutex_lock(&inode->i_mutex); 1476 if (!mutex_trylock(&inode->i_mutex)) {
1477 /*
1478 * the i_mutex can be hold by a writer who is waiting for
1479 * caps. wake up waiters, they will do pending vmtruncate.
1480 */
1481 wake_up_all(&ci->i_cap_wq);
1482 mutex_lock(&inode->i_mutex);
1483 }
1469 __ceph_do_pending_vmtruncate(inode); 1484 __ceph_do_pending_vmtruncate(inode);
1470 mutex_unlock(&inode->i_mutex); 1485 mutex_unlock(&inode->i_mutex);
1471 iput(inode); 1486 iput(inode);