aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/dir.c6
-rw-r--r--fs/ceph/inode.c4
2 files changed, 1 insertions, 9 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 2c924e8d85fe..58abc3da6111 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -112,7 +112,6 @@ static int __dcache_readdir(struct file *filp,
112 dout("__dcache_readdir %p at %llu (last %p)\n", dir, filp->f_pos, 112 dout("__dcache_readdir %p at %llu (last %p)\n", dir, filp->f_pos,
113 last); 113 last);
114 114
115 spin_lock(&dcache_lock);
116 spin_lock(&parent->d_lock); 115 spin_lock(&parent->d_lock);
117 116
118 /* start at beginning? */ 117 /* start at beginning? */
@@ -156,7 +155,6 @@ more:
156 dget_dlock(dentry); 155 dget_dlock(dentry);
157 spin_unlock(&dentry->d_lock); 156 spin_unlock(&dentry->d_lock);
158 spin_unlock(&parent->d_lock); 157 spin_unlock(&parent->d_lock);
159 spin_unlock(&dcache_lock);
160 158
161 dout(" %llu (%llu) dentry %p %.*s %p\n", di->offset, filp->f_pos, 159 dout(" %llu (%llu) dentry %p %.*s %p\n", di->offset, filp->f_pos,
162 dentry, dentry->d_name.len, dentry->d_name.name, dentry->d_inode); 160 dentry, dentry->d_name.len, dentry->d_name.name, dentry->d_inode);
@@ -182,21 +180,19 @@ more:
182 180
183 filp->f_pos++; 181 filp->f_pos++;
184 182
185 /* make sure a dentry wasn't dropped while we didn't have dcache_lock */ 183 /* make sure a dentry wasn't dropped while we didn't have parent lock */
186 if (!ceph_i_test(dir, CEPH_I_COMPLETE)) { 184 if (!ceph_i_test(dir, CEPH_I_COMPLETE)) {
187 dout(" lost I_COMPLETE on %p; falling back to mds\n", dir); 185 dout(" lost I_COMPLETE on %p; falling back to mds\n", dir);
188 err = -EAGAIN; 186 err = -EAGAIN;
189 goto out; 187 goto out;
190 } 188 }
191 189
192 spin_lock(&dcache_lock);
193 spin_lock(&parent->d_lock); 190 spin_lock(&parent->d_lock);
194 p = p->prev; /* advance to next dentry */ 191 p = p->prev; /* advance to next dentry */
195 goto more; 192 goto more;
196 193
197out_unlock: 194out_unlock:
198 spin_unlock(&parent->d_lock); 195 spin_unlock(&parent->d_lock);
199 spin_unlock(&dcache_lock);
200out: 196out:
201 if (last) 197 if (last)
202 dput(last); 198 dput(last);
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 2c6944473366..2a48cafc174b 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -841,7 +841,6 @@ static void ceph_set_dentry_offset(struct dentry *dn)
841 di->offset = ceph_inode(inode)->i_max_offset++; 841 di->offset = ceph_inode(inode)->i_max_offset++;
842 spin_unlock(&inode->i_lock); 842 spin_unlock(&inode->i_lock);
843 843
844 spin_lock(&dcache_lock);
845 spin_lock(&dir->d_lock); 844 spin_lock(&dir->d_lock);
846 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED); 845 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
847 list_move(&dn->d_u.d_child, &dir->d_subdirs); 846 list_move(&dn->d_u.d_child, &dir->d_subdirs);
@@ -849,7 +848,6 @@ static void ceph_set_dentry_offset(struct dentry *dn)
849 dn->d_u.d_child.prev, dn->d_u.d_child.next); 848 dn->d_u.d_child.prev, dn->d_u.d_child.next);
850 spin_unlock(&dn->d_lock); 849 spin_unlock(&dn->d_lock);
851 spin_unlock(&dir->d_lock); 850 spin_unlock(&dir->d_lock);
852 spin_unlock(&dcache_lock);
853} 851}
854 852
855/* 853/*
@@ -1233,13 +1231,11 @@ retry_lookup:
1233 goto retry_lookup; 1231 goto retry_lookup;
1234 } else { 1232 } else {
1235 /* reorder parent's d_subdirs */ 1233 /* reorder parent's d_subdirs */
1236 spin_lock(&dcache_lock);
1237 spin_lock(&parent->d_lock); 1234 spin_lock(&parent->d_lock);
1238 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED); 1235 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
1239 list_move(&dn->d_u.d_child, &parent->d_subdirs); 1236 list_move(&dn->d_u.d_child, &parent->d_subdirs);
1240 spin_unlock(&dn->d_lock); 1237 spin_unlock(&dn->d_lock);
1241 spin_unlock(&parent->d_lock); 1238 spin_unlock(&parent->d_lock);
1242 spin_unlock(&dcache_lock);
1243 } 1239 }
1244 1240
1245 di = dn->d_fsdata; 1241 di = dn->d_fsdata;