Commit 1e9ce8ae authored by Federico Vaga's avatar Federico Vaga

sysfs: rename and export __get_spinlock

It will be necessary on "write control" patch

In order to export the function to other ZIO core parts, this patch
rename __get_spinlock() with a proper name and export the prototype
within the framework
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
cked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d9ab835b
...@@ -80,7 +80,7 @@ static void __zattr_unclone(struct zio_attribute *zattr) ...@@ -80,7 +80,7 @@ static void __zattr_unclone(struct zio_attribute *zattr)
} }
/* When touching attributes, we always use the spinlock for the hosting dev */ /* When touching attributes, we always use the spinlock for the hosting dev */
static spinlock_t *__get_spinlock(struct zio_obj_head *head) spinlock_t *__zio_get_dev_spinlock(struct zio_obj_head *head)
{ {
spinlock_t *lock; spinlock_t *lock;
...@@ -569,7 +569,7 @@ static ssize_t zobj_store_enable(struct device *dev, ...@@ -569,7 +569,7 @@ static ssize_t zobj_store_enable(struct device *dev,
if (err || val < 0 || val > 1) if (err || val < 0 || val > 1)
return -EINVAL; return -EINVAL;
lock = __get_spinlock(head); lock = __zio_get_dev_spinlock(head);
do { do {
spin_lock(lock); spin_lock(lock);
err = __zio_object_enable(head, val); err = __zio_object_enable(head, val);
...@@ -598,7 +598,7 @@ static ssize_t zattr_show(struct device *dev, struct device_attribute *attr, ...@@ -598,7 +598,7 @@ static ssize_t zattr_show(struct device *dev, struct device_attribute *attr,
spinlock_t *lock; spinlock_t *lock;
int err = 0; int err = 0;
lock = __get_spinlock(head); lock = __zio_get_dev_spinlock(head);
spin_lock(lock); spin_lock(lock);
err = zattr->s_op->info_get(dev, zattr, &zattr->value); err = zattr->s_op->info_get(dev, zattr, &zattr->value);
spin_unlock(lock); spin_unlock(lock);
...@@ -632,7 +632,7 @@ static ssize_t zattr_store(struct device *dev, struct device_attribute *attr, ...@@ -632,7 +632,7 @@ static ssize_t zattr_store(struct device *dev, struct device_attribute *attr,
dev_dbg(dev, "writing value %ld to sysfs attribute %s\n", dev_dbg(dev, "writing value %ld to sysfs attribute %s\n",
val, attr->attr.name); val, attr->attr.name);
lock = __get_spinlock(head); lock = __zio_get_dev_spinlock(head);
spin_lock(lock); spin_lock(lock);
err = zattr->s_op->conf_set(dev, zattr, (uint32_t)val); err = zattr->s_op->conf_set(dev, zattr, (uint32_t)val);
if (err) { if (err) {
......
...@@ -83,6 +83,7 @@ extern int zio_create_attributes(struct zio_obj_head *head, ...@@ -83,6 +83,7 @@ extern int zio_create_attributes(struct zio_obj_head *head,
struct zio_attribute_set *zattr_set_tmpl); struct zio_attribute_set *zattr_set_tmpl);
extern void zio_destroy_attributes(struct zio_obj_head *head); extern void zio_destroy_attributes(struct zio_obj_head *head);
extern int __zio_object_enable(struct zio_obj_head *head, unsigned int enable); extern int __zio_object_enable(struct zio_obj_head *head, unsigned int enable);
extern spinlock_t *__zio_get_dev_spinlock(struct zio_obj_head *head);
/* Defined in objects.c */ /* Defined in objects.c */
extern int __zdev_register(struct zio_device *parent, extern int __zdev_register(struct zio_device *parent,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment