On Wed, 26 Dec 2012, lollipop wrote: > 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! 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 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html