Skip to contentSkip to conversation

Corrections in Documentation/block/ioprio.txt

PATCH Applied Dhaval Giani 2 participants 4 messages Aug 23, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Corrections in Documentation/block/ioprio.txt

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.

Documentation/block/ioprio.txt +3 -2
Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================
@@ -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,
Signature · 4 lines
regards,
Dhaval

I would like to change the world but they don't give me the source code!
#1 lore raw
Quoted 14 lines · Dhaval Giani

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.

Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================

Documentation/block/ioprio.txt extern int sys_ioprio_get(int, int); · line 91

Quoted 8 lines
Documentation/block/ioprio.txt +3 -2
@@ -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()?

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 27 lines · Jens Axboe
Quoted 14 lines · Dhaval Giani

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.

Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================

Documentation/block/ioprio.txt extern int sys_ioprio_get(int, int); · line 91

Quoted 8 lines
Documentation/block/ioprio.txt +3 -2
@@ -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:

Quoted 9 lines

static inline int ioprio_set(int which, int who, int ioprio)

{
        return syscall(__NR_ioprio_set, which, who, ioprio);
}

and ditto for ioprio_get()?

Signature · 1 line
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.

Documentation/block/ioprio.txt +9 -2
Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================
@@ -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,
Signature · 4 lines
regards,
Dhaval

I would like to change the world but they don't give me the source code!
Applied
#3 lore raw
Quoted 61 lines · Dhaval Giani
Quoted 27 lines · Jens Axboe
Quoted 14 lines · Dhaval Giani

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.

Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================

Documentation/block/ioprio.txt extern int sys_ioprio_get(int, int); · line 91

Quoted 8 lines
Documentation/block/ioprio.txt +3 -2
@@ -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:

Quoted 9 lines

static inline int ioprio_set(int which, int who, int ioprio)

{
        return syscall(__NR_ioprio_set, which, who, ioprio);
}

and ditto for ioprio_get()?

Signature · 1 line
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.

Index: linux-2.6.23-rc3-mm1/Documentation/block/ioprio.txt
===================================================================

Documentation/block/ioprio.txt +2 -2
@@ -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)
+{

Documentation/block/ioprio.txt extern int sys_ioprio_get(int, int); · line 100

Quoted 10 lines
Documentation/block/ioprio.txt +7 -0
+	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!

Signature · 1 line
Jens Axboe