Lines Matching refs:sd_file
367 struct sclp_sd_file *sd_file = to_sd_file(kobj); in sclp_sd_file_release() local
369 sclp_sd_data_reset(&sd_file->data); in sclp_sd_file_release()
370 kfree(sd_file); in sclp_sd_file_release()
383 static int sclp_sd_file_update(struct sclp_sd_file *sd_file) in sclp_sd_file_update() argument
385 const char *name = kobject_name(&sd_file->kobj); in sclp_sd_file_update()
389 rc = sclp_sd_store_data(&data, sd_file->di); in sclp_sd_file_update()
398 mutex_lock(&sd_file->data_mutex); in sclp_sd_file_update()
399 sclp_sd_data_reset(&sd_file->data); in sclp_sd_file_update()
400 sd_file->data = data; in sclp_sd_file_update()
401 mutex_unlock(&sd_file->data_mutex); in sclp_sd_file_update()
405 kobject_uevent(&sd_file->kobj, KOBJ_CHANGE); in sclp_sd_file_update()
417 struct sclp_sd_file *sd_file = data; in sclp_sd_file_update_async() local
419 sclp_sd_file_update(sd_file); in sclp_sd_file_update_async()
434 struct sclp_sd_file *sd_file = to_sd_file(kobj); in reload_store() local
436 sclp_sd_file_update(sd_file); in reload_store()
472 struct sclp_sd_file *sd_file = to_sd_file(kobj); in data_read() local
476 mutex_lock(&sd_file->data_mutex); in data_read()
478 data = sd_file->data.data; in data_read()
479 data_size = sd_file->data.dsize_bytes; in data_read()
488 mutex_unlock(&sd_file->data_mutex); in data_read()
511 struct sclp_sd_file *sd_file; in sclp_sd_file_create() local
514 sd_file = kzalloc(sizeof(*sd_file), GFP_KERNEL); in sclp_sd_file_create()
515 if (!sd_file) in sclp_sd_file_create()
517 sd_file->di = di; in sclp_sd_file_create()
518 mutex_init(&sd_file->data_mutex); in sclp_sd_file_create()
521 sd_file->kobj.kset = sclp_sd_kset; in sclp_sd_file_create()
522 rc = kobject_init_and_add(&sd_file->kobj, &sclp_sd_file_ktype, NULL, in sclp_sd_file_create()
525 kobject_put(&sd_file->kobj); in sclp_sd_file_create()
529 sysfs_bin_attr_init(&sd_file->data_attr); in sclp_sd_file_create()
530 sd_file->data_attr.attr.name = "data"; in sclp_sd_file_create()
531 sd_file->data_attr.attr.mode = 0444; in sclp_sd_file_create()
532 sd_file->data_attr.read = data_read; in sclp_sd_file_create()
534 rc = sysfs_create_bin_file(&sd_file->kobj, &sd_file->data_attr); in sclp_sd_file_create()
536 kobject_put(&sd_file->kobj); in sclp_sd_file_create()
544 kobject_uevent(&sd_file->kobj, KOBJ_ADD); in sclp_sd_file_create()
547 async_schedule(sclp_sd_file_update_async, sd_file); in sclp_sd_file_create()
549 return sd_file; in sclp_sd_file_create()