summaryrefslogtreecommitdiffstats
path: root/fs/ceph/snap.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-02-21 15:01:38 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-02-21 15:01:38 -0800
commit8bd89ca22010847e85de37b77d9f19f16b1962ad (patch)
tree0bcee2ae6a85443177a6d95ed960301e0f4c9d57 /fs/ceph/snap.c
parentb08b69a110bd981909c248f89997dcdcdfd5a39c (diff)
parent97d79b403ef03f729883246208ef5d8a2ebc4d68 (diff)
downloadtalos-op-linux-8bd89ca22010847e85de37b77d9f19f16b1962ad.tar.gz
talos-op-linux-8bd89ca22010847e85de37b77d9f19f16b1962ad.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: ceph: keep reference to parent inode on ceph_dentry ceph: queue cap_snaps once per realm libceph: fix socket write error handling libceph: fix socket read error handling
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r--fs/ceph/snap.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
index 39c243acd062..f40b9139e437 100644
--- a/fs/ceph/snap.c
+++ b/fs/ceph/snap.c
@@ -584,10 +584,14 @@ static void queue_realm_cap_snaps(struct ceph_snap_realm *realm)
if (lastinode)
iput(lastinode);
- dout("queue_realm_cap_snaps %p %llx children\n", realm, realm->ino);
- list_for_each_entry(child, &realm->children, child_item)
- queue_realm_cap_snaps(child);
+ list_for_each_entry(child, &realm->children, child_item) {
+ dout("queue_realm_cap_snaps %p %llx queue child %p %llx\n",
+ realm, realm->ino, child, child->ino);
+ list_del_init(&child->dirty_item);
+ list_add(&child->dirty_item, &realm->dirty_item);
+ }
+ list_del_init(&realm->dirty_item);
dout("queue_realm_cap_snaps %p %llx done\n", realm, realm->ino);
}
@@ -683,7 +687,9 @@ more:
* queue cap snaps _after_ we've built the new snap contexts,
* so that i_head_snapc can be set appropriately.
*/
- list_for_each_entry(realm, &dirty_realms, dirty_item) {
+ while (!list_empty(&dirty_realms)) {
+ realm = list_first_entry(&dirty_realms, struct ceph_snap_realm,
+ dirty_item);
queue_realm_cap_snaps(realm);
}
OpenPOWER on IntegriCloud