Any API to get metadata?
hello,there.
I am wondering if there is any API to get the metadata of a file . I have the ceph file system run by mounting it to the /mnt/ceph I want to know how many chunks the file has been parted,and where the chunks have been stored.
Is there any API I can use to get the information?
Thank you very much!
Quoted 7 lines · lollipop
hello,there.
I am wondering if there is any API to get the metadata of a file . I have the ceph file system run by mounting it to the/mnt/cephI want to know how many chunks the file has been parted,and where the chunks have been stored.
Is there any API I can use to get the information?
Thank you very much!
This is available via an ioctl on the mounted file system (see linux.git/include/linux/ceph/ioctl.h) or via libcephfs (see ceph.git/src/include/cephfs/libcephfs.h):
/* expose file layout */
int ceph_get_file_stripe_unit(struct ceph_mount_info *cmount, int fh); int ceph_get_file_pool(struct ceph_mount_info *cmount, int fh);
int ceph_get_file_replication(struct ceph_mount_info *cmount, int fh); int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fd, loff_t offset,
struct sockaddr_storage *addr, int naddr);
sage