]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: use _fgetattrs() for GETATTRS op
authorSage Weil <sage@inktank.com>
Sat, 27 Oct 2012 22:05:59 +0000 (15:05 -0700)
committerSage Weil <sage@inktank.com>
Mon, 5 Nov 2012 08:13:52 +0000 (00:13 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
src/os/FileStore.cc

index 9f354507e0c41b8471c5b9f25403f17821566077..9013e08fb94787198aa3aa40df04370c79a83f7e 100644 (file)
@@ -3888,7 +3888,14 @@ int FileStore::getattr(coll_t cid, const hobject_t& oid, const char *name, buffe
 int FileStore::getattrs(coll_t cid, const hobject_t& oid, map<string,bufferptr>& aset, bool user_only) 
 {
   dout(15) << "getattrs " << cid << "/" << oid << dendl;
-  int r = _getattrs(cid, oid, aset, user_only);
+  int r;
+  int fd = lfn_open(cid, oid, 0);
+  if (fd < 0) {
+    r = -errno;
+    goto out;
+  }
+  r = _fgetattrs(fd, aset, user_only);
+  TEMP_FAILURE_RETRY(::close(fd));
   if (g_conf->filestore_xattr_use_omap) {
     set<string> omap_attrs;
     map<string, bufferlist> omap_aset;