Hi Eddie,

I quite haven't followed this config lock so I'm not perfectly sure.  I believe 
this ioctl is for 'clicky'.
But the handler_ioctl() seems to me is already under proper locking.  So I 
think no additional locking is needed even outside BKL.
Please let me know if you have other thoughts.

Thanks,
Joonwoo

---
As of linux 2.6.36 file_operations.ioctl has removed.
Bobby Longpocket <[email protected]> pointed out different interface
between ioctl and unlocked_ioctl
---
 linuxmodule/clickfs.cc |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/linuxmodule/clickfs.cc b/linuxmodule/clickfs.cc
index 123e143..df4b99d 100644
--- a/linuxmodule/clickfs.cc
+++ b/linuxmodule/clickfs.cc
@@ -891,6 +891,15 @@ handler_ioctl(struct inode *inode, struct file *filp,
     return retval;
 }
 
+#if HAVE_UNLOCKED_IOCTL
+static long
+handler_unlocked_ioctl(struct file *filp, unsigned command,
+                      unsigned long address)
+{
+    return handler_ioctl(filp->f_dentry->d_inode, filp, command, address);
+}
+#endif
+
 #if INO_DEBUG
 static String
 read_ino_info(Element *, void *)
@@ -961,7 +970,11 @@ init_clickfs()
 
     click_handler_file_ops->read = handler_read;
     click_handler_file_ops->write = handler_write;
+#if HAVE_UNLOCKED_IOCTL
+    click_handler_file_ops->unlocked_ioctl = handler_unlocked_ioctl;
+#else
     click_handler_file_ops->ioctl = handler_ioctl;
+#endif
     click_handler_file_ops->open = handler_open;
     click_handler_file_ops->flush = handler_flush;
     click_handler_file_ops->release = handler_release;
-- 
1.7.1
---

On Mon, Jan 31, 2011 at 09:26:56AM -0800, Joonwoo Park wrote:
> Oh.. I just noticed that unlocked_ioctl() doesn't take inode.  Will
> have revised one. (presumably two as the there is another patch on
> this)
> 
> Thanks!
> Joonwoo
> 
> On Sun, Jan 30, 2011 at 8:22 PM, Bobby Longpocket
> <[email protected]> wrote:
> > Hi Joonwoo,
> >
> > This patch doesn't look right.  The arguments for the unlocked_ioctl() 
> > interface are different than those for the old ioctl() interface.
> >
> >
> >
> > --- On Sun, 1/30/11, [email protected] 
> > <[email protected]> wrote:
> >> Message: 2
> >> Date: Sun, 30 Jan 2011 01:18:58 -0800
> >> From: Joonwoo Park <[email protected]>
> >> Subject: [Click]  [PATCH 2/5] clickfs: use
> >> unlocked_ioctl on linux
> >>     2.6.36+
> >> To: Eddie Kohler <[email protected]>
> >> Cc: [email protected]
> >> Message-ID: <20110130091858.GB25293@gm>
> >> Content-Type: text/plain; charset="us-ascii"
> >>
> >> As of linux 2.6.36 file_operations.ioctl has removed.
> >>
> >> Signed-off-by: Joonwoo Park <[email protected]>
> >> ---
> >>  linuxmodule/clickfs.cc |    4 ++++
> >>  1 files changed, 4 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/linuxmodule/clickfs.cc
> >> b/linuxmodule/clickfs.cc
> >> index 123e143..59db23c 100644
> >> --- a/linuxmodule/clickfs.cc
> >> +++ b/linuxmodule/clickfs.cc
> >> @@ -961,7 +961,11 @@ init_clickfs()
> >>
> >>      click_handler_file_ops->read =
> >> handler_read;
> >>      click_handler_file_ops->write =
> >> handler_write;
> >> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
> >> +    click_handler_file_ops->unlocked_ioctl =
> >> handler_ioctl;
> >> +#else
> >>      click_handler_file_ops->ioctl =
> >> handler_ioctl;
> >> +#endif
> >>      click_handler_file_ops->open =
> >> handler_open;
> >>      click_handler_file_ops->flush =
> >> handler_flush;
> >>      click_handler_file_ops->release
> >> = handler_release;
> >> --
> >> 1.7.1
> >>
> >
> >
> >
> >
> > _______________________________________________
> > click mailing list
> > [email protected]
> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >
>From e673624aa5f4937d009ec434dc29541359474bf8 Mon Sep 17 00:00:00 2001
From: Joonwoo Park <[email protected]>
Date: Mon, 31 Jan 2011 22:47:03 -0800
Subject: [PATCH v2 2/5] clickfs: use unlocked_ioctl if it's available

As of linux 2.6.36 file_operations.ioctl has removed.
Bobby Longpocket <[email protected]> pointed out different interface
between ioctl and unlocked_ioctl
---
 linuxmodule/clickfs.cc |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/linuxmodule/clickfs.cc b/linuxmodule/clickfs.cc
index 123e143..df4b99d 100644
--- a/linuxmodule/clickfs.cc
+++ b/linuxmodule/clickfs.cc
@@ -891,6 +891,15 @@ handler_ioctl(struct inode *inode, struct file *filp,
     return retval;
 }
 
+#if HAVE_UNLOCKED_IOCTL
+static long
+handler_unlocked_ioctl(struct file *filp, unsigned command,
+		       unsigned long address)
+{
+    return handler_ioctl(filp->f_dentry->d_inode, filp, command, address);
+}
+#endif
+
 #if INO_DEBUG
 static String
 read_ino_info(Element *, void *)
@@ -961,7 +970,11 @@ init_clickfs()
 
     click_handler_file_ops->read = handler_read;
     click_handler_file_ops->write = handler_write;
+#if HAVE_UNLOCKED_IOCTL
+    click_handler_file_ops->unlocked_ioctl = handler_unlocked_ioctl;
+#else
     click_handler_file_ops->ioctl = handler_ioctl;
+#endif
     click_handler_file_ops->open = handler_open;
     click_handler_file_ops->flush = handler_flush;
     click_handler_file_ops->release = handler_release;
-- 
1.7.1

_______________________________________________
click mailing list
[email protected]
https://amsterdam.lcs.mit.edu/mailman/listinfo/click

Reply via email to