return r;
}
+int Client::fstatx(int fd, struct ceph_statx *stx, unsigned int want, unsigned int flags)
+{
+ Mutex::Locker lock(client_lock);
+ tout(cct) << "fstatx flags " << hex << flags << " want " << want << dec << std::endl;
+ tout(cct) << fd << std::endl;
+
+ Fh *f = get_filehandle(fd);
+ if (!f)
+ return -EBADF;
+
+ unsigned mask = statx_to_mask(flags, want);
+
+ int r = 0;
+ if (mask && !f->inode->caps_issued_mask(mask)) {
+ r = _getattr(f->inode, mask);
+ if (r < 0) {
+ ldout(cct, 3) << "fstatx exit on error!" << dendl;
+ return r;
+ }
+ }
+
+ fill_statx(f->inode, mask, stx);
+ ldout(cct, 3) << "fstatx(" << fd << ", " << stx << ") = " << r << dendl;
+ return r;
+}
// not written yet, but i want to link!
int ftruncate(int fd, loff_t size);
int fsync(int fd, bool syncdataonly);
int fstat(int fd, struct stat *stbuf, int mask=CEPH_STAT_CAP_INODE_ALL);
+ int fstatx(int fd, struct ceph_statx *stx, unsigned int want, unsigned int flags);
int fallocate(int fd, int mode, loff_t offset, loff_t length);
// full path xattr ops
*/
int ceph_fstat(struct ceph_mount_info *cmount, int fd, struct stat *stbuf);
+/**
+ * Get an open file's extended statistics and attributes.
+ *
+ * @param cmount the ceph mount handle to use for performing the stat.
+ * @param fd the file descriptor of the file to get statistics of.
+ * @param stx the ceph_statx struct that will be filled in with the file's statistics.
+ * @param want bitfield of CEPH_STATX_* flags showing designed attributes
+ * @param flags bitfield that can be used to set AT_* modifier flags (only AT_NO_ATTR_SYNC and AT_SYMLINK_NOFOLLOW)
+ * @returns 0 on success or negative error code on failure.
+ */
+int ceph_fstatx(struct ceph_mount_info *cmount, int fd, struct ceph_statx *stx,
+ unsigned int want, unsigned int flags);
+
/** @} file */
/**
return cmount->get_client()->fstat(fd, stbuf);
}
+extern "C" int ceph_fstatx(struct ceph_mount_info *cmount, int fd, struct ceph_statx *stx,
+ unsigned int want, unsigned int flags)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+ return cmount->get_client()->fstatx(fd, stx, want, flags);
+}
+
extern "C" int ceph_sync_fs(struct ceph_mount_info *cmount)
{
if (!cmount->is_mounted())