return _setattr(in, &attr, CEPH_SETATTR_MODE);
}
+int Client::fchmod(int fd, mode_t mode)
+{
+ Mutex::Locker lock(client_lock);
+ tout(cct) << "fchmod" << std::endl;
+ tout(cct) << fd << std::endl;
+ tout(cct) << mode << std::endl;
+ assert(fd_map.count(fd));
+ Fh *f = fd_map[fd];
+ struct stat attr;
+ attr.st_mode = mode;
+ return _setattr(f->inode, &attr, CEPH_SETATTR_MODE);
+}
+
int Client::chown(const char *relpath, uid_t uid, gid_t gid)
{
Mutex::Locker lock(client_lock);
int setattr(const char *relpath, struct stat *attr, int mask);
int chmod(const char *path, mode_t mode);
+ int fchmod(int fd, mode_t mode);
int chown(const char *path, uid_t uid, gid_t gid);
int utime(const char *path, struct utimbuf *buf);
int truncate(const char *path, loff_t size);
* @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);
+
/**
* Change the mode bits (permissions) of a file/directory.
*
*/
int ceph_chmod(struct ceph_mount_info *cmount, const char *path, mode_t mode);
+/**
+ * Change the mode bits (permissions) of an open file.
+ *
+ * @param cmount the ceph mount handle to use for performing the chmod.
+ * @param fd the open file descriptor to change the mode bits on.
+ * @param mode the new permissions to set.
+ * @returns 0 on success or a negative error code on failure.
+ */
+int ceph_fchmod(struct ceph_mount_info *cmount, int fd, mode_t mode);
+
/**
* Change the ownership of a file/directory.
*
{
return cmount->get_client()->chmod(path, mode);
}
+extern "C" int ceph_fchmod(struct ceph_mount_info *cmount, int fd, mode_t mode)
+{
+ return cmount->get_client()->fchmod(fd, mode);
+}
extern "C" int ceph_chown(struct ceph_mount_info *cmount, const char *path,
uid_t uid, gid_t gid)
{