]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: recast _rmattr on top of chain_f*
authorSage Weil <sage@inktank.com>
Sat, 27 Oct 2012 22:38:02 +0000 (15:38 -0700)
committerSage Weil <sage@inktank.com>
Mon, 5 Nov 2012 08:13:53 +0000 (00:13 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
src/os/FileStore.cc

index 96a5620796f211f9cc6ec7ca787c58b3d1d73a08..465e0af81c998c11b0540e7a07daf3649da9073e 100644 (file)
@@ -3890,9 +3890,15 @@ int FileStore::_rmattr(coll_t cid, const hobject_t& oid, const char *name,
                       const SequencerPosition &spos)
 {
   dout(15) << "rmattr " << cid << "/" << oid << " '" << name << "'" << dendl;
+  int r = 0;
+  int fd = lfn_open(cid, oid, 0);
+  if (fd < 0) {
+    r = -errno;
+    goto out;
+  }
   char n[CHAIN_XATTR_MAX_NAME_LEN];
   get_attrname(name, n, CHAIN_XATTR_MAX_NAME_LEN);
-  int r = lfn_removexattr(cid, oid, n);
+  r = chain_fremovexattr(fd, n);
   if (r == -ENODATA && g_conf->filestore_xattr_use_omap) {
     Index index;
     r = get_index(cid, &index);
@@ -3909,6 +3915,8 @@ int FileStore::_rmattr(coll_t cid, const hobject_t& oid, const char *name,
       return r;
     }
   }
+  TEMP_FAILURE_RETRY(::close(fd));
+ out:
   dout(10) << "rmattr " << cid << "/" << oid << " '" << name << "' = " << r << dendl;
   return r;
 }