Lines Matching refs:req
431 struct ubi_leb_change_req req;
433 err = copy_from_user(&req, argp,
448 if (!ubi_leb_valid(vol, req.lnum) ||
449 req.bytes < 0 || req.bytes > vol->usable_leb_size)
456 err = ubi_start_leb_change(ubi, vol, &req);
457 if (req.bytes == 0)
496 struct ubi_map_req req;
498 err = copy_from_user(&req, argp, sizeof(struct ubi_map_req));
503 err = ubi_leb_map(desc, req.lnum);
538 struct ubi_set_vol_prop_req req;
540 err = copy_from_user(&req, argp,
546 switch (req.property) {
549 desc->vol->direct_writes = !!req.value;
589 * @req: the request to check
594 const struct ubi_mkvol_req *req)
598 if (req->bytes < 0 || req->alignment < 0 || req->vol_type < 0 ||
599 req->name_len < 0)
602 if ((req->vol_id < 0 || req->vol_id >= ubi->vtbl_slots) &&
603 req->vol_id != UBI_VOL_NUM_AUTO)
606 if (req->alignment == 0)
609 if (req->bytes == 0)
612 if (req->vol_type != UBI_DYNAMIC_VOLUME &&
613 req->vol_type != UBI_STATIC_VOLUME)
616 if (req->flags & ~UBI_VOL_VALID_FLGS)
619 if (req->flags & UBI_VOL_SKIP_CRC_CHECK_FLG &&
620 req->vol_type != UBI_STATIC_VOLUME)
623 if (req->alignment > ubi->leb_size)
626 n = req->alignment & (ubi->min_io_size - 1);
627 if (req->alignment != 1 && n)
630 if (!req->name[0] || !req->name_len)
633 if (req->name_len > UBI_VOL_NAME_MAX) {
638 n = strnlen(req->name, req->name_len + 1);
639 if (n != req->name_len)
646 ubi_dump_mkvol_req(req);
653 * @req: the request to check
658 const struct ubi_rsvol_req *req)
660 if (req->bytes <= 0)
663 if (req->vol_id < 0 || req->vol_id >= ubi->vtbl_slots)
672 * @req: volumes re-name request
680 struct ubi_rnvol_req *req)
686 if (req->count < 0 || req->count > UBI_MAX_RNVOL)
689 if (req->count == 0)
693 for (i = 0; i < req->count; i++) {
694 if (req->ents[i].vol_id < 0 ||
695 req->ents[i].vol_id >= ubi->vtbl_slots)
697 if (req->ents[i].name_len < 0)
699 if (req->ents[i].name_len > UBI_VOL_NAME_MAX)
701 req->ents[i].name[req->ents[i].name_len] = '\0';
702 n = strlen(req->ents[i].name);
703 if (n != req->ents[i].name_len)
708 for (i = 0; i < req->count - 1; i++) {
709 for (n = i + 1; n < req->count; n++) {
710 if (req->ents[i].vol_id == req->ents[n].vol_id) {
712 req->ents[i].vol_id);
715 if (!strcmp(req->ents[i].name, req->ents[n].name)) {
717 req->ents[i].name);
725 for (i = 0; i < req->count; i++) {
726 int vol_id = req->ents[i].vol_id;
727 int name_len = req->ents[i].name_len;
728 const char *name = req->ents[i].name;
772 * removed, unless it is also re-named in the request (@req).
850 struct ubi_mkvol_req req;
853 err = copy_from_user(&req, argp, sizeof(struct ubi_mkvol_req));
859 err = verify_mkvol_req(ubi, &req);
864 err = ubi_create_volume(ubi, &req);
869 err = put_user(req.vol_id, (__user int32_t *)argp);
911 struct ubi_rsvol_req req;
914 err = copy_from_user(&req, argp, sizeof(struct ubi_rsvol_req));
920 err = verify_rsvol_req(ubi, &req);
924 desc = ubi_open_volume(ubi->ubi_num, req.vol_id, UBI_EXCLUSIVE);
930 pebs = div_u64(req.bytes + desc->vol->usable_leb_size - 1,
943 struct ubi_rnvol_req *req;
946 req = kmalloc(sizeof(struct ubi_rnvol_req), GFP_KERNEL);
947 if (!req) {
952 err = copy_from_user(req, argp, sizeof(struct ubi_rnvol_req));
955 kfree(req);
959 err = rename_volumes(ubi, req);
960 kfree(req);
1016 struct ubi_attach_req req;
1020 err = copy_from_user(&req, argp, sizeof(struct ubi_attach_req));
1026 if (req.mtd_num < 0 ||
1027 (req.ubi_num < 0 && req.ubi_num != UBI_DEV_NUM_AUTO)) {
1032 mtd = get_mtd_device(NULL, req.mtd_num);
1043 err = ubi_attach_mtd_dev(mtd, req.ubi_num, req.vid_hdr_offset,
1044 req.max_beb_per1024);