Lines Matching refs:opts

3019 	struct fsg_opts		*opts;  in fsg_bind()  local
3028 opts = fsg_opts_from_func_inst(f->fi); in fsg_bind()
3029 if (!opts->no_configfs) { in fsg_bind()
3151 struct fsg_lun_opts *opts = to_fsg_lun_opts(item); in fsg_lun_opts_file_show() local
3152 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent); in fsg_lun_opts_file_show()
3154 return fsg_show_file(opts->lun, &fsg_opts->common->filesem, page); in fsg_lun_opts_file_show()
3160 struct fsg_lun_opts *opts = to_fsg_lun_opts(item); in fsg_lun_opts_file_store() local
3161 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent); in fsg_lun_opts_file_store()
3163 return fsg_store_file(opts->lun, &fsg_opts->common->filesem, page, len); in fsg_lun_opts_file_store()
3176 struct fsg_lun_opts *opts = to_fsg_lun_opts(item); in fsg_lun_opts_ro_store() local
3177 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent); in fsg_lun_opts_ro_store()
3179 return fsg_store_ro(opts->lun, &fsg_opts->common->filesem, page, len); in fsg_lun_opts_ro_store()
3206 struct fsg_lun_opts *opts = to_fsg_lun_opts(item); in fsg_lun_opts_cdrom_store() local
3207 struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent); in fsg_lun_opts_cdrom_store()
3209 return fsg_store_cdrom(opts->lun, &fsg_opts->common->filesem, page, in fsg_lun_opts_cdrom_store()
3246 struct fsg_lun_opts *opts; in fsg_lun_make() local
3274 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in fsg_lun_make()
3275 if (!opts) { in fsg_lun_make()
3286 kfree(opts); in fsg_lun_make()
3289 opts->lun = fsg_opts->common->luns[num]; in fsg_lun_make()
3290 opts->lun_id = num; in fsg_lun_make()
3293 config_group_init_type_name(&opts->group, name, &fsg_lun_type); in fsg_lun_make()
3295 return &opts->group; in fsg_lun_make()
3327 struct fsg_opts *opts = to_fsg_opts(item); in fsg_attr_release() local
3329 usb_put_function_instance(&opts->func_inst); in fsg_attr_release()
3338 struct fsg_opts *opts = to_fsg_opts(item); in fsg_opts_stall_show() local
3341 mutex_lock(&opts->lock); in fsg_opts_stall_show()
3342 result = sprintf(page, "%d", opts->common->can_stall); in fsg_opts_stall_show()
3343 mutex_unlock(&opts->lock); in fsg_opts_stall_show()
3351 struct fsg_opts *opts = to_fsg_opts(item); in fsg_opts_stall_store() local
3355 mutex_lock(&opts->lock); in fsg_opts_stall_store()
3357 if (opts->refcnt) { in fsg_opts_stall_store()
3358 mutex_unlock(&opts->lock); in fsg_opts_stall_store()
3364 opts->common->can_stall = stall; in fsg_opts_stall_store()
3368 mutex_unlock(&opts->lock); in fsg_opts_stall_store()
3378 struct fsg_opts *opts = to_fsg_opts(item); in fsg_opts_num_buffers_show() local
3381 mutex_lock(&opts->lock); in fsg_opts_num_buffers_show()
3382 result = sprintf(page, "%d", opts->common->fsg_num_buffers); in fsg_opts_num_buffers_show()
3383 mutex_unlock(&opts->lock); in fsg_opts_num_buffers_show()
3391 struct fsg_opts *opts = to_fsg_opts(item); in fsg_opts_num_buffers_store() local
3395 mutex_lock(&opts->lock); in fsg_opts_num_buffers_store()
3396 if (opts->refcnt) { in fsg_opts_num_buffers_store()
3408 fsg_common_set_num_buffers(opts->common, num); in fsg_opts_num_buffers_store()
3412 mutex_unlock(&opts->lock); in fsg_opts_num_buffers_store()
3441 struct fsg_opts *opts; in fsg_free_inst() local
3443 opts = fsg_opts_from_func_inst(fi); in fsg_free_inst()
3444 fsg_common_put(opts->common); in fsg_free_inst()
3445 kfree(opts); in fsg_free_inst()
3450 struct fsg_opts *opts; in fsg_alloc_inst() local
3454 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in fsg_alloc_inst()
3455 if (!opts) in fsg_alloc_inst()
3457 mutex_init(&opts->lock); in fsg_alloc_inst()
3458 opts->func_inst.free_func_inst = fsg_free_inst; in fsg_alloc_inst()
3459 opts->common = fsg_common_setup(opts->common); in fsg_alloc_inst()
3460 if (IS_ERR(opts->common)) { in fsg_alloc_inst()
3461 rc = PTR_ERR(opts->common); in fsg_alloc_inst()
3465 rc = fsg_common_set_num_buffers(opts->common, in fsg_alloc_inst()
3474 rc = fsg_common_create_lun(opts->common, &config, 0, "lun.0", in fsg_alloc_inst()
3475 (const char **)&opts->func_inst.group.cg_item.ci_name); in fsg_alloc_inst()
3479 opts->lun0.lun = opts->common->luns[0]; in fsg_alloc_inst()
3480 opts->lun0.lun_id = 0; in fsg_alloc_inst()
3481 config_group_init_type_name(&opts->lun0.group, "lun.0", &fsg_lun_type); in fsg_alloc_inst()
3482 opts->default_groups[0] = &opts->lun0.group; in fsg_alloc_inst()
3483 opts->func_inst.group.default_groups = opts->default_groups; in fsg_alloc_inst()
3485 config_group_init_type_name(&opts->func_inst.group, "", &fsg_func_type); in fsg_alloc_inst()
3487 return &opts->func_inst; in fsg_alloc_inst()
3490 fsg_common_free_buffers(opts->common); in fsg_alloc_inst()
3492 kfree(opts); in fsg_alloc_inst()
3499 struct fsg_opts *opts; in fsg_free() local
3502 opts = container_of(f->fi, struct fsg_opts, func_inst); in fsg_free()
3504 mutex_lock(&opts->lock); in fsg_free()
3505 opts->refcnt--; in fsg_free()
3506 mutex_unlock(&opts->lock); in fsg_free()
3513 struct fsg_opts *opts = fsg_opts_from_func_inst(fi); in fsg_alloc() local
3514 struct fsg_common *common = opts->common; in fsg_alloc()
3521 mutex_lock(&opts->lock); in fsg_alloc()
3522 opts->refcnt++; in fsg_alloc()
3523 mutex_unlock(&opts->lock); in fsg_alloc()