public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Corrections in Documentation/block/ioprio.txt
@ 2007-08-23  8:18 Dhaval Giani
  2007-08-23  8:29 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Dhaval Giani @ 2007-08-23  8:18 UTC (permalink / raw)
  To: jens.axboe; +Cc: Balbir Singh, Srivatsa Vaddagiri, lkml

Hi Jens,

The newer glibc does not allow system calls to be made via _syscallN()
wrapper. They have to be made through syscall(). The ionice code used
the older interface. Correcting it to use syscall.

Signed-of-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>


Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================
--- linux-2.6.23-rc3-mm1.orig/Documentation/block/ioprio.txt	2007-07-09 05:02:17.000000000 +0530
+++ linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt	2007-08-23 13:23:28.000000000 +0530
@@ -86,8 +86,9 @@ extern int sys_ioprio_get(int, int);
 #error "Unsupported arch"
 #endif
 
-_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
-_syscall2(int, ioprio_get, int, which, int, who);
+#define ioprio_set(which, who, ioprio)  syscall(__NR_ioprio_set, which,\
+							who, ioprio)
+#define ioprio_get(which, who)	syscall(__NR_ioprio_get, which, who)
 
 enum {
 	IOPRIO_CLASS_NONE,

-- 
regards,
Dhaval

I would like to change the world but they don't give me the source code!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Corrections in Documentation/block/ioprio.txt
  2007-08-23  8:29 ` Jens Axboe
@ 2007-08-23  8:28   ` Dhaval Giani
  2007-08-23  8:45     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Dhaval Giani @ 2007-08-23  8:28 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Balbir Singh, Srivatsa Vaddagiri, lkml

On Thu, Aug 23, 2007 at 10:29:30AM +0200, Jens Axboe wrote:
> On Thu, Aug 23 2007, Dhaval Giani wrote:
> > Hi Jens,
> > 
> > The newer glibc does not allow system calls to be made via _syscallN()
> > wrapper. They have to be made through syscall(). The ionice code used
> > the older interface. Correcting it to use syscall.
> > 
> > Signed-of-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
> > 
> > 
> > Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
> > ===================================================================
> > --- linux-2.6.23-rc3-mm1.orig/Documentation/block/ioprio.txt	2007-07-09 05:02:17.000000000 +0530
> > +++ linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt	2007-08-23 13:23:28.000000000 +0530
> > @@ -86,8 +86,9 @@ extern int sys_ioprio_get(int, int);
> >  #error "Unsupported arch"
> >  #endif
> >  
> > -_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
> > -_syscall2(int, ioprio_get, int, which, int, who);
> > +#define ioprio_set(which, who, ioprio)  syscall(__NR_ioprio_set, which,\
> > +							who, ioprio)
> > +#define ioprio_get(which, who)	syscall(__NR_ioprio_get, which, who)
> 
> Agree, it fails as-of recent distros. But I prefer a function instead,
> can you resend with something ala:
> 
> static inline int ioprio_set(int which, int who, int ioprio)
> {
>         return syscall(__NR_ioprio_set, which, who, ioprio);
> }
> 
> and ditto for ioprio_get()?
> 
> -- 
> Jens Axboe

Done..

----------------------

The newer glibc does not allow system calls to be made via _syscallN()
wrapper. They have to be made through syscall(). The ionice code used
the older interface. Correcting it to use syscall.
 
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>


Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================
--- linux-2.6.23-rc3-mm1.orig/Documentation/block/ioprio.txt	2007-07-09 05:02:17.000000000 +0530
+++ linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt	2007-08-23 13:46:08.000000000 +0530
@@ -86,8 +86,15 @@ extern int sys_ioprio_get(int, int);
 #error "Unsupported arch"
 #endif
 
-_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
-_syscall2(int, ioprio_get, int, which, int, who);
+static inline int ioprio_set(int which, int who, int ioprio)
+{
+	return syscall(__NR_ioprio_set, which, who, ioprio);
+}
+
+static inline int ioprio_get(int which, int who)
+{
+	return syscall(__NR_ioprio_get, which, who);
+}
 
 enum {
 	IOPRIO_CLASS_NONE,
-- 
regards,
Dhaval

I would like to change the world but they don't give me the source code!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Corrections in Documentation/block/ioprio.txt
  2007-08-23  8:18 [PATCH] Corrections in Documentation/block/ioprio.txt Dhaval Giani
@ 2007-08-23  8:29 ` Jens Axboe
  2007-08-23  8:28   ` Dhaval Giani
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2007-08-23  8:29 UTC (permalink / raw)
  To: Dhaval Giani; +Cc: Balbir Singh, Srivatsa Vaddagiri, lkml

On Thu, Aug 23 2007, Dhaval Giani wrote:
> Hi Jens,
> 
> The newer glibc does not allow system calls to be made via _syscallN()
> wrapper. They have to be made through syscall(). The ionice code used
> the older interface. Correcting it to use syscall.
> 
> Signed-of-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
> 
> 
> Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
> ===================================================================
> --- linux-2.6.23-rc3-mm1.orig/Documentation/block/ioprio.txt	2007-07-09 05:02:17.000000000 +0530
> +++ linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt	2007-08-23 13:23:28.000000000 +0530
> @@ -86,8 +86,9 @@ extern int sys_ioprio_get(int, int);
>  #error "Unsupported arch"
>  #endif
>  
> -_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
> -_syscall2(int, ioprio_get, int, which, int, who);
> +#define ioprio_set(which, who, ioprio)  syscall(__NR_ioprio_set, which,\
> +							who, ioprio)
> +#define ioprio_get(which, who)	syscall(__NR_ioprio_get, which, who)

Agree, it fails as-of recent distros. But I prefer a function instead,
can you resend with something ala:

static inline int ioprio_set(int which, int who, int ioprio)
{
        return syscall(__NR_ioprio_set, which, who, ioprio);
}

and ditto for ioprio_get()?

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Corrections in Documentation/block/ioprio.txt
  2007-08-23  8:28   ` Dhaval Giani
@ 2007-08-23  8:45     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2007-08-23  8:45 UTC (permalink / raw)
  To: Dhaval Giani; +Cc: Balbir Singh, Srivatsa Vaddagiri, lkml

On Thu, Aug 23 2007, Dhaval Giani wrote:
> On Thu, Aug 23, 2007 at 10:29:30AM +0200, Jens Axboe wrote:
> > On Thu, Aug 23 2007, Dhaval Giani wrote:
> > > Hi Jens,
> > > 
> > > The newer glibc does not allow system calls to be made via _syscallN()
> > > wrapper. They have to be made through syscall(). The ionice code used
> > > the older interface. Correcting it to use syscall.
> > > 
> > > Signed-of-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
> > > 
> > > 
> > > Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
> > > ===================================================================
> > > --- linux-2.6.23-rc3-mm1.orig/Documentation/block/ioprio.txt	2007-07-09 05:02:17.000000000 +0530
> > > +++ linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt	2007-08-23 13:23:28.000000000 +0530
> > > @@ -86,8 +86,9 @@ extern int sys_ioprio_get(int, int);
> > >  #error "Unsupported arch"
> > >  #endif
> > >  
> > > -_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
> > > -_syscall2(int, ioprio_get, int, which, int, who);
> > > +#define ioprio_set(which, who, ioprio)  syscall(__NR_ioprio_set, which,\
> > > +							who, ioprio)
> > > +#define ioprio_get(which, who)	syscall(__NR_ioprio_get, which, who)
> > 
> > Agree, it fails as-of recent distros. But I prefer a function instead,
> > can you resend with something ala:
> > 
> > static inline int ioprio_set(int which, int who, int ioprio)
> > {
> >         return syscall(__NR_ioprio_set, which, who, ioprio);
> > }
> > 
> > and ditto for ioprio_get()?
> > 
> > -- 
> > Jens Axboe
> 
> Done..
> 
> ----------------------
> 
> The newer glibc does not allow system calls to be made via _syscallN()
> wrapper. They have to be made through syscall(). The ionice code used
> the older interface. Correcting it to use syscall.
>  
> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
> 
> 
> Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
> ===================================================================
> --- linux-2.6.23-rc3-mm1.orig/Documentation/block/ioprio.txt	2007-07-09 05:02:17.000000000 +0530
> +++ linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt	2007-08-23 13:46:08.000000000 +0530
> @@ -86,8 +86,15 @@ extern int sys_ioprio_get(int, int);
>  #error "Unsupported arch"
>  #endif
>  
> -_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
> -_syscall2(int, ioprio_get, int, which, int, who);
> +static inline int ioprio_set(int which, int who, int ioprio)
> +{
> +	return syscall(__NR_ioprio_set, which, who, ioprio);
> +}
> +
> +static inline int ioprio_get(int which, int who)
> +{
> +	return syscall(__NR_ioprio_get, which, who);
> +}
>  
>  enum {
>  	IOPRIO_CLASS_NONE,

Thanks, applied!

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-23  8:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-23  8:18 [PATCH] Corrections in Documentation/block/ioprio.txt Dhaval Giani
2007-08-23  8:29 ` Jens Axboe
2007-08-23  8:28   ` Dhaval Giani
2007-08-23  8:45     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox