]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: use _fgetattrs() from collection_getattr()
authorSage Weil <sage@inktank.com>
Sat, 27 Oct 2012 22:11:42 +0000 (15:11 -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 333a6df630920247ac3d29b7627a5312286a6595..c6c3f449d987188d40854bc22d4fabf717930cae 100644 (file)
@@ -4144,7 +4144,15 @@ int FileStore::collection_getattrs(coll_t cid, map<string,bufferptr>& aset)
   char fn[PATH_MAX];
   get_cdir(cid, fn, sizeof(fn));
   dout(10) << "collection_getattrs " << fn << dendl;
-  int r = _getattrs(fn, aset);
+  int r;
+  int fd = ::open(fn, O_RDONLY);
+  if (fd < 0) {
+    r = -errno;
+    goto out;
+  }
+  r = _fgetattrs(fd, aset, true);
+  TEMP_FAILURE_RETRY(::close(fd));
+ out:
   dout(10) << "collection_getattrs " << fn << " = " << r << dendl;
   assert(!m_filestore_fail_eio || r != -EIO);
   return r;