Lines Matching refs:opts

3032 	struct fsg_opts		*opts;
3041 opts = fsg_opts_from_func_inst(f->fi);
3042 if (!opts->no_configfs) {
3163 struct fsg_lun_opts *opts = to_fsg_lun_opts(item);
3164 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent);
3166 return fsg_show_file(opts->lun, &fsg_opts->common->filesem, page);
3172 struct fsg_lun_opts *opts = to_fsg_lun_opts(item);
3173 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent);
3175 return fsg_store_file(opts->lun, &fsg_opts->common->filesem, page, len);
3188 struct fsg_lun_opts *opts = to_fsg_lun_opts(item);
3189 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent);
3191 return fsg_store_ro(opts->lun, &fsg_opts->common->filesem, page, len);
3218 struct fsg_lun_opts *opts = to_fsg_lun_opts(item);
3219 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent);
3221 return fsg_store_cdrom(opts->lun, &fsg_opts->common->filesem, page,
3257 struct fsg_lun_opts *opts = to_fsg_lun_opts(item);
3258 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent);
3260 return fsg_store_forced_eject(opts->lun, &fsg_opts->common->filesem,
3286 struct fsg_lun_opts *opts;
3315 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
3316 if (!opts) {
3327 kfree(opts);
3330 opts->lun = fsg_opts->common->luns[num];
3331 opts->lun_id = num;
3334 config_group_init_type_name(&opts->group, name, &fsg_lun_type);
3336 return &opts->group;
3368 struct fsg_opts *opts = to_fsg_opts(item);
3370 usb_put_function_instance(&opts->func_inst);
3379 struct fsg_opts *opts = to_fsg_opts(item);
3382 mutex_lock(&opts->lock);
3383 result = sprintf(page, "%d", opts->common->can_stall);
3384 mutex_unlock(&opts->lock);
3392 struct fsg_opts *opts = to_fsg_opts(item);
3396 mutex_lock(&opts->lock);
3398 if (opts->refcnt) {
3399 mutex_unlock(&opts->lock);
3405 opts->common->can_stall = stall;
3409 mutex_unlock(&opts->lock);
3419 struct fsg_opts *opts = to_fsg_opts(item);
3422 mutex_lock(&opts->lock);
3423 result = sprintf(page, "%d", opts->common->fsg_num_buffers);
3424 mutex_unlock(&opts->lock);
3432 struct fsg_opts *opts = to_fsg_opts(item);
3436 mutex_lock(&opts->lock);
3437 if (opts->refcnt) {
3445 ret = fsg_common_set_num_buffers(opts->common, num);
3451 mutex_unlock(&opts->lock);
3480 struct fsg_opts *opts;
3482 opts = fsg_opts_from_func_inst(fi);
3483 fsg_common_release(opts->common);
3484 kfree(opts);
3489 struct fsg_opts *opts;
3493 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
3494 if (!opts)
3496 mutex_init(&opts->lock);
3497 opts->func_inst.free_func_inst = fsg_free_inst;
3498 opts->common = fsg_common_setup(opts->common);
3499 if (IS_ERR(opts->common)) {
3500 rc = PTR_ERR(opts->common);
3504 rc = fsg_common_set_num_buffers(opts->common,
3513 rc = fsg_common_create_lun(opts->common, &config, 0, "lun.0",
3514 (const char **)&opts->func_inst.group.cg_item.ci_name);
3518 opts->lun0.lun = opts->common->luns[0];
3519 opts->lun0.lun_id = 0;
3521 config_group_init_type_name(&opts->func_inst.group, "", &fsg_func_type);
3523 config_group_init_type_name(&opts->lun0.group, "lun.0", &fsg_lun_type);
3524 configfs_add_default_group(&opts->lun0.group, &opts->func_inst.group);
3526 return &opts->func_inst;
3529 fsg_common_free_buffers(opts->common);
3531 kfree(opts->common);
3533 kfree(opts);
3540 struct fsg_opts *opts;
3543 opts = container_of(f->fi, struct fsg_opts, func_inst);
3545 mutex_lock(&opts->lock);
3546 opts->refcnt--;
3547 mutex_unlock(&opts->lock);
3554 struct fsg_opts *opts = fsg_opts_from_func_inst(fi);
3555 struct fsg_common *common = opts->common;
3562 mutex_lock(&opts->lock);
3563 opts->refcnt++;
3564 mutex_unlock(&opts->lock);