]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: use f*xattr() methods to test xattr support
authorSage Weil <sage@inktank.com>
Sat, 27 Oct 2012 21:40:08 +0000 (14:40 -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 86b8597c519c3782f72e1c2a2e74be5676cf2877..cd41cf1d38487218415d81512de6a931962e2f5b 100644 (file)
@@ -1038,9 +1038,9 @@ int FileStore::_detect_fs()
     return ret;
   }
 
-  int ret = chain_setxattr(fn, "user.test", &x, sizeof(x));
+  int ret = chain_fsetxattr(tmpfd, "user.test", &x, sizeof(x));
   if (ret >= 0)
-    ret = chain_getxattr(fn, "user.test", &y, sizeof(y));
+    ret = chain_fgetxattr(tmpfd, "user.test", &y, sizeof(y));
   if ((ret < 0) || (x != y)) {
     derr << "Extended attributes don't appear to work. ";
     if (ret)
@@ -1054,11 +1054,11 @@ int FileStore::_detect_fs()
 
   char buf[1000];
   memset(buf, 0, sizeof(buf)); // shut up valgrind
-  chain_setxattr(fn, "user.test", &buf, sizeof(buf));
-  chain_setxattr(fn, "user.test2", &buf, sizeof(buf));
-  chain_setxattr(fn, "user.test3", &buf, sizeof(buf));
-  chain_setxattr(fn, "user.test4", &buf, sizeof(buf));
-  ret = chain_setxattr(fn, "user.test5", &buf, sizeof(buf));
+  chain_fsetxattr(tmpfd, "user.test", &buf, sizeof(buf));
+  chain_fsetxattr(tmpfd, "user.test2", &buf, sizeof(buf));
+  chain_fsetxattr(tmpfd, "user.test3", &buf, sizeof(buf));
+  chain_fsetxattr(tmpfd, "user.test4", &buf, sizeof(buf));
+  ret = chain_fsetxattr(tmpfd, "user.test5", &buf, sizeof(buf));
   if (ret == -ENOSPC) {
     if (!g_conf->filestore_xattr_use_omap) {
       derr << "limited size xattrs -- enable filestore_xattr_use_omap" << dendl;
@@ -1069,11 +1069,11 @@ int FileStore::_detect_fs()
       derr << "limited size xattrs -- filestore_xattr_use_omap enabled" << dendl;
     }
   }
-  chain_removexattr(fn, "user.test");
-  chain_removexattr(fn, "user.test2");
-  chain_removexattr(fn, "user.test3");
-  chain_removexattr(fn, "user.test4");
-  chain_removexattr(fn, "user.test5");
+  chain_fremovexattr(tmpfd, "user.test");
+  chain_fremovexattr(tmpfd, "user.test2");
+  chain_fremovexattr(tmpfd, "user.test3");
+  chain_fremovexattr(tmpfd, "user.test4");
+  chain_fremovexattr(tmpfd, "user.test5");
 
   ::unlink(fn);
   TEMP_FAILURE_RETRY(::close(tmpfd));