From: Andrew Morton <akpm@osdl.org>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, horst.hummel@de.ibm.com
Subject: Re: [patch 13/13] s390: dasd device identifiers.
Date: Mon, 24 Apr 2006 16:49:07 -0700 [thread overview]
Message-ID: <20060424164907.7888c685.akpm@osdl.org> (raw)
In-Reply-To: <20060424150620.GN15613@skybase>
Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:
>
> @@ -45,6 +45,7 @@ struct dasd_devmap {
> unsigned int devindex;
> unsigned short features;
> struct dasd_device *device;
> + struct dasd_uid uid;
> };
Someone's missing a TAB key.
> +static ssize_t
> +dasd_alias_show(struct device *dev, struct device_attribute *attr, char *buf)
> +{
> + struct dasd_devmap *devmap;
> + int alias;
> +
> + devmap = dasd_find_busid(dev->bus_id);
> + spin_lock(&dasd_devmap_lock);
> + if (!IS_ERR(devmap))
> + alias = devmap->uid.alias;
> + else
> + alias = 0;
> + spin_unlock(&dasd_devmap_lock);
> +
> + return sprintf(buf, alias ? "1\n" : "0\n");
> +}
The locking is suspicious. We take a spinlock just for a single read?
> +/*
> + * Return copy of the device unique identifier.
> + */
> +int
> +dasd_get_uid(struct ccw_device *cdev, struct dasd_uid *uid)
> +{
> + struct dasd_devmap *devmap;
> +
> + devmap = dasd_find_busid(cdev->dev.bus_id);
> + if (IS_ERR(devmap))
> + return PTR_ERR(devmap);
> + spin_lock(&dasd_devmap_lock);
> + *uid = devmap->uid;
> + spin_unlock(&dasd_devmap_lock);
> + return 0;
> +}
And for a single write?
next prev parent reply other threads:[~2006-04-24 23:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 15:06 Martin Schwidefsky
2006-04-24 23:49 ` Andrew Morton [this message]
2006-04-25 8:28 ` Martin Schwidefsky
2006-04-26 17:59 ` Jan Blunck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060424164907.7888c685.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=horst.hummel@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome