Lines Matching refs:ondisk
934 static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk) in rbd_dev_ondisk_valid() argument
940 if (memcmp(&ondisk->text, RBD_HEADER_TEXT, sizeof (RBD_HEADER_TEXT))) in rbd_dev_ondisk_valid()
945 if (ondisk->options.order < SECTOR_SHIFT) in rbd_dev_ondisk_valid()
950 if (ondisk->options.order > 8 * sizeof (int) - 1) in rbd_dev_ondisk_valid()
957 snap_count = le32_to_cpu(ondisk->snap_count); in rbd_dev_ondisk_valid()
967 if ((u64) size < le64_to_cpu(ondisk->snap_names_len)) in rbd_dev_ondisk_valid()
1012 struct rbd_image_header_ondisk *ondisk, in rbd_header_from_disk() argument
1026 object_prefix = kstrndup(ondisk->object_prefix, in rbd_header_from_disk()
1027 sizeof(ondisk->object_prefix), in rbd_header_from_disk()
1035 snap_count = le32_to_cpu(ondisk->snap_count); in rbd_header_from_disk()
1039 snapc->seq = le64_to_cpu(ondisk->snap_seq); in rbd_header_from_disk()
1042 u64 snap_names_len = le64_to_cpu(ondisk->snap_names_len); in rbd_header_from_disk()
1068 memcpy(snap_names, &ondisk->snaps[snap_count], snap_names_len); in rbd_header_from_disk()
1069 snaps = ondisk->snaps; in rbd_header_from_disk()
1080 header->obj_order = ondisk->options.order; in rbd_header_from_disk()
1085 header->image_size = le64_to_cpu(ondisk->image_size); in rbd_header_from_disk()
4876 struct rbd_image_header_ondisk *ondisk = NULL; in rbd_dev_v1_header_info() local
4892 kfree(ondisk); in rbd_dev_v1_header_info()
4894 size = sizeof (*ondisk); in rbd_dev_v1_header_info()
4897 ondisk = kmalloc(size, GFP_KERNEL); in rbd_dev_v1_header_info()
4898 if (!ondisk) in rbd_dev_v1_header_info()
4902 &rbd_dev->header_oloc, ondisk, size); in rbd_dev_v1_header_info()
4911 if (!rbd_dev_ondisk_valid(ondisk)) { in rbd_dev_v1_header_info()
4917 names_size = le64_to_cpu(ondisk->snap_names_len); in rbd_dev_v1_header_info()
4919 snap_count = le32_to_cpu(ondisk->snap_count); in rbd_dev_v1_header_info()
4922 ret = rbd_header_from_disk(header, ondisk, first_time); in rbd_dev_v1_header_info()
4924 kfree(ondisk); in rbd_dev_v1_header_info()