From: Jeff Layton Date: Mon, 24 Oct 2016 14:02:58 +0000 (-0400) Subject: client: remove ceph_stat, ceph_lstat, ceph_fstat, ceph_setattr, and ceph_fsetattr X-Git-Tag: v11.1.0~383^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce8c6f3c9f9f35b7458ab95d9affc9ed4712d0eb;p=ceph.git client: remove ceph_stat, ceph_lstat, ceph_fstat, ceph_setattr, and ceph_fsetattr ...there are no more callers. Signed-off-by: Jeff Layton --- diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index ca8de2066beb..117e7368a254 100644 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -611,16 +611,6 @@ int ceph_unlink(struct ceph_mount_info *cmount, const char *path); */ int ceph_rename(struct ceph_mount_info *cmount, const char *from, const char *to); -/** - * Get a file's statistics and attributes. - * - * @param cmount the ceph mount handle to use for performing the stat. - * @param path the file or directory to get the statistics of. - * @param stbuf the stat struct that will be filled in with the file's statistics. - * @returns 0 on success or negative error code on failure. - */ -int ceph_stat(struct ceph_mount_info *cmount, const char *path, struct stat *stbuf); - /** * Get a file's extended statistics and attributes. * @@ -634,29 +624,8 @@ int ceph_stat(struct ceph_mount_info *cmount, const char *path, struct stat *stb int ceph_statx(struct ceph_mount_info *cmount, const char *path, struct ceph_statx *stx, unsigned int want, unsigned int flags); -/** - * Get a file's statistics and attributes, without following symlinks. - * - * @param cmount the ceph mount handle to use for performing the stat. - * @param path the file or directory to get the statistics of. - * @param stbuf the stat struct that will be filled in with the file's statistics. - * @returns 0 on success or negative error code on failure. - */ -int ceph_lstat(struct ceph_mount_info *cmount, const char *path, struct stat *stbuf); - /** * Set a file's attributes. - * - * @param cmount the ceph mount handle to use for performing the setattr. - * @param relpath the path to the file/directory to set the attributes of. - * @param attr the stat struct that must include attribute values to set on the file. - * @param mask a mask of all the CEPH_SETATTR_* values that have been set in the stat struct. - * @returns 0 on success or negative error code on failure. - */ -int ceph_setattr(struct ceph_mount_info *cmount, const char *relpath, struct stat *attr, int mask); - -/** - * Set a file's attributes (extended version). * * @param cmount the ceph mount handle to use for performing the setattr. * @param relpath the path to the file/directory to set the attributes of. @@ -667,17 +636,6 @@ int ceph_setattr(struct ceph_mount_info *cmount, const char *relpath, struct sta */ int ceph_setattrx(struct ceph_mount_info *cmount, const char *relpath, struct ceph_statx *stx, int mask, int flags); -/** - * Set a file's attributes. - * - * @param cmount the ceph mount handle to use for performing the setattr. - * @param fd the fd of the open file/directory to set the attributes of. - * @param attr the stat struct that must include attribute values to set on the file. - * @param mask a mask of all the stat values that have been set on the stat struct. - * @returns 0 on success or negative error code on failure. - */ -int ceph_fsetattr(struct ceph_mount_info *cmount, int fd, struct stat *attr, int mask); - /** * Set a file's attributes (extended version). * @@ -939,17 +897,6 @@ int ceph_fsync(struct ceph_mount_info *cmount, int fd, int syncdataonly); int ceph_fallocate(struct ceph_mount_info *cmount, int fd, int mode, int64_t offset, int64_t length); -/** - * Get the open file's statistics. - * - * @param cmount the ceph mount handle to use for performing the fstat. - * @param fd the file descriptor of the file to get statistics of. - * @param stbuf the stat struct of the file's statistics, filled in by the - * function. - * @returns 0 on success or a negative error code on failure - */ -int ceph_fstat(struct ceph_mount_info *cmount, int fd, struct stat *stbuf); - /** * Get an open file's extended statistics and attributes. * diff --git a/src/libcephfs.cc b/src/libcephfs.cc index bf3d414063b9..f5e31c9ccbdd 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -607,15 +607,6 @@ extern "C" int ceph_symlink(struct ceph_mount_info *cmount, const char *existing return cmount->get_client()->symlink(existing, newname, cmount->default_perms); } -// inode stuff -extern "C" int ceph_stat(struct ceph_mount_info *cmount, const char *path, - struct stat *stbuf) -{ - if (!cmount->is_mounted()) - return -ENOTCONN; - return cmount->get_client()->stat(path, stbuf, cmount->default_perms); -} - extern "C" int ceph_statx(struct ceph_mount_info *cmount, const char *path, struct ceph_statx *stx, unsigned int want, unsigned int flags) { @@ -625,30 +616,6 @@ extern "C" int ceph_statx(struct ceph_mount_info *cmount, const char *path, want, flags); } -extern "C" int ceph_lstat(struct ceph_mount_info *cmount, const char *path, - struct stat *stbuf) -{ - if (!cmount->is_mounted()) - return -ENOTCONN; - return cmount->get_client()->lstat(path, stbuf, cmount->default_perms); -} - -extern "C" int ceph_setattr(struct ceph_mount_info *cmount, const char *relpath, - struct stat *attr, int mask) -{ - if (!cmount->is_mounted()) - return -ENOTCONN; - return cmount->get_client()->setattr(relpath, attr, mask, cmount->default_perms); -} - -extern "C" int ceph_fsetattr(struct ceph_mount_info *cmount, int fd, - struct stat *attr, int mask) -{ - if (!cmount->is_mounted()) - return -ENOTCONN; - return cmount->get_client()->fsetattr(fd, attr, mask, cmount->default_perms); -} - extern "C" int ceph_fsetattrx(struct ceph_mount_info *cmount, int fd, struct ceph_statx *stx, int mask) { @@ -909,13 +876,6 @@ extern "C" int ceph_fallocate(struct ceph_mount_info *cmount, int fd, int mode, return cmount->get_client()->fallocate(fd, mode, offset, length); } -extern "C" int ceph_fstat(struct ceph_mount_info *cmount, int fd, struct stat *stbuf) -{ - if (!cmount->is_mounted()) - return -ENOTCONN; - return cmount->get_client()->fstat(fd, stbuf, cmount->default_perms); -} - extern "C" int ceph_fstatx(struct ceph_mount_info *cmount, int fd, struct ceph_statx *stx, unsigned int want, unsigned int flags) { diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index 919683f5724e..2f36b40b174e 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -1157,7 +1157,6 @@ TEST(LibCephFS, UseUnmounted) { EXPECT_EQ(-ENOTCONN, ceph_lremovexattr(cmount, "/path", "name")); EXPECT_EQ(-ENOTCONN, ceph_setxattr(cmount, "/path", "name", NULL, 0, 0)); EXPECT_EQ(-ENOTCONN, ceph_lsetxattr(cmount, "/path", "name", NULL, 0, 0)); - EXPECT_EQ(-ENOTCONN, ceph_fsetattr(cmount, 0, &st, 0)); EXPECT_EQ(-ENOTCONN, ceph_fsetattrx(cmount, 0, &stx, 0)); EXPECT_EQ(-ENOTCONN, ceph_chmod(cmount, "/path", 0)); EXPECT_EQ(-ENOTCONN, ceph_fchmod(cmount, 0, 0));