LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Cyrill Gorcunov" <gorcunov@gmail.com>
To: "Jiri Slaby" <jirislaby@gmail.com>
Cc: "Paul Gortmaker" <p_gortmaker@yahoo.com>,
	LKML <linux-kernel@vger.kernel.org>, "Andi Kleen" <ak@suse.de>,
	"Alexey Dobriyan" <adobriyan@gmail.com>
Subject: Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl
Date: Mon, 14 Jan 2008 09:38:57 +0300	[thread overview]
Message-ID: <aa79d98a0801132238o72266a91p78ae3a0c1476607c@mail.gmail.com> (raw)
In-Reply-To: <aa79d98a0801131332w45d6e0e9r13e96b69e7e1b70@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 622 bytes --]

This patch converts ioctl call to unlocked_ioctl form. It's possible
due to rtl_lock spinlock protection.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
The patch is *not* tested but the patch does not bring _much_ changes
so it wouldn't break the compilation procedure.

If there is problem with attachment - i could send it as inline
form today evening.

Andi, Jiri, Alexey the only thing I do complain about -
is time set/read from several user threads that uses same
(duplicated) file descriptor. Could there be useless thread
spins instead of sleep (in case if this unlocked_ioctl were
protected by mutex)?

[-- Attachment #2: ip27-rtc-unlocked-ioctl.patch --]
[-- Type: application/octet-stream, Size: 1310 bytes --]

 drivers/char/ip27-rtc.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/char/ip27-rtc.c b/drivers/char/ip27-rtc.c
index 932264a..86e6538 100644
--- a/drivers/char/ip27-rtc.c
+++ b/drivers/char/ip27-rtc.c
@@ -46,8 +46,8 @@
 #include <asm/sn/sn0/hub.h>
 #include <asm/sn/sn_private.h>
 
-static int rtc_ioctl(struct inode *inode, struct file *file,
-		     unsigned int cmd, unsigned long arg);
+static long rtc_ioctl(struct file *filp, unsigned int cmd,
+			unsigned long arg);
 
 static int rtc_read_proc(char *page, char **start, off_t off,
                          int count, int *eof, void *data);
@@ -75,8 +75,7 @@ static unsigned long epoch = 1970;	/* year corresponding to 0x00	*/
 static const unsigned char days_in_mo[] =
 {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
-static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-		     unsigned long arg)
+static long rtc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
 
 	struct rtc_time wtime;
@@ -197,7 +196,7 @@ static int rtc_release(struct inode *inode, struct file *file)
 
 static const struct file_operations rtc_fops = {
 	.owner		= THIS_MODULE,
-	.ioctl		= rtc_ioctl,
+	.unlocked_ioctl	= rtc_ioctl,
 	.open		= rtc_open,
 	.release	= rtc_release,
 };

  reply	other threads:[~2008-01-14  6:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-13 20:32 [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl Cyrill Gorcunov
2008-01-13 21:07 ` Alexey Dobriyan
2008-01-13 21:25   ` Cyrill Gorcunov
2008-01-13 21:22 ` Jiri Slaby
2008-01-13 21:29   ` Jiri Slaby
2008-01-13 21:32     ` Cyrill Gorcunov
2008-01-14  6:38       ` Cyrill Gorcunov [this message]
2008-01-14 15:14         ` Jiri Slaby
2008-01-14 15:38           ` Cyrill Gorcunov
2008-01-14 15:59             ` Jiri Slaby
2008-01-14 16:07               ` Cyrill Gorcunov
2008-01-14 16:27                 ` Jiri Slaby
2008-01-14 16:28                   ` Cyrill Gorcunov
2008-01-13 23:08 ` Andi Kleen

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=aa79d98a0801132238o72266a91p78ae3a0c1476607c@mail.gmail.com \
    --to=gorcunov@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=ak@suse.de \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p_gortmaker@yahoo.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;
as well as URLs for NNTP newsgroup(s).