diff options
author | Sage Weil <sage@inktank.com> | 2013-09-03 15:03:32 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-09 16:55:21 -0700 |
commit | 661b377c28b5b94da17c644d8c501edb715176b0 (patch) | |
tree | 5684cd64e4b1b930ad8e491413fed9f56845299d | |
parent | 04120360e311150101f71fe202fbc00c05bd284c (diff) | |
download | ceph-661b377c28b5b94da17c644d8c501edb715176b0.tar.gz |
os/FileStore: pass old + new object name to lfn_link
For now, the only caller leaves the name the same.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/os/FileStore.cc | 14 | ||||
-rw-r--r-- | src/os/FileStore.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 7ef415213b0..8b27246dfdf 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -246,14 +246,14 @@ void FileStore::lfn_close(FDRef fd) { } -int FileStore::lfn_link(coll_t c, coll_t cid, const hobject_t& o) +int FileStore::lfn_link(coll_t c, coll_t newcid, const hobject_t& o, const hobject_t& newoid) { Index index_new, index_old; IndexedPath path_new, path_old; int exist; int r; - if (c < cid) { - r = get_index(cid, &index_new); + if (c < newcid) { + r = get_index(newcid, &index_new); if (r < 0) return r; r = get_index(c, &index_old); @@ -263,7 +263,7 @@ int FileStore::lfn_link(coll_t c, coll_t cid, const hobject_t& o) r = get_index(c, &index_old); if (r < 0) return r; - r = get_index(cid, &index_new); + r = get_index(newcid, &index_new); if (r < 0) return r; } @@ -276,7 +276,7 @@ int FileStore::lfn_link(coll_t c, coll_t cid, const hobject_t& o) if (!exist) return -ENOENT; - r = index_new->lookup(o, &path_new, &exist); + r = index_new->lookup(newoid, &path_new, &exist); if (r < 0) { assert(!m_filestore_fail_eio || r != -EIO); return r; @@ -290,7 +290,7 @@ int FileStore::lfn_link(coll_t c, coll_t cid, const hobject_t& o) if (r < 0) return -errno; - r = index_new->created(o, path_new->path()); + r = index_new->created(newoid, path_new->path()); if (r < 0) { assert(!m_filestore_fail_eio || r != -EIO); return r; @@ -4116,7 +4116,7 @@ int FileStore::_collection_add(coll_t c, coll_t oldcid, const hobject_t& o, _set_replay_guard(**fd, spos, &o, true); } - r = lfn_link(oldcid, c, o); + r = lfn_link(oldcid, c, o, o); if (replaying && !backend->can_checkpoint() && r == -EEXIST) // crashed between link() and set_replay_guard() r = 0; diff --git a/src/os/FileStore.h b/src/os/FileStore.h index c603949b399..19178be4154 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -298,7 +298,7 @@ public: IndexedPath *path = 0, Index *index = 0); void lfn_close(FDRef fd); - int lfn_link(coll_t c, coll_t cid, const hobject_t& o) ; + int lfn_link(coll_t c, coll_t newcid, const hobject_t& o, const hobject_t& newoid) ; int lfn_unlink(coll_t cid, const hobject_t& o, const SequencerPosition &spos); public: |