diff options
210 files changed, 1196 insertions, 1193 deletions
diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/AU1xxx_IDE.README index f54962aea84d..8ace35ebdcd5 100644 --- a/Documentation/mips/AU1xxx_IDE.README +++ b/Documentation/mips/AU1xxx_IDE.README | |||
@@ -52,14 +52,12 @@ Two files are introduced: | |||
52 | b) 'drivers/ide/mips/au1xxx-ide.c' | 52 | b) 'drivers/ide/mips/au1xxx-ide.c' |
53 | contains the functionality of the AU1XXX IDE driver | 53 | contains the functionality of the AU1XXX IDE driver |
54 | 54 | ||
55 | Four configs variables are introduced: | 55 | Following extra configs variables are introduced: |
56 | 56 | ||
57 | CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - enable the PIO+DBDMA mode | 57 | CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - enable the PIO+DBDMA mode |
58 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - enable the MWDMA mode | 58 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - enable the MWDMA mode |
59 | CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON - set Burstable FIFO in DBDMA | 59 | CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON - set Burstable FIFO in DBDMA |
60 | controller | 60 | controller |
61 | CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ - maximum transfer size | ||
62 | per descriptor | ||
63 | 61 | ||
64 | 62 | ||
65 | SUPPORTED IDE MODES | 63 | SUPPORTED IDE MODES |
@@ -87,7 +85,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y | |||
87 | CONFIG_IDEDMA_PCI_AUTO=y | 85 | CONFIG_IDEDMA_PCI_AUTO=y |
88 | CONFIG_BLK_DEV_IDE_AU1XXX=y | 86 | CONFIG_BLK_DEV_IDE_AU1XXX=y |
89 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y | 87 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y |
90 | CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128 | ||
91 | CONFIG_BLK_DEV_IDEDMA=y | 88 | CONFIG_BLK_DEV_IDEDMA=y |
92 | CONFIG_IDEDMA_AUTO=y | 89 | CONFIG_IDEDMA_AUTO=y |
93 | 90 | ||
@@ -105,7 +102,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y | |||
105 | CONFIG_IDEDMA_PCI_AUTO=y | 102 | CONFIG_IDEDMA_PCI_AUTO=y |
106 | CONFIG_BLK_DEV_IDE_AU1XXX=y | 103 | CONFIG_BLK_DEV_IDE_AU1XXX=y |
107 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y | 104 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y |
108 | CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128 | ||
109 | CONFIG_BLK_DEV_IDEDMA=y | 105 | CONFIG_BLK_DEV_IDEDMA=y |
110 | CONFIG_IDEDMA_AUTO=y | 106 | CONFIG_IDEDMA_AUTO=y |
111 | 107 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 6f65a269cb17..3f6ef02ad681 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4842,11 +4842,11 @@ S: Supported | |||
4842 | 4842 | ||
4843 | XFS FILESYSTEM | 4843 | XFS FILESYSTEM |
4844 | P: Silicon Graphics Inc | 4844 | P: Silicon Graphics Inc |
4845 | P: Tim Shimmin | 4845 | P: Bill O'Donnell |
4846 | M: xfs-masters@oss.sgi.com | 4846 | M: xfs-masters@oss.sgi.com |
4847 | L: xfs@oss.sgi.com | 4847 | L: xfs@oss.sgi.com |
4848 | W: http://oss.sgi.com/projects/xfs | 4848 | W: http://oss.sgi.com/projects/xfs |
4849 | T: git git://oss.sgi.com:8090/xfs/xfs-2.6.git | 4849 | T: git://oss.sgi.com/xfs/xfs.git |
4850 | S: Supported | 4850 | S: Supported |
4851 | 4851 | ||
4852 | XILINX SYSTEMACE DRIVER | 4852 | XILINX SYSTEMACE DRIVER |
diff --git a/arch/Kconfig b/arch/Kconfig index 2e13aa261929..550dab22daa1 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -62,6 +62,9 @@ config HAVE_EFFICIENT_UNALIGNED_ACCESS | |||
62 | See Documentation/unaligned-memory-access.txt for more | 62 | See Documentation/unaligned-memory-access.txt for more |
63 | information on the topic of unaligned memory accesses. | 63 | information on the topic of unaligned memory accesses. |
64 | 64 | ||
65 | config HAVE_SYSCALL_WRAPPERS | ||
66 | bool | ||
67 | |||
65 | config KRETPROBES | 68 | config KRETPROBES |
66 | def_bool y | 69 | def_bool y |
67 | depends on KPROBES && HAVE_KRETPROBES | 70 | depends on KPROBES && HAVE_KRETPROBES |
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index 4dad27360576..b7c8f188b313 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild | |||
@@ -9,4 +9,3 @@ unifdef-y += console.h | |||
9 | unifdef-y += fpu.h | 9 | unifdef-y += fpu.h |
10 | unifdef-y += sysinfo.h | 10 | unifdef-y += sysinfo.h |
11 | unifdef-y += compiler.h | 11 | unifdef-y += compiler.h |
12 | unifdef-y += swab.h | ||
diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/asm/byteorder.h index 6772f3168701..73683093202d 100644 --- a/arch/alpha/include/asm/byteorder.h +++ b/arch/alpha/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ALPHA_BYTEORDER_H | 1 | #ifndef _ALPHA_BYTEORDER_H |
2 | #define _ALPHA_BYTEORDER_H | 2 | #define _ALPHA_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ALPHA_BYTEORDER_H */ | 6 | #endif /* _ALPHA_BYTEORDER_H */ |
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index f77345bc66a9..aa2e50cf9857 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S | |||
@@ -896,9 +896,9 @@ sys_getxpid: | |||
896 | .end sys_getxpid | 896 | .end sys_getxpid |
897 | 897 | ||
898 | .align 4 | 898 | .align 4 |
899 | .globl sys_pipe | 899 | .globl sys_alpha_pipe |
900 | .ent sys_pipe | 900 | .ent sys_alpha_pipe |
901 | sys_pipe: | 901 | sys_alpha_pipe: |
902 | lda $sp, -16($sp) | 902 | lda $sp, -16($sp) |
903 | stq $26, 0($sp) | 903 | stq $26, 0($sp) |
904 | .prologue 0 | 904 | .prologue 0 |
@@ -916,7 +916,7 @@ sys_pipe: | |||
916 | stq $1, 80+16($sp) | 916 | stq $1, 80+16($sp) |
917 | 1: lda $sp, 16($sp) | 917 | 1: lda $sp, 16($sp) |
918 | ret | 918 | ret |
919 | .end sys_pipe | 919 | .end sys_alpha_pipe |
920 | 920 | ||
921 | .align 4 | 921 | .align 4 |
922 | .globl sys_execve | 922 | .globl sys_execve |
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index ba914af18c4f..9d9e3a98bb95 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S | |||
@@ -52,7 +52,7 @@ sys_call_table: | |||
52 | .quad sys_setpgid | 52 | .quad sys_setpgid |
53 | .quad alpha_ni_syscall /* 40 */ | 53 | .quad alpha_ni_syscall /* 40 */ |
54 | .quad sys_dup | 54 | .quad sys_dup |
55 | .quad sys_pipe | 55 | .quad sys_alpha_pipe |
56 | .quad osf_set_program_attributes | 56 | .quad osf_set_program_attributes |
57 | .quad alpha_ni_syscall | 57 | .quad alpha_ni_syscall |
58 | .quad sys_open /* 45 */ | 58 | .quad sys_open /* 45 */ |
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 43b0b2ba392f..73237bd130a2 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += hwcap.h | 3 | unifdef-y += hwcap.h |
4 | unifdef-y += swab.h | ||
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h index c02b6fc28e1a..77379748b171 100644 --- a/arch/arm/include/asm/byteorder.h +++ b/arch/arm/include/asm/byteorder.h | |||
@@ -15,8 +15,6 @@ | |||
15 | #ifndef __ASM_ARM_BYTEORDER_H | 15 | #ifndef __ASM_ARM_BYTEORDER_H |
16 | #define __ASM_ARM_BYTEORDER_H | 16 | #define __ASM_ARM_BYTEORDER_H |
17 | 17 | ||
18 | #include <asm/swab.h> | ||
19 | |||
20 | #ifdef __ARMEB__ | 18 | #ifdef __ARMEB__ |
21 | #include <linux/byteorder/big_endian.h> | 19 | #include <linux/byteorder/big_endian.h> |
22 | #else | 20 | #else |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 09a061cb7838..9ca8d13f05f7 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -98,7 +98,7 @@ | |||
98 | CALL(sys_uselib) | 98 | CALL(sys_uselib) |
99 | CALL(sys_swapon) | 99 | CALL(sys_swapon) |
100 | CALL(sys_reboot) | 100 | CALL(sys_reboot) |
101 | CALL(OBSOLETE(old_readdir)) /* used by libc4 */ | 101 | CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */ |
102 | /* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ | 102 | /* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ |
103 | CALL(sys_munmap) | 103 | CALL(sys_munmap) |
104 | CALL(sys_truncate) | 104 | CALL(sys_truncate) |
diff --git a/arch/arm/mach-imx/clock.c b/arch/arm/mach-imx/clock.c index 7ec60fc91565..cf332aeb942e 100644 --- a/arch/arm/mach-imx/clock.c +++ b/arch/arm/mach-imx/clock.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/err.h> | 23 | #include <linux/err.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | 25 | ||
26 | #include <mach/imx-regs.h> | 26 | #include <mach/hardware.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Very simple approach: We can't disable clocks, so we do | 29 | * Very simple approach: We can't disable clocks, so we do |
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c index fa72174dd95c..887cb21f75b0 100644 --- a/arch/arm/mach-imx/generic.c +++ b/arch/arm/mach-imx/generic.c | |||
@@ -245,11 +245,11 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info) | |||
245 | imx_mmc_device.dev.platform_data = info; | 245 | imx_mmc_device.dev.platform_data = info; |
246 | } | 246 | } |
247 | 247 | ||
248 | static struct imxfb_mach_info imx_fb_info; | 248 | static struct imx_fb_platform_data imx_fb_info; |
249 | 249 | ||
250 | void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info) | 250 | void __init set_imx_fb_info(struct imx_fb_platform_data *hard_imx_fb_info) |
251 | { | 251 | { |
252 | memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info)); | 252 | memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imx_fb_platform_data)); |
253 | } | 253 | } |
254 | 254 | ||
255 | static struct resource imxfb_resources[] = { | 255 | static struct resource imxfb_resources[] = { |
diff --git a/arch/arm/mach-imx/include/mach/imx-regs.h b/arch/arm/mach-imx/include/mach/imx-regs.h index fb9de2733879..490297fc0e38 100644 --- a/arch/arm/mach-imx/include/mach/imx-regs.h +++ b/arch/arm/mach-imx/include/mach/imx-regs.h | |||
@@ -373,110 +373,4 @@ | |||
373 | #define TSTAT_CAPT (1<<1) | 373 | #define TSTAT_CAPT (1<<1) |
374 | #define TSTAT_COMP (1<<0) | 374 | #define TSTAT_COMP (1<<0) |
375 | 375 | ||
376 | /* | ||
377 | * LCD Controller | ||
378 | */ | ||
379 | |||
380 | #define LCDC_SSA __REG(IMX_LCDC_BASE+0x00) | ||
381 | |||
382 | #define LCDC_SIZE __REG(IMX_LCDC_BASE+0x04) | ||
383 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) | ||
384 | #define SIZE_YMAX(y) ( (y) & 0x1ff ) | ||
385 | |||
386 | #define LCDC_VPW __REG(IMX_LCDC_BASE+0x08) | ||
387 | #define VPW_VPW(x) ( (x) & 0x3ff ) | ||
388 | |||
389 | #define LCDC_CPOS __REG(IMX_LCDC_BASE+0x0C) | ||
390 | #define CPOS_CC1 (1<<31) | ||
391 | #define CPOS_CC0 (1<<30) | ||
392 | #define CPOS_OP (1<<28) | ||
393 | #define CPOS_CXP(x) (((x) & 3ff) << 16) | ||
394 | #define CPOS_CYP(y) ((y) & 0x1ff) | ||
395 | |||
396 | #define LCDC_LCWHB __REG(IMX_LCDC_BASE+0x10) | ||
397 | #define LCWHB_BK_EN (1<<31) | ||
398 | #define LCWHB_CW(w) (((w) & 0x1f) << 24) | ||
399 | #define LCWHB_CH(h) (((h) & 0x1f) << 16) | ||
400 | #define LCWHB_BD(x) ((x) & 0xff) | ||
401 | |||
402 | #define LCDC_LCHCC __REG(IMX_LCDC_BASE+0x14) | ||
403 | #define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11) | ||
404 | #define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5) | ||
405 | #define LCHCC_CUR_COL_B(b) ((b) & 0x1f) | ||
406 | |||
407 | #define LCDC_PCR __REG(IMX_LCDC_BASE+0x18) | ||
408 | #define PCR_TFT (1<<31) | ||
409 | #define PCR_COLOR (1<<30) | ||
410 | #define PCR_PBSIZ_1 (0<<28) | ||
411 | #define PCR_PBSIZ_2 (1<<28) | ||
412 | #define PCR_PBSIZ_4 (2<<28) | ||
413 | #define PCR_PBSIZ_8 (3<<28) | ||
414 | #define PCR_BPIX_1 (0<<25) | ||
415 | #define PCR_BPIX_2 (1<<25) | ||
416 | #define PCR_BPIX_4 (2<<25) | ||
417 | #define PCR_BPIX_8 (3<<25) | ||
418 | #define PCR_BPIX_12 (4<<25) | ||
419 | #define PCR_BPIX_16 (4<<25) | ||
420 | #define PCR_PIXPOL (1<<24) | ||
421 | #define PCR_FLMPOL (1<<23) | ||
422 | #define PCR_LPPOL (1<<22) | ||
423 | #define PCR_CLKPOL (1<<21) | ||
424 | #define PCR_OEPOL (1<<20) | ||
425 | #define PCR_SCLKIDLE (1<<19) | ||
426 | #define PCR_END_SEL (1<<18) | ||
427 | #define PCR_END_BYTE_SWAP (1<<17) | ||
428 | #define PCR_REV_VS (1<<16) | ||
429 | #define PCR_ACD_SEL (1<<15) | ||
430 | #define PCR_ACD(x) (((x) & 0x7f) << 8) | ||
431 | #define PCR_SCLK_SEL (1<<7) | ||
432 | #define PCR_SHARP (1<<6) | ||
433 | #define PCR_PCD(x) ((x) & 0x3f) | ||
434 | |||
435 | #define LCDC_HCR __REG(IMX_LCDC_BASE+0x1C) | ||
436 | #define HCR_H_WIDTH(x) (((x) & 0x3f) << 26) | ||
437 | #define HCR_H_WAIT_1(x) (((x) & 0xff) << 8) | ||
438 | #define HCR_H_WAIT_2(x) ((x) & 0xff) | ||
439 | |||
440 | #define LCDC_VCR __REG(IMX_LCDC_BASE+0x20) | ||
441 | #define VCR_V_WIDTH(x) (((x) & 0x3f) << 26) | ||
442 | #define VCR_V_WAIT_1(x) (((x) & 0xff) << 8) | ||
443 | #define VCR_V_WAIT_2(x) ((x) & 0xff) | ||
444 | |||
445 | #define LCDC_POS __REG(IMX_LCDC_BASE+0x24) | ||
446 | #define POS_POS(x) ((x) & 1f) | ||
447 | |||
448 | #define LCDC_LSCR1 __REG(IMX_LCDC_BASE+0x28) | ||
449 | #define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26) | ||
450 | #define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16) | ||
451 | #define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8) | ||
452 | #define LSCR1_GRAY2(x) (((x) & 0xf) << 4) | ||
453 | #define LSCR1_GRAY1(x) (((x) & 0xf)) | ||
454 | |||
455 | #define LCDC_PWMR __REG(IMX_LCDC_BASE+0x2C) | ||
456 | #define PWMR_CLS(x) (((x) & 0x1ff) << 16) | ||
457 | #define PWMR_LDMSK (1<<15) | ||
458 | #define PWMR_SCR1 (1<<10) | ||
459 | #define PWMR_SCR0 (1<<9) | ||
460 | #define PWMR_CC_EN (1<<8) | ||
461 | #define PWMR_PW(x) ((x) & 0xff) | ||
462 | |||
463 | #define LCDC_DMACR __REG(IMX_LCDC_BASE+0x30) | ||
464 | #define DMACR_BURST (1<<31) | ||
465 | #define DMACR_HM(x) (((x) & 0xf) << 16) | ||
466 | #define DMACR_TM(x) ((x) &0xf) | ||
467 | |||
468 | #define LCDC_RMCR __REG(IMX_LCDC_BASE+0x34) | ||
469 | #define RMCR_LCDC_EN (1<<1) | ||
470 | #define RMCR_SELF_REF (1<<0) | ||
471 | |||
472 | #define LCDC_LCDICR __REG(IMX_LCDC_BASE+0x38) | ||
473 | #define LCDICR_INT_SYN (1<<2) | ||
474 | #define LCDICR_INT_CON (1) | ||
475 | |||
476 | #define LCDC_LCDISR __REG(IMX_LCDC_BASE+0x40) | ||
477 | #define LCDISR_UDR_ERR (1<<3) | ||
478 | #define LCDISR_ERR_RES (1<<2) | ||
479 | #define LCDISR_EOF (1<<1) | ||
480 | #define LCDISR_BOF (1<<0) | ||
481 | |||
482 | #endif // _IMX_REGS_H | 376 | #endif // _IMX_REGS_H |
diff --git a/arch/arm/mach-w90x900/mach-w90p910evb.c b/arch/arm/mach-w90x900/mach-w90p910evb.c index 9307a2475438..9ebc93f48530 100644 --- a/arch/arm/mach-w90x900/mach-w90p910evb.c +++ b/arch/arm/mach-w90x900/mach-w90p910evb.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | 30 | ||
31 | #include <mach/regs-serial.h> | 31 | #include <mach/regs-serial.h> |
32 | #include <mach/map.h> | ||
32 | 33 | ||
33 | #include "cpu.h" | 34 | #include "cpu.h" |
34 | 35 | ||
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c index 3a69e381f316..bcc838f6b393 100644 --- a/arch/arm/mach-w90x900/time.c +++ b/arch/arm/mach-w90x900/time.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <asm/mach/irq.h> | 28 | #include <asm/mach/irq.h> |
29 | #include <asm/mach/time.h> | 29 | #include <asm/mach/time.h> |
30 | 30 | ||
31 | #include <mach/system.h> | ||
32 | #include <mach/map.h> | 31 | #include <mach/map.h> |
33 | #include <mach/regs-timer.h> | 32 | #include <mach/regs-timer.h> |
34 | 33 | ||
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c index 4ad3bf291ad3..195e48edd8c2 100644 --- a/arch/arm/mm/proc-syms.c +++ b/arch/arm/mm/proc-syms.c | |||
@@ -27,6 +27,7 @@ EXPORT_SYMBOL(__cpuc_flush_kern_all); | |||
27 | EXPORT_SYMBOL(__cpuc_flush_user_all); | 27 | EXPORT_SYMBOL(__cpuc_flush_user_all); |
28 | EXPORT_SYMBOL(__cpuc_flush_user_range); | 28 | EXPORT_SYMBOL(__cpuc_flush_user_range); |
29 | EXPORT_SYMBOL(__cpuc_coherent_kern_range); | 29 | EXPORT_SYMBOL(__cpuc_coherent_kern_range); |
30 | EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */ | ||
30 | #else | 31 | #else |
31 | EXPORT_SYMBOL(cpu_cache); | 32 | EXPORT_SYMBOL(cpu_cache); |
32 | #endif | 33 | #endif |
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index 219822c8ad18..3136628ba8d2 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | header-y += swab.h | ||
4 | header-y += cachectl.h | 3 | header-y += cachectl.h |
diff --git a/arch/avr32/include/asm/byteorder.h b/arch/avr32/include/asm/byteorder.h index 2aba64b4e122..50abc21619a8 100644 --- a/arch/avr32/include/asm/byteorder.h +++ b/arch/avr32/include/asm/byteorder.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifndef __ASM_AVR32_BYTEORDER_H | 4 | #ifndef __ASM_AVR32_BYTEORDER_H |
5 | #define __ASM_AVR32_BYTEORDER_H | 5 | #define __ASM_AVR32_BYTEORDER_H |
6 | 6 | ||
7 | #include <asm/swab.h> | ||
8 | #include <linux/byteorder/big_endian.h> | 7 | #include <linux/byteorder/big_endian.h> |
9 | 8 | ||
10 | #endif /* __ASM_AVR32_BYTEORDER_H */ | 9 | #endif /* __ASM_AVR32_BYTEORDER_H */ |
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index d0d1ac435544..606ecfdcc962 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += fixed_code.h | 3 | unifdef-y += fixed_code.h |
4 | unifdef-y += swab.h | ||
diff --git a/arch/blackfin/include/asm/byteorder.h b/arch/blackfin/include/asm/byteorder.h index b9e797a497b4..3e69106a4d37 100644 --- a/arch/blackfin/include/asm/byteorder.h +++ b/arch/blackfin/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _BLACKFIN_BYTEORDER_H | 1 | #ifndef _BLACKFIN_BYTEORDER_H |
2 | #define _BLACKFIN_BYTEORDER_H | 2 | #define _BLACKFIN_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _BLACKFIN_BYTEORDER_H */ | 6 | #endif /* _BLACKFIN_BYTEORDER_H */ |
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index ed171d389e65..72f5cd319b97 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S | |||
@@ -691,7 +691,7 @@ sys_call_table: | |||
691 | .long sys_uselib | 691 | .long sys_uselib |
692 | .long sys_swapon | 692 | .long sys_swapon |
693 | .long sys_reboot | 693 | .long sys_reboot |
694 | .long old_readdir | 694 | .long sys_old_readdir |
695 | .long old_mmap /* 90 */ | 695 | .long old_mmap /* 90 */ |
696 | .long sys_munmap | 696 | .long sys_munmap |
697 | .long sys_truncate | 697 | .long sys_truncate |
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S index 7f6f93e6b70e..5e674c8f7c51 100644 --- a/arch/cris/arch-v32/kernel/entry.S +++ b/arch/cris/arch-v32/kernel/entry.S | |||
@@ -614,7 +614,7 @@ sys_call_table: | |||
614 | .long sys_uselib | 614 | .long sys_uselib |
615 | .long sys_swapon | 615 | .long sys_swapon |
616 | .long sys_reboot | 616 | .long sys_reboot |
617 | .long old_readdir | 617 | .long sys_old_readdir |
618 | .long old_mmap /* 90 */ | 618 | .long old_mmap /* 90 */ |
619 | .long sys_munmap | 619 | .long sys_munmap |
620 | .long sys_truncate | 620 | .long sys_truncate |
diff --git a/arch/cris/include/arch-v10/arch/byteorder.h b/arch/cris/include/arch-v10/arch/swab.h index 255b646b7fa8..e4e847d8a05e 100644 --- a/arch/cris/include/arch-v10/arch/byteorder.h +++ b/arch/cris/include/arch-v10/arch/swab.h | |||
@@ -1,26 +1,30 @@ | |||
1 | #ifndef _CRIS_ARCH_BYTEORDER_H | 1 | #ifndef _CRIS_ARCH_SWAB_H |
2 | #define _CRIS_ARCH_BYTEORDER_H | 2 | #define _CRIS_ARCH_SWAB_H |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | 6 | ||
7 | #define __SWAB_64_THRU_32__ | ||
8 | |||
7 | /* we just define these two (as we can do the swap in a single | 9 | /* we just define these two (as we can do the swap in a single |
8 | * asm instruction in CRIS) and the arch-independent files will put | 10 | * asm instruction in CRIS) and the arch-independent files will put |
9 | * them together into ntohl etc. | 11 | * them together into ntohl etc. |
10 | */ | 12 | */ |
11 | 13 | ||
12 | static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) | 14 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) |
13 | { | 15 | { |
14 | __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); | 16 | __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); |
15 | 17 | ||
16 | return(x); | 18 | return(x); |
17 | } | 19 | } |
20 | #define __arch_swab32 __arch_swab32 | ||
18 | 21 | ||
19 | static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) | 22 | static inline __attribute_const__ __u16 __arch_swab16(__u16 x) |
20 | { | 23 | { |
21 | __asm__ ("swapb %0" : "=r" (x) : "0" (x)); | 24 | __asm__ ("swapb %0" : "=r" (x) : "0" (x)); |
22 | 25 | ||
23 | return(x); | 26 | return(x); |
24 | } | 27 | } |
28 | #define __arch_swab16 __arch_swab16 | ||
25 | 29 | ||
26 | #endif | 30 | #endif |
diff --git a/arch/cris/include/arch-v32/arch/byteorder.h b/arch/cris/include/arch-v32/arch/byteorder.h deleted file mode 100644 index 6ef8fb4a35f2..000000000000 --- a/arch/cris/include/arch-v32/arch/byteorder.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _ASM_CRIS_ARCH_BYTEORDER_H | ||
2 | #define _ASM_CRIS_ARCH_BYTEORDER_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
6 | static inline __const__ __u32 | ||
7 | ___arch__swab32(__u32 x) | ||
8 | { | ||
9 | __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); | ||
10 | return (x); | ||
11 | } | ||
12 | |||
13 | static inline __const__ __u16 | ||
14 | ___arch__swab16(__u16 x) | ||
15 | { | ||
16 | __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); | ||
17 | return (x); | ||
18 | } | ||
19 | |||
20 | #endif /* _ASM_CRIS_ARCH_BYTEORDER_H */ | ||
diff --git a/arch/cris/include/arch-v32/arch/swab.h b/arch/cris/include/arch-v32/arch/swab.h new file mode 100644 index 000000000000..9a4ea5e209c2 --- /dev/null +++ b/arch/cris/include/arch-v32/arch/swab.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef _ASM_CRIS_ARCH_SWAB_H | ||
2 | #define _ASM_CRIS_ARCH_SWAB_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
6 | #define __SWAB_64_THRU_32__ | ||
7 | |||
8 | static inline __const__ __u32 | ||
9 | __arch_swab32(__u32 x) | ||
10 | { | ||
11 | __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); | ||
12 | return (x); | ||
13 | } | ||
14 | #define __arch_swab32 __arch_swab32 | ||
15 | |||
16 | static inline __const__ __u16 | ||
17 | __arch_swab16(__u16 x) | ||
18 | { | ||
19 | __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); | ||
20 | return (x); | ||
21 | } | ||
22 | #define __arch_swab16 __arch_swab16 | ||
23 | |||
24 | #endif /* _ASM_CRIS_ARCH_SWAB_H */ | ||
diff --git a/arch/cris/include/asm/byteorder.h b/arch/cris/include/asm/byteorder.h index cc8e418cfd14..bcd189798e26 100644 --- a/arch/cris/include/asm/byteorder.h +++ b/arch/cris/include/asm/byteorder.h | |||
@@ -1,25 +1,6 @@ | |||
1 | #ifndef _CRIS_BYTEORDER_H | 1 | #ifndef _CRIS_BYTEORDER_H |
2 | #define _CRIS_BYTEORDER_H | 2 | #define _CRIS_BYTEORDER_H |
3 | 3 | ||
4 | #ifdef __GNUC__ | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | #include <arch/byteorder.h> | ||
8 | |||
9 | /* defines are necessary because the other files detect the presence | ||
10 | * of a defined __arch_swab32, not an inline | ||
11 | */ | ||
12 | #define __arch__swab32(x) ___arch__swab32(x) | ||
13 | #define __arch__swab16(x) ___arch__swab16(x) | ||
14 | #endif /* __KERNEL__ */ | ||
15 | |||
16 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
17 | # define __BYTEORDER_HAS_U64__ | ||
18 | # define __SWAB_64_THRU_32__ | ||
19 | #endif | ||
20 | |||
21 | #endif /* __GNUC__ */ | ||
22 | |||
23 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
24 | 5 | ||
25 | #endif | 6 | #endif |
diff --git a/arch/cris/include/asm/swab.h b/arch/cris/include/asm/swab.h new file mode 100644 index 000000000000..80668e88419c --- /dev/null +++ b/arch/cris/include/asm/swab.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _CRIS_SWAB_H | ||
2 | #define _CRIS_SWAB_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | #include <arch/swab.h> | ||
6 | #endif /* __KERNEL__ */ | ||
7 | |||
8 | #endif /* _CRIS_SWAB_H */ | ||
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 27b108a86b39..c68e1680da01 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild | |||
@@ -1,2 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | unifdef-y += swab.h | ||
diff --git a/arch/h8300/include/asm/byteorder.h b/arch/h8300/include/asm/byteorder.h index c36b80a3dd84..13539da99efd 100644 --- a/arch/h8300/include/asm/byteorder.h +++ b/arch/h8300/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _H8300_BYTEORDER_H | 1 | #ifndef _H8300_BYTEORDER_H |
2 | #define _H8300_BYTEORDER_H | 2 | #define _H8300_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _H8300_BYTEORDER_H */ | 6 | #endif /* _H8300_BYTEORDER_H */ |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index 54e21c3f2057..4eb67faac633 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -103,7 +103,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
103 | .long SYMBOL_NAME(sys_uselib) | 103 | .long SYMBOL_NAME(sys_uselib) |
104 | .long SYMBOL_NAME(sys_swapon) | 104 | .long SYMBOL_NAME(sys_swapon) |
105 | .long SYMBOL_NAME(sys_reboot) | 105 | .long SYMBOL_NAME(sys_reboot) |
106 | .long SYMBOL_NAME(old_readdir) | 106 | .long SYMBOL_NAME(sys_old_readdir) |
107 | .long SYMBOL_NAME(old_mmap) /* 90 */ | 107 | .long SYMBOL_NAME(old_mmap) /* 90 */ |
108 | .long SYMBOL_NAME(sys_munmap) | 108 | .long SYMBOL_NAME(sys_munmap) |
109 | .long SYMBOL_NAME(sys_truncate) | 109 | .long SYMBOL_NAME(sys_truncate) |
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S index a8cf19958850..a46f8395e9a5 100644 --- a/arch/ia64/ia32/ia32_entry.S +++ b/arch/ia64/ia32/ia32_entry.S | |||
@@ -220,7 +220,7 @@ ia32_syscall_table: | |||
220 | data8 sys_mkdir | 220 | data8 sys_mkdir |
221 | data8 sys_rmdir /* 40 */ | 221 | data8 sys_rmdir /* 40 */ |
222 | data8 sys_dup | 222 | data8 sys_dup |
223 | data8 sys_pipe | 223 | data8 sys_ia64_pipe |
224 | data8 compat_sys_times | 224 | data8 compat_sys_times |
225 | data8 sys_ni_syscall /* old prof syscall holder */ | 225 | data8 sys_ni_syscall /* old prof syscall holder */ |
226 | data8 sys32_brk /* 45 */ | 226 | data8 sys32_brk /* 45 */ |
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 3b25bd9dca91..ccbe8ae47a61 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild | |||
@@ -14,4 +14,3 @@ unifdef-y += gcc_intrin.h | |||
14 | unifdef-y += intrinsics.h | 14 | unifdef-y += intrinsics.h |
15 | unifdef-y += perfmon.h | 15 | unifdef-y += perfmon.h |
16 | unifdef-y += ustack.h | 16 | unifdef-y += ustack.h |
17 | unifdef-y += swab.h | ||
diff --git a/arch/ia64/include/asm/byteorder.h b/arch/ia64/include/asm/byteorder.h index 0f84c5cb703d..a8dd73558150 100644 --- a/arch/ia64/include/asm/byteorder.h +++ b/arch/ia64/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_IA64_BYTEORDER_H | 1 | #ifndef _ASM_IA64_BYTEORDER_H |
2 | #define _ASM_IA64_BYTEORDER_H | 2 | #define _ASM_IA64_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_IA64_BYTEORDER_H */ | 6 | #endif /* _ASM_IA64_BYTEORDER_H */ |
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index f791576355ad..9015979ebe0f 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
@@ -364,7 +364,7 @@ struct pt_regs; | |||
364 | struct sigaction; | 364 | struct sigaction; |
365 | long sys_execve(char __user *filename, char __user * __user *argv, | 365 | long sys_execve(char __user *filename, char __user * __user *argv, |
366 | char __user * __user *envp, struct pt_regs *regs); | 366 | char __user * __user *envp, struct pt_regs *regs); |
367 | asmlinkage long sys_pipe(void); | 367 | asmlinkage long sys_ia64_pipe(void); |
368 | asmlinkage long sys_rt_sigaction(int sig, | 368 | asmlinkage long sys_rt_sigaction(int sig, |
369 | const struct sigaction __user *act, | 369 | const struct sigaction __user *act, |
370 | struct sigaction __user *oact, | 370 | struct sigaction __user *oact, |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index d435f4a7a96c..e5341e2c1175 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1442,7 +1442,7 @@ sys_call_table: | |||
1442 | data8 sys_mkdir // 1055 | 1442 | data8 sys_mkdir // 1055 |
1443 | data8 sys_rmdir | 1443 | data8 sys_rmdir |
1444 | data8 sys_dup | 1444 | data8 sys_dup |
1445 | data8 sys_pipe | 1445 | data8 sys_ia64_pipe |
1446 | data8 sys_times | 1446 | data8 sys_times |
1447 | data8 ia64_brk // 1060 | 1447 | data8 ia64_brk // 1060 |
1448 | data8 sys_setgid | 1448 | data8 sys_setgid |
diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c index bcbb6d8792d3..92ed83f34036 100644 --- a/arch/ia64/kernel/sys_ia64.c +++ b/arch/ia64/kernel/sys_ia64.c | |||
@@ -154,7 +154,7 @@ out: | |||
154 | * and r9) as this is faster than doing a copy_to_user(). | 154 | * and r9) as this is faster than doing a copy_to_user(). |
155 | */ | 155 | */ |
156 | asmlinkage long | 156 | asmlinkage long |
157 | sys_pipe (void) | 157 | sys_ia64_pipe (void) |
158 | { | 158 | { |
159 | struct pt_regs *regs = task_pt_regs(current); | 159 | struct pt_regs *regs = task_pt_regs(current); |
160 | int fd[2]; | 160 | int fd[2]; |
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 5b780826647c..5c332f2b9b83 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S | |||
@@ -513,7 +513,7 @@ sys_call_table: | |||
513 | .long sys_uselib | 513 | .long sys_uselib |
514 | .long sys_swapon | 514 | .long sys_swapon |
515 | .long sys_reboot | 515 | .long sys_reboot |
516 | .long old_readdir | 516 | .long sys_old_readdir |
517 | .long old_mmap /* 90 */ | 517 | .long old_mmap /* 90 */ |
518 | .long sys_munmap | 518 | .long sys_munmap |
519 | .long sys_truncate | 519 | .long sys_truncate |
diff --git a/arch/m68knommu/include/asm/Kbuild b/arch/m68knommu/include/asm/Kbuild index 58c02a454130..c68e1680da01 100644 --- a/arch/m68knommu/include/asm/Kbuild +++ b/arch/m68knommu/include/asm/Kbuild | |||
@@ -1,3 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | |||
3 | unifdef-y += swab.h | ||
diff --git a/arch/m68knommu/include/asm/byteorder.h b/arch/m68knommu/include/asm/byteorder.h index a6f0b8f7f622..9c6c76a15041 100644 --- a/arch/m68knommu/include/asm/byteorder.h +++ b/arch/m68knommu/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _M68KNOMMU_BYTEORDER_H | 1 | #ifndef _M68KNOMMU_BYTEORDER_H |
2 | #define _M68KNOMMU_BYTEORDER_H | 2 | #define _M68KNOMMU_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _M68KNOMMU_BYTEORDER_H */ | 6 | #endif /* _M68KNOMMU_BYTEORDER_H */ |
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S index 812f8d8b7a85..5c3e3f62194a 100644 --- a/arch/m68knommu/kernel/syscalltable.S +++ b/arch/m68knommu/kernel/syscalltable.S | |||
@@ -107,7 +107,7 @@ ENTRY(sys_call_table) | |||
107 | .long sys_uselib | 107 | .long sys_uselib |
108 | .long sys_ni_syscall /* sys_swapon */ | 108 | .long sys_ni_syscall /* sys_swapon */ |
109 | .long sys_reboot | 109 | .long sys_reboot |
110 | .long old_readdir | 110 | .long sys_old_readdir |
111 | .long old_mmap /* 90 */ | 111 | .long old_mmap /* 90 */ |
112 | .long sys_munmap | 112 | .long sys_munmap |
113 | .long sys_truncate | 113 | .long sys_truncate |
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 023866c0c102..7897f05e3165 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | header-y += cachectl.h sgidefs.h sysmips.h | 3 | header-y += cachectl.h sgidefs.h sysmips.h |
4 | header-y += swab.h | ||
diff --git a/arch/mips/include/asm/byteorder.h b/arch/mips/include/asm/byteorder.h index 607b71830707..9579051ff1c7 100644 --- a/arch/mips/include/asm/byteorder.h +++ b/arch/mips/include/asm/byteorder.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #ifndef _ASM_BYTEORDER_H | 8 | #ifndef _ASM_BYTEORDER_H |
9 | #define _ASM_BYTEORDER_H | 9 | #define _ASM_BYTEORDER_H |
10 | 10 | ||
11 | #include <asm/swab.h> | ||
12 | |||
13 | #if defined(__MIPSEB__) | 11 | #if defined(__MIPSEB__) |
14 | #include <linux/byteorder/big_endian.h> | 12 | #include <linux/byteorder/big_endian.h> |
15 | #elif defined(__MIPSEL__) | 13 | #elif defined(__MIPSEL__) |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index d0916a55cd77..51d1ba415b90 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -398,7 +398,7 @@ einval: li v0, -ENOSYS | |||
398 | sys sys_uselib 1 | 398 | sys sys_uselib 1 |
399 | sys sys_swapon 2 | 399 | sys sys_swapon 2 |
400 | sys sys_reboot 3 | 400 | sys sys_reboot 3 |
401 | sys old_readdir 3 | 401 | sys sys_old_readdir 3 |
402 | sys old_mmap 6 /* 4090 */ | 402 | sys old_mmap 6 /* 4090 */ |
403 | sys sys_munmap 2 | 403 | sys sys_munmap 2 |
404 | sys sys_truncate 2 | 404 | sys sys_truncate 2 |
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S index 62fba8aa9b6e..ceeaaaa359e2 100644 --- a/arch/mn10300/kernel/entry.S +++ b/arch/mn10300/kernel/entry.S | |||
@@ -478,7 +478,7 @@ ENTRY(sys_call_table) | |||
478 | .long sys_uselib | 478 | .long sys_uselib |
479 | .long sys_swapon | 479 | .long sys_swapon |
480 | .long sys_reboot | 480 | .long sys_reboot |
481 | .long old_readdir | 481 | .long sys_old_readdir |
482 | .long old_mmap /* 90 */ | 482 | .long old_mmap /* 90 */ |
483 | .long sys_munmap | 483 | .long sys_munmap |
484 | .long sys_truncate | 484 | .long sys_truncate |
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index 2121d99f8364..f88b252e419c 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += pdc.h | 3 | unifdef-y += pdc.h |
4 | unifdef-y += swab.h | ||
diff --git a/arch/parisc/include/asm/byteorder.h b/arch/parisc/include/asm/byteorder.h index da66029c4cb2..58af2c5f5d61 100644 --- a/arch/parisc/include/asm/byteorder.h +++ b/arch/parisc/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _PARISC_BYTEORDER_H | 1 | #ifndef _PARISC_BYTEORDER_H |
2 | #define _PARISC_BYTEORDER_H | 2 | #define _PARISC_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _PARISC_BYTEORDER_H */ | 6 | #endif /* _PARISC_BYTEORDER_H */ |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 84b861316ce7..e39b73bc0ff8 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -123,6 +123,7 @@ config PPC | |||
123 | select HAVE_DMA_ATTRS if PPC64 | 123 | select HAVE_DMA_ATTRS if PPC64 |
124 | select USE_GENERIC_SMP_HELPERS if SMP | 124 | select USE_GENERIC_SMP_HELPERS if SMP |
125 | select HAVE_OPROFILE | 125 | select HAVE_OPROFILE |
126 | select HAVE_SYSCALL_WRAPPERS if PPC64 | ||
126 | 127 | ||
127 | config EARLY_PRINTK | 128 | config EARLY_PRINTK |
128 | bool | 129 | bool |
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild index 9268602de5d0..5ab7d7fe198c 100644 --- a/arch/powerpc/include/asm/Kbuild +++ b/arch/powerpc/include/asm/Kbuild | |||
@@ -35,4 +35,3 @@ unifdef-y += spu_info.h | |||
35 | unifdef-y += termios.h | 35 | unifdef-y += termios.h |
36 | unifdef-y += types.h | 36 | unifdef-y += types.h |
37 | unifdef-y += unistd.h | 37 | unifdef-y += unistd.h |
38 | unifdef-y += swab.h | ||
diff --git a/arch/powerpc/include/asm/byteorder.h b/arch/powerpc/include/asm/byteorder.h index 5cca27a41532..aa6cc4fac965 100644 --- a/arch/powerpc/include/asm/byteorder.h +++ b/arch/powerpc/include/asm/byteorder.h | |||
@@ -7,8 +7,6 @@ | |||
7 | * as published by the Free Software Foundation; either version | 7 | * as published by the Free Software Foundation; either version |
8 | * 2 of the License, or (at your option) any later version. | 8 | * 2 of the License, or (at your option) any later version. |
9 | */ | 9 | */ |
10 | |||
11 | #include <asm/swab.h> | ||
12 | #include <linux/byteorder/big_endian.h> | 10 | #include <linux/byteorder/big_endian.h> |
13 | 11 | ||
14 | #endif /* _ASM_POWERPC_BYTEORDER_H */ | 12 | #endif /* _ASM_POWERPC_BYTEORDER_H */ |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 803def236654..72353f6070a4 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -92,7 +92,7 @@ COMPAT_SYS_SPU(readlink) | |||
92 | SYSCALL(uselib) | 92 | SYSCALL(uselib) |
93 | SYSCALL(swapon) | 93 | SYSCALL(swapon) |
94 | SYSCALL(reboot) | 94 | SYSCALL(reboot) |
95 | SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) | 95 | SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir) |
96 | SYSCALL_SPU(mmap) | 96 | SYSCALL_SPU(mmap) |
97 | SYSCALL_SPU(munmap) | 97 | SYSCALL_SPU(munmap) |
98 | SYSCALL_SPU(truncate) | 98 | SYSCALL_SPU(truncate) |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index a94a3c3ae932..6b0a3538dc63 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -77,6 +77,7 @@ mainmenu "Linux Kernel Configuration" | |||
77 | config S390 | 77 | config S390 |
78 | def_bool y | 78 | def_bool y |
79 | select USE_GENERIC_SMP_HELPERS if SMP | 79 | select USE_GENERIC_SMP_HELPERS if SMP |
80 | select HAVE_SYSCALL_WRAPPERS | ||
80 | select HAVE_FUNCTION_TRACER | 81 | select HAVE_FUNCTION_TRACER |
81 | select HAVE_OPROFILE | 82 | select HAVE_OPROFILE |
82 | select HAVE_KPROBES | 83 | select HAVE_KPROBES |
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index f2af4167bd5f..63a23415fba6 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild | |||
@@ -13,4 +13,3 @@ unifdef-y += cmb.h | |||
13 | unifdef-y += debug.h | 13 | unifdef-y += debug.h |
14 | unifdef-y += chpid.h | 14 | unifdef-y += chpid.h |
15 | unifdef-y += schid.h | 15 | unifdef-y += schid.h |
16 | unifdef-y += swab.h | ||
diff --git a/arch/s390/include/asm/byteorder.h b/arch/s390/include/asm/byteorder.h index b95a2b2933fb..a332e59e26fc 100644 --- a/arch/s390/include/asm/byteorder.h +++ b/arch/s390/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _S390_BYTEORDER_H | 1 | #ifndef _S390_BYTEORDER_H |
2 | #define _S390_BYTEORDER_H | 2 | #define _S390_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _S390_BYTEORDER_H */ | 6 | #endif /* _S390_BYTEORDER_H */ |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index fc2c97197a53..6035cd20c7a7 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -547,7 +547,7 @@ sys32_setdomainname_wrapper: | |||
547 | .globl sys32_newuname_wrapper | 547 | .globl sys32_newuname_wrapper |
548 | sys32_newuname_wrapper: | 548 | sys32_newuname_wrapper: |
549 | llgtr %r2,%r2 # struct new_utsname * | 549 | llgtr %r2,%r2 # struct new_utsname * |
550 | jg s390x_newuname # branch to system call | 550 | jg sys_s390_newuname # branch to system call |
551 | 551 | ||
552 | .globl compat_sys_adjtimex_wrapper | 552 | .globl compat_sys_adjtimex_wrapper |
553 | compat_sys_adjtimex_wrapper: | 553 | compat_sys_adjtimex_wrapper: |
@@ -615,7 +615,7 @@ sys32_sysfs_wrapper: | |||
615 | .globl sys32_personality_wrapper | 615 | .globl sys32_personality_wrapper |
616 | sys32_personality_wrapper: | 616 | sys32_personality_wrapper: |
617 | llgfr %r2,%r2 # unsigned long | 617 | llgfr %r2,%r2 # unsigned long |
618 | jg s390x_personality # branch to system call | 618 | jg sys_s390_personality # branch to system call |
619 | 619 | ||
620 | .globl sys32_setfsuid16_wrapper | 620 | .globl sys32_setfsuid16_wrapper |
621 | sys32_setfsuid16_wrapper: | 621 | sys32_setfsuid16_wrapper: |
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index a65afc91e8aa..950c59c6688b 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -30,23 +30,23 @@ struct fadvise64_64_args; | |||
30 | struct old_sigaction; | 30 | struct old_sigaction; |
31 | struct sel_arg_struct; | 31 | struct sel_arg_struct; |
32 | 32 | ||
33 | long sys_pipe(unsigned long __user *fildes); | ||
34 | long sys_mmap2(struct mmap_arg_struct __user *arg); | 33 | long sys_mmap2(struct mmap_arg_struct __user *arg); |
35 | long old_mmap(struct mmap_arg_struct __user *arg); | 34 | long sys_s390_old_mmap(struct mmap_arg_struct __user *arg); |
36 | long sys_ipc(uint call, int first, unsigned long second, | 35 | long sys_ipc(uint call, int first, unsigned long second, |
37 | unsigned long third, void __user *ptr); | 36 | unsigned long third, void __user *ptr); |
38 | long s390x_newuname(struct new_utsname __user *name); | 37 | long sys_s390_newuname(struct new_utsname __user *name); |
39 | long s390x_personality(unsigned long personality); | 38 | long sys_s390_personality(unsigned long personality); |
40 | long s390_fadvise64(int fd, u32 offset_high, u32 offset_low, | 39 | long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, |
41 | size_t len, int advice); | 40 | size_t len, int advice); |
42 | long s390_fadvise64_64(struct fadvise64_64_args __user *args); | 41 | long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); |
43 | long s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, u32 len_low); | 42 | long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, |
43 | u32 len_low); | ||
44 | long sys_fork(void); | 44 | long sys_fork(void); |
45 | long sys_clone(void); | 45 | long sys_clone(void); |
46 | long sys_vfork(void); | 46 | long sys_vfork(void); |
47 | void execve_tail(void); | 47 | void execve_tail(void); |
48 | long sys_execve(void); | 48 | long sys_execve(void); |
49 | int sys_sigsuspend(int history0, int history1, old_sigset_t mask); | 49 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); |
50 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | 50 | long sys_sigaction(int sig, const struct old_sigaction __user *act, |
51 | struct old_sigaction __user *oact); | 51 | struct old_sigaction __user *oact); |
52 | long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss); | 52 | long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss); |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index b6110bdf8dc2..5cd38a90e64d 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/tick.h> | 39 | #include <linux/tick.h> |
40 | #include <linux/elfcore.h> | 40 | #include <linux/elfcore.h> |
41 | #include <linux/kernel_stat.h> | 41 | #include <linux/kernel_stat.h> |
42 | #include <linux/syscalls.h> | ||
42 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
43 | #include <asm/pgtable.h> | 44 | #include <asm/pgtable.h> |
44 | #include <asm/system.h> | 45 | #include <asm/system.h> |
@@ -225,13 +226,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp, | |||
225 | return 0; | 226 | return 0; |
226 | } | 227 | } |
227 | 228 | ||
228 | asmlinkage long sys_fork(void) | 229 | SYSCALL_DEFINE0(fork) |
229 | { | 230 | { |
230 | struct pt_regs *regs = task_pt_regs(current); | 231 | struct pt_regs *regs = task_pt_regs(current); |
231 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); | 232 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); |
232 | } | 233 | } |
233 | 234 | ||
234 | asmlinkage long sys_clone(void) | 235 | SYSCALL_DEFINE0(clone) |
235 | { | 236 | { |
236 | struct pt_regs *regs = task_pt_regs(current); | 237 | struct pt_regs *regs = task_pt_regs(current); |
237 | unsigned long clone_flags; | 238 | unsigned long clone_flags; |
@@ -258,7 +259,7 @@ asmlinkage long sys_clone(void) | |||
258 | * do not have enough call-clobbered registers to hold all | 259 | * do not have enough call-clobbered registers to hold all |
259 | * the information you need. | 260 | * the information you need. |
260 | */ | 261 | */ |
261 | asmlinkage long sys_vfork(void) | 262 | SYSCALL_DEFINE0(vfork) |
262 | { | 263 | { |
263 | struct pt_regs *regs = task_pt_regs(current); | 264 | struct pt_regs *regs = task_pt_regs(current); |
264 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, | 265 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, |
@@ -278,7 +279,7 @@ asmlinkage void execve_tail(void) | |||
278 | /* | 279 | /* |
279 | * sys_execve() executes a new program. | 280 | * sys_execve() executes a new program. |
280 | */ | 281 | */ |
281 | asmlinkage long sys_execve(void) | 282 | SYSCALL_DEFINE0(execve) |
282 | { | 283 | { |
283 | struct pt_regs *regs = task_pt_regs(current); | 284 | struct pt_regs *regs = task_pt_regs(current); |
284 | char *filename; | 285 | char *filename; |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 8e6812a22670..3cf74c3ccb69 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/personality.h> | 25 | #include <linux/personality.h> |
26 | #include <linux/binfmts.h> | 26 | #include <linux/binfmts.h> |
27 | #include <linux/tracehook.h> | 27 | #include <linux/tracehook.h> |
28 | #include <linux/syscalls.h> | ||
28 | #include <asm/ucontext.h> | 29 | #include <asm/ucontext.h> |
29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
30 | #include <asm/lowcore.h> | 31 | #include <asm/lowcore.h> |
@@ -53,8 +54,7 @@ typedef struct | |||
53 | /* | 54 | /* |
54 | * Atomically swap in the new signal mask, and wait for a signal. | 55 | * Atomically swap in the new signal mask, and wait for a signal. |
55 | */ | 56 | */ |
56 | asmlinkage int | 57 | SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) |
57 | sys_sigsuspend(int history0, int history1, old_sigset_t mask) | ||
58 | { | 58 | { |
59 | mask &= _BLOCKABLE; | 59 | mask &= _BLOCKABLE; |
60 | spin_lock_irq(¤t->sighand->siglock); | 60 | spin_lock_irq(¤t->sighand->siglock); |
@@ -70,9 +70,8 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask) | |||
70 | return -ERESTARTNOHAND; | 70 | return -ERESTARTNOHAND; |
71 | } | 71 | } |
72 | 72 | ||
73 | asmlinkage long | 73 | SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act, |
74 | sys_sigaction(int sig, const struct old_sigaction __user *act, | 74 | struct old_sigaction __user *, oact) |
75 | struct old_sigaction __user *oact) | ||
76 | { | 75 | { |
77 | struct k_sigaction new_ka, old_ka; | 76 | struct k_sigaction new_ka, old_ka; |
78 | int ret; | 77 | int ret; |
@@ -102,15 +101,13 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
102 | return ret; | 101 | return ret; |
103 | } | 102 | } |
104 | 103 | ||
105 | asmlinkage long | 104 | SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss, |
106 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | 105 | stack_t __user *, uoss) |
107 | { | 106 | { |
108 | struct pt_regs *regs = task_pt_regs(current); | 107 | struct pt_regs *regs = task_pt_regs(current); |
109 | return do_sigaltstack(uss, uoss, regs->gprs[15]); | 108 | return do_sigaltstack(uss, uoss, regs->gprs[15]); |
110 | } | 109 | } |
111 | 110 | ||
112 | |||
113 | |||
114 | /* Returns non-zero on fault. */ | 111 | /* Returns non-zero on fault. */ |
115 | static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | 112 | static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) |
116 | { | 113 | { |
@@ -164,7 +161,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | |||
164 | return 0; | 161 | return 0; |
165 | } | 162 | } |
166 | 163 | ||
167 | asmlinkage long sys_sigreturn(void) | 164 | SYSCALL_DEFINE0(sigreturn) |
168 | { | 165 | { |
169 | struct pt_regs *regs = task_pt_regs(current); | 166 | struct pt_regs *regs = task_pt_regs(current); |
170 | sigframe __user *frame = (sigframe __user *)regs->gprs[15]; | 167 | sigframe __user *frame = (sigframe __user *)regs->gprs[15]; |
@@ -191,7 +188,7 @@ badframe: | |||
191 | return 0; | 188 | return 0; |
192 | } | 189 | } |
193 | 190 | ||
194 | asmlinkage long sys_rt_sigreturn(void) | 191 | SYSCALL_DEFINE0(rt_sigreturn) |
195 | { | 192 | { |
196 | struct pt_regs *regs = task_pt_regs(current); | 193 | struct pt_regs *regs = task_pt_regs(current); |
197 | rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15]; | 194 | rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15]; |
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index c34be4568b80..c7ae4b17e0e3 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/personality.h> | 29 | #include <linux/personality.h> |
30 | #include <linux/unistd.h> | 30 | #include <linux/unistd.h> |
31 | #include <linux/ipc.h> | 31 | #include <linux/ipc.h> |
32 | #include <linux/syscalls.h> | ||
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
33 | #include "entry.h" | 34 | #include "entry.h" |
34 | 35 | ||
@@ -74,7 +75,7 @@ struct mmap_arg_struct { | |||
74 | unsigned long offset; | 75 | unsigned long offset; |
75 | }; | 76 | }; |
76 | 77 | ||
77 | asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg) | 78 | SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg) |
78 | { | 79 | { |
79 | struct mmap_arg_struct a; | 80 | struct mmap_arg_struct a; |
80 | int error = -EFAULT; | 81 | int error = -EFAULT; |
@@ -86,7 +87,7 @@ out: | |||
86 | return error; | 87 | return error; |
87 | } | 88 | } |
88 | 89 | ||
89 | asmlinkage long old_mmap(struct mmap_arg_struct __user *arg) | 90 | SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg) |
90 | { | 91 | { |
91 | struct mmap_arg_struct a; | 92 | struct mmap_arg_struct a; |
92 | long error = -EFAULT; | 93 | long error = -EFAULT; |
@@ -108,8 +109,8 @@ out: | |||
108 | * | 109 | * |
109 | * This is really horribly ugly. | 110 | * This is really horribly ugly. |
110 | */ | 111 | */ |
111 | asmlinkage long sys_ipc(uint call, int first, unsigned long second, | 112 | SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second, |
112 | unsigned long third, void __user *ptr) | 113 | unsigned long, third, void __user *, ptr) |
113 | { | 114 | { |
114 | struct ipc_kludge tmp; | 115 | struct ipc_kludge tmp; |
115 | int ret; | 116 | int ret; |
@@ -175,7 +176,7 @@ asmlinkage long sys_ipc(uint call, int first, unsigned long second, | |||
175 | } | 176 | } |
176 | 177 | ||
177 | #ifdef CONFIG_64BIT | 178 | #ifdef CONFIG_64BIT |
178 | asmlinkage long s390x_newuname(struct new_utsname __user *name) | 179 | SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name) |
179 | { | 180 | { |
180 | int ret = sys_newuname(name); | 181 | int ret = sys_newuname(name); |
181 | 182 | ||
@@ -186,7 +187,7 @@ asmlinkage long s390x_newuname(struct new_utsname __user *name) | |||
186 | return ret; | 187 | return ret; |
187 | } | 188 | } |
188 | 189 | ||
189 | asmlinkage long s390x_personality(unsigned long personality) | 190 | SYSCALL_DEFINE1(s390_personality, unsigned long, personality) |
190 | { | 191 | { |
191 | int ret; | 192 | int ret; |
192 | 193 | ||
@@ -205,15 +206,13 @@ asmlinkage long s390x_personality(unsigned long personality) | |||
205 | */ | 206 | */ |
206 | #ifndef CONFIG_64BIT | 207 | #ifndef CONFIG_64BIT |
207 | 208 | ||
208 | asmlinkage long | 209 | SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low, |
209 | s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice) | 210 | size_t, len, int, advice) |
210 | { | 211 | { |
211 | return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low, | 212 | return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low, |
212 | len, advice); | 213 | len, advice); |
213 | } | 214 | } |
214 | 215 | ||
215 | #endif | ||
216 | |||
217 | struct fadvise64_64_args { | 216 | struct fadvise64_64_args { |
218 | int fd; | 217 | int fd; |
219 | long long offset; | 218 | long long offset; |
@@ -221,8 +220,7 @@ struct fadvise64_64_args { | |||
221 | int advice; | 220 | int advice; |
222 | }; | 221 | }; |
223 | 222 | ||
224 | asmlinkage long | 223 | SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args) |
225 | s390_fadvise64_64(struct fadvise64_64_args __user *args) | ||
226 | { | 224 | { |
227 | struct fadvise64_64_args a; | 225 | struct fadvise64_64_args a; |
228 | 226 | ||
@@ -231,7 +229,6 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args) | |||
231 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); | 229 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); |
232 | } | 230 | } |
233 | 231 | ||
234 | #ifndef CONFIG_64BIT | ||
235 | /* | 232 | /* |
236 | * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last | 233 | * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last |
237 | * 64 bit argument "len" is split into the upper and lower 32 bits. The | 234 | * 64 bit argument "len" is split into the upper and lower 32 bits. The |
@@ -244,9 +241,19 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args) | |||
244 | * to | 241 | * to |
245 | * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len | 242 | * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len |
246 | */ | 243 | */ |
247 | asmlinkage long s390_fallocate(int fd, int mode, loff_t offset, | 244 | SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset, |
248 | u32 len_high, u32 len_low) | 245 | u32 len_high, u32 len_low) |
249 | { | 246 | { |
250 | return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); | 247 | return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); |
251 | } | 248 | } |
249 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
250 | asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset, | ||
251 | long len_high, long len_low) | ||
252 | { | ||
253 | return SYSC_s390_fallocate((int) fd, (int) mode, offset, | ||
254 | (u32) len_high, (u32) len_low); | ||
255 | } | ||
256 | SYSCALL_ALIAS(sys_s390_fallocate, SyS_s390_fallocate); | ||
257 | #endif | ||
258 | |||
252 | #endif | 259 | #endif |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 2d61787949d5..76d16e0140bb 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -98,7 +98,7 @@ SYSCALL(sys_uselib,sys_uselib,sys32_uselib_wrapper) | |||
98 | SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) | 98 | SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) |
99 | SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) | 99 | SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) |
100 | SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ | 100 | SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ |
101 | SYSCALL(old_mmap,old_mmap,old32_mmap_wrapper) /* 90 */ | 101 | SYSCALL(sys_s390_old_mmap,sys_s390_old_mmap,old32_mmap_wrapper) /* 90 */ |
102 | SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) | 102 | SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) |
103 | SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper) | 103 | SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper) |
104 | SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper) | 104 | SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper) |
@@ -130,7 +130,7 @@ SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) | |||
130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) | 130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) |
131 | SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */ | 131 | SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */ |
132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) | 132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) |
133 | SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper) | 133 | SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) |
134 | NI_SYSCALL /* modify_ldt for i386 */ | 134 | NI_SYSCALL /* modify_ldt for i386 */ |
135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) | 135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) |
136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ | 136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ |
@@ -144,7 +144,7 @@ SYSCALL(sys_getpgid,sys_getpgid,sys32_getpgid_wrapper) | |||
144 | SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper) | 144 | SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper) |
145 | SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper) | 145 | SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper) |
146 | SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */ | 146 | SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */ |
147 | SYSCALL(sys_personality,s390x_personality,sys32_personality_wrapper) | 147 | SYSCALL(sys_personality,sys_s390_personality,sys32_personality_wrapper) |
148 | NI_SYSCALL /* for afs_syscall */ | 148 | NI_SYSCALL /* for afs_syscall */ |
149 | SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */ | 149 | SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */ |
150 | SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */ | 150 | SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */ |
@@ -261,7 +261,7 @@ SYSCALL(sys_epoll_create,sys_epoll_create,sys_epoll_create_wrapper) | |||
261 | SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */ | 261 | SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */ |
262 | SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper) | 262 | SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper) |
263 | SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper) | 263 | SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper) |
264 | SYSCALL(s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) | 264 | SYSCALL(sys_s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) |
265 | SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper) | 265 | SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper) |
266 | SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */ | 266 | SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */ |
267 | SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper) | 267 | SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper) |
@@ -272,7 +272,7 @@ SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260 | |||
272 | SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) | 272 | SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) |
273 | SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) | 273 | SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) |
274 | NI_SYSCALL /* reserved for vserver */ | 274 | NI_SYSCALL /* reserved for vserver */ |
275 | SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) | 275 | SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) |
276 | SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) | 276 | SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) |
277 | SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) | 277 | SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) |
278 | SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper) | 278 | SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper) |
@@ -322,7 +322,7 @@ NI_SYSCALL /* 310 sys_move_pages */ | |||
322 | SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) | 322 | SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) |
323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) | 323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) |
324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) | 324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) |
325 | SYSCALL(s390_fallocate,sys_fallocate,sys_fallocate_wrapper) | 325 | SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper) |
326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ | 326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ |
327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) | 327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) |
328 | NI_SYSCALL /* 317 old sys_timer_fd */ | 328 | NI_SYSCALL /* 317 old sys_timer_fd */ |
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index f1a2a0d1c79c..43910cdf78a5 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild | |||
@@ -6,4 +6,3 @@ unifdef-y += unistd_32.h | |||
6 | unifdef-y += unistd_64.h | 6 | unifdef-y += unistd_64.h |
7 | unifdef-y += posix_types_32.h | 7 | unifdef-y += posix_types_32.h |
8 | unifdef-y += posix_types_64.h | 8 | unifdef-y += posix_types_64.h |
9 | unifdef-y += swab.h | ||
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/asm/byteorder.h index e95c41a5c8cc..db2f5d7cb17d 100644 --- a/arch/sh/include/asm/byteorder.h +++ b/arch/sh/include/asm/byteorder.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __ASM_SH_BYTEORDER_H | 1 | #ifndef __ASM_SH_BYTEORDER_H |
2 | #define __ASM_SH_BYTEORDER_H | 2 | #define __ASM_SH_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | |||
6 | #ifdef __LITTLE_ENDIAN__ | 4 | #ifdef __LITTLE_ENDIAN__ |
7 | #include <linux/byteorder/little_endian.h> | 5 | #include <linux/byteorder/little_endian.h> |
8 | #else | 6 | #else |
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h index 104c5e686106..8b30200305c3 100644 --- a/arch/sh/include/asm/syscalls_32.h +++ b/arch/sh/include/asm/syscalls_32.h | |||
@@ -36,9 +36,9 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | |||
36 | asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | 36 | asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, |
37 | unsigned long r6, unsigned long r7, | 37 | unsigned long r6, unsigned long r7, |
38 | struct pt_regs __regs); | 38 | struct pt_regs __regs); |
39 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | 39 | asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, |
40 | unsigned long r6, unsigned long r7, | 40 | unsigned long r6, unsigned long r7, |
41 | struct pt_regs __regs); | 41 | struct pt_regs __regs); |
42 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, | 42 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, |
43 | size_t count, long dummy, loff_t pos); | 43 | size_t count, long dummy, loff_t pos); |
44 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, | 44 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, |
diff --git a/arch/sh/kernel/sys_sh32.c b/arch/sh/kernel/sys_sh32.c index dbba1e1833d4..63ba12836eae 100644 --- a/arch/sh/kernel/sys_sh32.c +++ b/arch/sh/kernel/sys_sh32.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * sys_pipe() is the normal C calling standard for creating | 22 | * sys_pipe() is the normal C calling standard for creating |
23 | * a pipe. It's not the way Unix traditionally does this, though. | 23 | * a pipe. It's not the way Unix traditionally does this, though. |
24 | */ | 24 | */ |
25 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | 25 | asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, |
26 | unsigned long r6, unsigned long r7, | 26 | unsigned long r6, unsigned long r7, |
27 | struct pt_regs __regs) | 27 | struct pt_regs __regs) |
28 | { | 28 | { |
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 0af693e65764..e67c1733e1b9 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S | |||
@@ -58,7 +58,7 @@ ENTRY(sys_call_table) | |||
58 | .long sys_mkdir | 58 | .long sys_mkdir |
59 | .long sys_rmdir /* 40 */ | 59 | .long sys_rmdir /* 40 */ |
60 | .long sys_dup | 60 | .long sys_dup |
61 | .long sys_pipe | 61 | .long sys_sh_pipe |
62 | .long sys_times | 62 | .long sys_times |
63 | .long sys_ni_syscall /* old prof syscall holder */ | 63 | .long sys_ni_syscall /* old prof syscall holder */ |
64 | .long sys_brk /* 45 */ | 64 | .long sys_brk /* 45 */ |
@@ -105,7 +105,7 @@ ENTRY(sys_call_table) | |||
105 | .long sys_uselib | 105 | .long sys_uselib |
106 | .long sys_swapon | 106 | .long sys_swapon |
107 | .long sys_reboot | 107 | .long sys_reboot |
108 | .long old_readdir | 108 | .long sys_old_readdir |
109 | .long old_mmap /* 90 */ | 109 | .long old_mmap /* 90 */ |
110 | .long sys_munmap | 110 | .long sys_munmap |
111 | .long sys_truncate | 111 | .long sys_truncate |
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S index 0b436aa3cad7..557cb91f5caf 100644 --- a/arch/sh/kernel/syscalls_64.S +++ b/arch/sh/kernel/syscalls_64.S | |||
@@ -109,7 +109,7 @@ sys_call_table: | |||
109 | .long sys_uselib | 109 | .long sys_uselib |
110 | .long sys_swapon | 110 | .long sys_swapon |
111 | .long sys_reboot | 111 | .long sys_reboot |
112 | .long old_readdir | 112 | .long sys_old_readdir |
113 | .long old_mmap /* 90 */ | 113 | .long old_mmap /* 90 */ |
114 | .long sys_munmap | 114 | .long sys_munmap |
115 | .long sys_truncate | 115 | .long sys_truncate |
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index 95e38a43dff0..deeb0fba8029 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild | |||
@@ -17,4 +17,3 @@ header-y += traps.h | |||
17 | header-y += uctx.h | 17 | header-y += uctx.h |
18 | header-y += utrap.h | 18 | header-y += utrap.h |
19 | header-y += watchdog.h | 19 | header-y += watchdog.h |
20 | header-y += swab.h | ||
diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h index 48a047cd6fa9..ccc1b6b7de6c 100644 --- a/arch/sparc/include/asm/byteorder.h +++ b/arch/sparc/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _SPARC_BYTEORDER_H | 1 | #ifndef _SPARC_BYTEORDER_H |
2 | #define _SPARC_BYTEORDER_H | 2 | #define _SPARC_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _SPARC_BYTEORDER_H */ | 6 | #endif /* _SPARC_BYTEORDER_H */ |
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index faf9ccd9ef5d..f41ecc5ac0b4 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S | |||
@@ -1088,8 +1088,8 @@ sunos_execv: | |||
1088 | ld [%sp + STACKFRAME_SZ + PT_I0], %o0 | 1088 | ld [%sp + STACKFRAME_SZ + PT_I0], %o0 |
1089 | 1089 | ||
1090 | .align 4 | 1090 | .align 4 |
1091 | .globl sys_pipe | 1091 | .globl sys_sparc_pipe |
1092 | sys_pipe: | 1092 | sys_sparc_pipe: |
1093 | mov %o7, %l5 | 1093 | mov %o7, %l5 |
1094 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg | 1094 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg |
1095 | call sparc_pipe | 1095 | call sparc_pipe |
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S index 7a6786a71363..87f5a3b8a253 100644 --- a/arch/sparc/kernel/syscalls.S +++ b/arch/sparc/kernel/syscalls.S | |||
@@ -20,7 +20,7 @@ execve_merge: | |||
20 | add %sp, PTREGS_OFF, %o0 | 20 | add %sp, PTREGS_OFF, %o0 |
21 | 21 | ||
22 | .align 32 | 22 | .align 32 |
23 | sys_pipe: | 23 | sys_sparc_pipe: |
24 | ba,pt %xcc, sparc_pipe | 24 | ba,pt %xcc, sparc_pipe |
25 | add %sp, PTREGS_OFF, %o0 | 25 | add %sp, PTREGS_OFF, %o0 |
26 | sys_nis_syscall: | 26 | sys_nis_syscall: |
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 7d0807586442..dccc95df0c7f 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
@@ -24,7 +24,7 @@ sys_call_table: | |||
24 | /*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause | 24 | /*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause |
25 | /*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice | 25 | /*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice |
26 | /*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile | 26 | /*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile |
27 | /*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid | 27 | /*40*/ .long sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_getuid |
28 | /*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 | 28 | /*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 |
29 | /*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl | 29 | /*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl |
30 | /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve | 30 | /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve |
@@ -56,7 +56,7 @@ sys_call_table: | |||
56 | /*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname | 56 | /*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname |
57 | /*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl | 57 | /*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl |
58 | /*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask | 58 | /*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask |
59 | /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir | 59 | /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir |
60 | /*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 | 60 | /*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 |
61 | /*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo | 61 | /*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo |
62 | /*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex | 62 | /*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 9fc78cf354bd..e6007bb37046 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -26,7 +26,7 @@ sys_call_table32: | |||
26 | /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause | 26 | /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause |
27 | /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice | 27 | /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice |
28 | .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile | 28 | .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile |
29 | /*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid | 29 | /*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid |
30 | .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 | 30 | .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 |
31 | /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl | 31 | /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl |
32 | .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve | 32 | .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve |
@@ -100,7 +100,7 @@ sys_call_table: | |||
100 | /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall | 100 | /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall |
101 | /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice | 101 | /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice |
102 | .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 | 102 | .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 |
103 | /*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall | 103 | /*40*/ .word sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_nis_syscall |
104 | .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid | 104 | .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid |
105 | /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl | 105 | /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl |
106 | .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve | 106 | .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve |
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index a9f8a814a1f7..4a8e80cdcfa5 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild | |||
@@ -22,4 +22,3 @@ unifdef-y += unistd_32.h | |||
22 | unifdef-y += unistd_64.h | 22 | unifdef-y += unistd_64.h |
23 | unifdef-y += vm86.h | 23 | unifdef-y += vm86.h |
24 | unifdef-y += vsyscall.h | 24 | unifdef-y += vsyscall.h |
25 | unifdef-y += swab.h | ||
diff --git a/arch/x86/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h index 7c49917e3d9d..b13a7a88f3eb 100644 --- a/arch/x86/include/asm/byteorder.h +++ b/arch/x86/include/asm/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_X86_BYTEORDER_H | 1 | #ifndef _ASM_X86_BYTEORDER_H |
2 | #define _ASM_X86_BYTEORDER_H | 2 | #define _ASM_X86_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_X86_BYTEORDER_H */ | 6 | #endif /* _ASM_X86_BYTEORDER_H */ |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 83e69f4a37f0..06bbcbd66e9c 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -341,6 +341,25 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
341 | 341 | ||
342 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | 342 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) |
343 | 343 | ||
344 | static inline int is_new_memtype_allowed(unsigned long flags, | ||
345 | unsigned long new_flags) | ||
346 | { | ||
347 | /* | ||
348 | * Certain new memtypes are not allowed with certain | ||
349 | * requested memtype: | ||
350 | * - request is uncached, return cannot be write-back | ||
351 | * - request is write-combine, return cannot be write-back | ||
352 | */ | ||
353 | if ((flags == _PAGE_CACHE_UC_MINUS && | ||
354 | new_flags == _PAGE_CACHE_WB) || | ||
355 | (flags == _PAGE_CACHE_WC && | ||
356 | new_flags == _PAGE_CACHE_WB)) { | ||
357 | return 0; | ||
358 | } | ||
359 | |||
360 | return 1; | ||
361 | } | ||
362 | |||
344 | #ifndef __ASSEMBLY__ | 363 | #ifndef __ASSEMBLY__ |
345 | /* Indicate that x86 has its own track and untrack pfn vma functions */ | 364 | /* Indicate that x86 has its own track and untrack pfn vma functions */ |
346 | #define __HAVE_PFNMAP_TRACKING | 365 | #define __HAVE_PFNMAP_TRACKING |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index d6f0490a7391..46469029e9d3 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1203,7 +1203,6 @@ nmi_stack_correct: | |||
1203 | pushl %eax | 1203 | pushl %eax |
1204 | CFI_ADJUST_CFA_OFFSET 4 | 1204 | CFI_ADJUST_CFA_OFFSET 4 |
1205 | SAVE_ALL | 1205 | SAVE_ALL |
1206 | TRACE_IRQS_OFF | ||
1207 | xorl %edx,%edx # zero error code | 1206 | xorl %edx,%edx # zero error code |
1208 | movl %esp,%eax # pt_regs pointer | 1207 | movl %esp,%eax # pt_regs pointer |
1209 | call do_nmi | 1208 | call do_nmi |
@@ -1244,7 +1243,6 @@ nmi_espfix_stack: | |||
1244 | pushl %eax | 1243 | pushl %eax |
1245 | CFI_ADJUST_CFA_OFFSET 4 | 1244 | CFI_ADJUST_CFA_OFFSET 4 |
1246 | SAVE_ALL | 1245 | SAVE_ALL |
1247 | TRACE_IRQS_OFF | ||
1248 | FIXUP_ESPFIX_STACK # %eax == %esp | 1246 | FIXUP_ESPFIX_STACK # %eax == %esp |
1249 | xorl %edx,%edx # zero error code | 1247 | xorl %edx,%edx # zero error code |
1250 | call do_nmi | 1248 | call do_nmi |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index d44395ff34c3..e2e86a08f31d 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -88,7 +88,7 @@ ENTRY(sys_call_table) | |||
88 | .long sys_uselib | 88 | .long sys_uselib |
89 | .long sys_swapon | 89 | .long sys_swapon |
90 | .long sys_reboot | 90 | .long sys_reboot |
91 | .long old_readdir | 91 | .long sys_old_readdir |
92 | .long old_mmap /* 90 */ | 92 | .long old_mmap /* 90 */ |
93 | .long sys_munmap | 93 | .long sys_munmap |
94 | .long sys_truncate | 94 | .long sys_truncate |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index e89d24815f26..4cf30dee8161 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -555,10 +555,12 @@ repeat: | |||
555 | if (!pte_val(old_pte)) { | 555 | if (!pte_val(old_pte)) { |
556 | if (!primary) | 556 | if (!primary) |
557 | return 0; | 557 | return 0; |
558 | WARN(1, KERN_WARNING "CPA: called for zero pte. " | 558 | |
559 | "vaddr = %lx cpa->vaddr = %lx\n", address, | 559 | /* |
560 | *cpa->vaddr); | 560 | * Special error value returned, indicating that the mapping |
561 | return -EINVAL; | 561 | * did not exist at this address. |
562 | */ | ||
563 | return -EFAULT; | ||
562 | } | 564 | } |
563 | 565 | ||
564 | if (level == PG_LEVEL_4K) { | 566 | if (level == PG_LEVEL_4K) { |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 85cbd3cd3723..160c42d3eb8f 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -505,6 +505,35 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) | |||
505 | } | 505 | } |
506 | #endif /* CONFIG_STRICT_DEVMEM */ | 506 | #endif /* CONFIG_STRICT_DEVMEM */ |
507 | 507 | ||
508 | /* | ||
509 | * Change the memory type for the physial address range in kernel identity | ||
510 | * mapping space if that range is a part of identity map. | ||
511 | */ | ||
512 | static int kernel_map_sync_memtype(u64 base, unsigned long size, | ||
513 | unsigned long flags) | ||
514 | { | ||
515 | unsigned long id_sz; | ||
516 | int ret; | ||
517 | |||
518 | if (!pat_enabled || base >= __pa(high_memory)) | ||
519 | return 0; | ||
520 | |||
521 | id_sz = (__pa(high_memory) < base + size) ? | ||
522 | __pa(high_memory) - base : | ||
523 | size; | ||
524 | |||
525 | ret = ioremap_change_attr((unsigned long)__va(base), id_sz, flags); | ||
526 | /* | ||
527 | * -EFAULT return means that the addr was not valid and did not have | ||
528 | * any identity mapping. That case is a success for | ||
529 | * kernel_map_sync_memtype. | ||
530 | */ | ||
531 | if (ret == -EFAULT) | ||
532 | ret = 0; | ||
533 | |||
534 | return ret; | ||
535 | } | ||
536 | |||
508 | int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | 537 | int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, |
509 | unsigned long size, pgprot_t *vma_prot) | 538 | unsigned long size, pgprot_t *vma_prot) |
510 | { | 539 | { |
@@ -555,9 +584,7 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
555 | if (retval < 0) | 584 | if (retval < 0) |
556 | return 0; | 585 | return 0; |
557 | 586 | ||
558 | if (((pfn < max_low_pfn_mapped) || | 587 | if (kernel_map_sync_memtype(offset, size, flags)) { |
559 | (pfn >= (1UL<<(32 - PAGE_SHIFT)) && pfn < max_pfn_mapped)) && | ||
560 | ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) { | ||
561 | free_memtype(offset, offset + size); | 588 | free_memtype(offset, offset + size); |
562 | printk(KERN_INFO | 589 | printk(KERN_INFO |
563 | "%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n", | 590 | "%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n", |
@@ -601,12 +628,13 @@ void unmap_devmem(unsigned long pfn, unsigned long size, pgprot_t vma_prot) | |||
601 | * Reserved non RAM regions only and after successful reserve_memtype, | 628 | * Reserved non RAM regions only and after successful reserve_memtype, |
602 | * this func also keeps identity mapping (if any) in sync with this new prot. | 629 | * this func also keeps identity mapping (if any) in sync with this new prot. |
603 | */ | 630 | */ |
604 | static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t vma_prot) | 631 | static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, |
632 | int strict_prot) | ||
605 | { | 633 | { |
606 | int is_ram = 0; | 634 | int is_ram = 0; |
607 | int id_sz, ret; | 635 | int ret; |
608 | unsigned long flags; | 636 | unsigned long flags; |
609 | unsigned long want_flags = (pgprot_val(vma_prot) & _PAGE_CACHE_MASK); | 637 | unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); |
610 | 638 | ||
611 | is_ram = pagerange_is_ram(paddr, paddr + size); | 639 | is_ram = pagerange_is_ram(paddr, paddr + size); |
612 | 640 | ||
@@ -625,26 +653,27 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t vma_prot) | |||
625 | return ret; | 653 | return ret; |
626 | 654 | ||
627 | if (flags != want_flags) { | 655 | if (flags != want_flags) { |
628 | free_memtype(paddr, paddr + size); | 656 | if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) { |
629 | printk(KERN_ERR | 657 | free_memtype(paddr, paddr + size); |
630 | "%s:%d map pfn expected mapping type %s for %Lx-%Lx, got %s\n", | 658 | printk(KERN_ERR "%s:%d map pfn expected mapping type %s" |
631 | current->comm, current->pid, | 659 | " for %Lx-%Lx, got %s\n", |
632 | cattr_name(want_flags), | 660 | current->comm, current->pid, |
633 | (unsigned long long)paddr, | 661 | cattr_name(want_flags), |
634 | (unsigned long long)(paddr + size), | 662 | (unsigned long long)paddr, |
635 | cattr_name(flags)); | 663 | (unsigned long long)(paddr + size), |
636 | return -EINVAL; | 664 | cattr_name(flags)); |
665 | return -EINVAL; | ||
666 | } | ||
667 | /* | ||
668 | * We allow returning different type than the one requested in | ||
669 | * non strict case. | ||
670 | */ | ||
671 | *vma_prot = __pgprot((pgprot_val(*vma_prot) & | ||
672 | (~_PAGE_CACHE_MASK)) | | ||
673 | flags); | ||
637 | } | 674 | } |
638 | 675 | ||
639 | /* Need to keep identity mapping in sync */ | 676 | if (kernel_map_sync_memtype(paddr, size, flags)) { |
640 | if (paddr >= __pa(high_memory)) | ||
641 | return 0; | ||
642 | |||
643 | id_sz = (__pa(high_memory) < paddr + size) ? | ||
644 | __pa(high_memory) - paddr : | ||
645 | size; | ||
646 | |||
647 | if (ioremap_change_attr((unsigned long)__va(paddr), id_sz, flags) < 0) { | ||
648 | free_memtype(paddr, paddr + size); | 677 | free_memtype(paddr, paddr + size); |
649 | printk(KERN_ERR | 678 | printk(KERN_ERR |
650 | "%s:%d reserve_pfn_range ioremap_change_attr failed %s " | 679 | "%s:%d reserve_pfn_range ioremap_change_attr failed %s " |
@@ -689,6 +718,7 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) | |||
689 | unsigned long vma_start = vma->vm_start; | 718 | unsigned long vma_start = vma->vm_start; |
690 | unsigned long vma_end = vma->vm_end; | 719 | unsigned long vma_end = vma->vm_end; |
691 | unsigned long vma_size = vma_end - vma_start; | 720 | unsigned long vma_size = vma_end - vma_start; |
721 | pgprot_t pgprot; | ||
692 | 722 | ||
693 | if (!pat_enabled) | 723 | if (!pat_enabled) |
694 | return 0; | 724 | return 0; |
@@ -702,7 +732,8 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) | |||
702 | WARN_ON_ONCE(1); | 732 | WARN_ON_ONCE(1); |
703 | return -EINVAL; | 733 | return -EINVAL; |
704 | } | 734 | } |
705 | return reserve_pfn_range(paddr, vma_size, __pgprot(prot)); | 735 | pgprot = __pgprot(prot); |
736 | return reserve_pfn_range(paddr, vma_size, &pgprot, 1); | ||
706 | } | 737 | } |
707 | 738 | ||
708 | /* reserve entire vma page by page, using pfn and prot from pte */ | 739 | /* reserve entire vma page by page, using pfn and prot from pte */ |
@@ -710,7 +741,8 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) | |||
710 | if (follow_phys(vma, vma_start + i, 0, &prot, &paddr)) | 741 | if (follow_phys(vma, vma_start + i, 0, &prot, &paddr)) |
711 | continue; | 742 | continue; |
712 | 743 | ||
713 | retval = reserve_pfn_range(paddr, PAGE_SIZE, __pgprot(prot)); | 744 | pgprot = __pgprot(prot); |
745 | retval = reserve_pfn_range(paddr, PAGE_SIZE, &pgprot, 1); | ||
714 | if (retval) | 746 | if (retval) |
715 | goto cleanup_ret; | 747 | goto cleanup_ret; |
716 | } | 748 | } |
@@ -741,7 +773,7 @@ cleanup_ret: | |||
741 | * Note that this function can be called with caller trying to map only a | 773 | * Note that this function can be called with caller trying to map only a |
742 | * subrange/page inside the vma. | 774 | * subrange/page inside the vma. |
743 | */ | 775 | */ |
744 | int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | 776 | int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot, |
745 | unsigned long pfn, unsigned long size) | 777 | unsigned long pfn, unsigned long size) |
746 | { | 778 | { |
747 | int retval = 0; | 779 | int retval = 0; |
@@ -758,14 +790,14 @@ int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | |||
758 | if (is_linear_pfn_mapping(vma)) { | 790 | if (is_linear_pfn_mapping(vma)) { |
759 | /* reserve the whole chunk starting from vm_pgoff */ | 791 | /* reserve the whole chunk starting from vm_pgoff */ |
760 | paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT; | 792 | paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT; |
761 | return reserve_pfn_range(paddr, vma_size, prot); | 793 | return reserve_pfn_range(paddr, vma_size, prot, 0); |
762 | } | 794 | } |
763 | 795 | ||
764 | /* reserve page by page using pfn and size */ | 796 | /* reserve page by page using pfn and size */ |
765 | base_paddr = (resource_size_t)pfn << PAGE_SHIFT; | 797 | base_paddr = (resource_size_t)pfn << PAGE_SHIFT; |
766 | for (i = 0; i < size; i += PAGE_SIZE) { | 798 | for (i = 0; i < size; i += PAGE_SIZE) { |
767 | paddr = base_paddr + i; | 799 | paddr = base_paddr + i; |
768 | retval = reserve_pfn_range(paddr, PAGE_SIZE, prot); | 800 | retval = reserve_pfn_range(paddr, PAGE_SIZE, prot, 0); |
769 | if (retval) | 801 | if (retval) |
770 | goto cleanup_ret; | 802 | goto cleanup_ret; |
771 | } | 803 | } |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index f884740da318..5ead808dd70c 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -314,17 +314,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
314 | return retval; | 314 | return retval; |
315 | 315 | ||
316 | if (flags != new_flags) { | 316 | if (flags != new_flags) { |
317 | /* | 317 | if (!is_new_memtype_allowed(flags, new_flags)) { |
318 | * Do not fallback to certain memory types with certain | ||
319 | * requested type: | ||
320 | * - request is uncached, return cannot be write-back | ||
321 | * - request is uncached, return cannot be write-combine | ||
322 | * - request is write-combine, return cannot be write-back | ||
323 | */ | ||
324 | if ((flags == _PAGE_CACHE_UC_MINUS && | ||
325 | (new_flags == _PAGE_CACHE_WB)) || | ||
326 | (flags == _PAGE_CACHE_WC && | ||
327 | new_flags == _PAGE_CACHE_WB)) { | ||
328 | free_memtype(addr, addr+len); | 318 | free_memtype(addr, addr+len); |
329 | return -EINVAL; | 319 | return -EINVAL; |
330 | } | 320 | } |
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 58c02a454130..c68e1680da01 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild | |||
@@ -1,3 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | |||
3 | unifdef-y += swab.h | ||
diff --git a/arch/xtensa/include/asm/byteorder.h b/arch/xtensa/include/asm/byteorder.h index 329b94591ca4..54eb6315349c 100644 --- a/arch/xtensa/include/asm/byteorder.h +++ b/arch/xtensa/include/asm/byteorder.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _XTENSA_BYTEORDER_H | 1 | #ifndef _XTENSA_BYTEORDER_H |
2 | #define _XTENSA_BYTEORDER_H | 2 | #define _XTENSA_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | |||
6 | #ifdef __XTENSA_EL__ | 4 | #ifdef __XTENSA_EL__ |
7 | #include <linux/byteorder/little_endian.h> | 5 | #include <linux/byteorder/little_endian.h> |
8 | #elif defined(__XTENSA_EB__) | 6 | #elif defined(__XTENSA_EB__) |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 0eae9b453556..5a4aad123c42 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1013,9 +1013,12 @@ next_sg: | |||
1013 | qc->cursg_ofs = 0; | 1013 | qc->cursg_ofs = 0; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | /* consumed can be larger than count only for the last transfer */ | 1016 | /* |
1017 | WARN_ON_ONCE(qc->cursg && count != consumed); | 1017 | * There used to be a WARN_ON_ONCE(qc->cursg && count != consumed); |
1018 | 1018 | * Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN | |
1019 | * check correctly as it doesn't know if it is the last request being | ||
1020 | * made. Somebody should implement a proper sanity check. | ||
1021 | */ | ||
1019 | if (bytes) | 1022 | if (bytes) |
1020 | goto next_sg; | 1023 | goto next_sg; |
1021 | return 0; | 1024 | return 0; |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index f828a29d7756..f1bb2f9fecbf 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -80,7 +80,7 @@ | |||
80 | 80 | ||
81 | 81 | ||
82 | #define DRV_NAME "pata_it821x" | 82 | #define DRV_NAME "pata_it821x" |
83 | #define DRV_VERSION "0.4.0" | 83 | #define DRV_VERSION "0.4.2" |
84 | 84 | ||
85 | struct it821x_dev | 85 | struct it821x_dev |
86 | { | 86 | { |
@@ -494,8 +494,6 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus | |||
494 | * special. In our case we need to lock the sector count to avoid | 494 | * special. In our case we need to lock the sector count to avoid |
495 | * blowing the brains out of the firmware with large LBA48 requests | 495 | * blowing the brains out of the firmware with large LBA48 requests |
496 | * | 496 | * |
497 | * FIXME: When FUA appears we need to block FUA too. And SMART and | ||
498 | * basically we need to filter commands for this chip. | ||
499 | */ | 497 | */ |
500 | 498 | ||
501 | static void it821x_dev_config(struct ata_device *adev) | 499 | static void it821x_dev_config(struct ata_device *adev) |
@@ -890,6 +888,13 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
890 | .flags = ATA_FLAG_SLAVE_POSS, | 888 | .flags = ATA_FLAG_SLAVE_POSS, |
891 | .pio_mask = 0x1f, | 889 | .pio_mask = 0x1f, |
892 | .mwdma_mask = 0x07, | 890 | .mwdma_mask = 0x07, |
891 | .udma_mask = ATA_UDMA6, | ||
892 | .port_ops = &it821x_rdc_port_ops | ||
893 | }; | ||
894 | static const struct ata_port_info info_rdc_11 = { | ||
895 | .flags = ATA_FLAG_SLAVE_POSS, | ||
896 | .pio_mask = 0x1f, | ||
897 | .mwdma_mask = 0x07, | ||
893 | /* No UDMA */ | 898 | /* No UDMA */ |
894 | .port_ops = &it821x_rdc_port_ops | 899 | .port_ops = &it821x_rdc_port_ops |
895 | }; | 900 | }; |
@@ -903,7 +908,11 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
903 | return rc; | 908 | return rc; |
904 | 909 | ||
905 | if (pdev->vendor == PCI_VENDOR_ID_RDC) { | 910 | if (pdev->vendor == PCI_VENDOR_ID_RDC) { |
906 | ppi[0] = &info_rdc; | 911 | /* Deal with Vortex86SX */ |
912 | if (pdev->revision == 0x11) | ||
913 | ppi[0] = &info_rdc_11; | ||
914 | else | ||
915 | ppi[0] = &info_rdc; | ||
907 | } else { | 916 | } else { |
908 | /* Force the card into bypass mode if so requested */ | 917 | /* Force the card into bypass mode if so requested */ |
909 | if (it8212_noraid) { | 918 | if (it8212_noraid) { |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 3f9503867e6b..b1c6f68d98ce 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -701,11 +701,6 @@ config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | |||
701 | depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX | 701 | depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX |
702 | endchoice | 702 | endchoice |
703 | 703 | ||
704 | config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ | ||
705 | int "Maximum transfer size (KB) per request (up to 128)" | ||
706 | default "128" | ||
707 | depends on BLK_DEV_IDE_AU1XXX | ||
708 | |||
709 | config BLK_DEV_IDE_TX4938 | 704 | config BLK_DEV_IDE_TX4938 |
710 | tristate "TX4938 internal IDE support" | 705 | tristate "TX4938 internal IDE support" |
711 | depends on SOC_TX4938 | 706 | depends on SOC_TX4938 |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 4088a622873e..806760d24cef 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -633,7 +633,7 @@ static void ide_disk_setup(ide_drive_t *drive) | |||
633 | printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name, | 633 | printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name, |
634 | q->max_sectors / 2); | 634 | q->max_sectors / 2); |
635 | 635 | ||
636 | if (ata_id_is_ssd(id) || ata_id_is_cfa(id)) | 636 | if (ata_id_is_ssd(id)) |
637 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); | 637 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); |
638 | 638 | ||
639 | /* calculate drive capacity, and select LBA if possible */ | 639 | /* calculate drive capacity, and select LBA if possible */ |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index e728cfe7273f..753b92ebe0ae 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -493,7 +493,7 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti | |||
493 | stat = tp_ops->read_status(hwif); | 493 | stat = tp_ops->read_status(hwif); |
494 | 494 | ||
495 | if (stat & ATA_BUSY) { | 495 | if (stat & ATA_BUSY) { |
496 | local_irq_save(flags); | 496 | local_save_flags(flags); |
497 | local_irq_enable_in_hardirq(); | 497 | local_irq_enable_in_hardirq(); |
498 | timeout += jiffies; | 498 | timeout += jiffies; |
499 | while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { | 499 | while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { |
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index 4b3bf6a06b70..60538d9c84ee 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c | |||
@@ -186,12 +186,10 @@ void ide_complete_pm_request(ide_drive_t *drive, struct request *rq) | |||
186 | blk_pm_suspend_request(rq) ? "suspend" : "resume"); | 186 | blk_pm_suspend_request(rq) ? "suspend" : "resume"); |
187 | #endif | 187 | #endif |
188 | spin_lock_irqsave(q->queue_lock, flags); | 188 | spin_lock_irqsave(q->queue_lock, flags); |
189 | if (blk_pm_suspend_request(rq)) { | 189 | if (blk_pm_suspend_request(rq)) |
190 | blk_stop_queue(q); | 190 | blk_stop_queue(q); |
191 | } else { | 191 | else |
192 | drive->dev_flags &= ~IDE_DFLAG_BLOCKED; | 192 | drive->dev_flags &= ~IDE_DFLAG_BLOCKED; |
193 | blk_start_queue(q); | ||
194 | } | ||
195 | spin_unlock_irqrestore(q->queue_lock, flags); | 193 | spin_unlock_irqrestore(q->queue_lock, flags); |
196 | 194 | ||
197 | drive->hwif->rq = NULL; | 195 | drive->hwif->rq = NULL; |
@@ -219,6 +217,8 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq) | |||
219 | * point. | 217 | * point. |
220 | */ | 218 | */ |
221 | ide_hwif_t *hwif = drive->hwif; | 219 | ide_hwif_t *hwif = drive->hwif; |
220 | struct request_queue *q = drive->queue; | ||
221 | unsigned long flags; | ||
222 | int rc; | 222 | int rc; |
223 | #ifdef DEBUG_PM | 223 | #ifdef DEBUG_PM |
224 | printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name); | 224 | printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name); |
@@ -231,5 +231,9 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq) | |||
231 | rc = ide_wait_not_busy(hwif, 100000); | 231 | rc = ide_wait_not_busy(hwif, 100000); |
232 | if (rc) | 232 | if (rc) |
233 | printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); | 233 | printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); |
234 | |||
235 | spin_lock_irqsave(q->queue_lock, flags); | ||
236 | blk_start_queue(q); | ||
237 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
234 | } | 238 | } |
235 | } | 239 | } |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 0ccbb4459fb9..312127ea443a 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -796,7 +796,7 @@ static int ide_probe_port(ide_hwif_t *hwif) | |||
796 | if (irqd) | 796 | if (irqd) |
797 | disable_irq(hwif->irq); | 797 | disable_irq(hwif->irq); |
798 | 798 | ||
799 | local_irq_save(flags); | 799 | local_save_flags(flags); |
800 | local_irq_enable_in_hardirq(); | 800 | local_irq_enable_in_hardirq(); |
801 | 801 | ||
802 | if (ide_port_wait_ready(hwif) == -EBUSY) | 802 | if (ide_port_wait_ready(hwif) == -EBUSY) |
diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c index 0be27ac1f077..e1c4f5437396 100644 --- a/drivers/ide/it821x.c +++ b/drivers/ide/it821x.c | |||
@@ -68,6 +68,8 @@ | |||
68 | 68 | ||
69 | #define DRV_NAME "it821x" | 69 | #define DRV_NAME "it821x" |
70 | 70 | ||
71 | #define QUIRK_VORTEX86 1 | ||
72 | |||
71 | struct it821x_dev | 73 | struct it821x_dev |
72 | { | 74 | { |
73 | unsigned int smart:1, /* Are we in smart raid mode */ | 75 | unsigned int smart:1, /* Are we in smart raid mode */ |
@@ -79,6 +81,7 @@ struct it821x_dev | |||
79 | u16 pio[2]; /* Cached PIO values */ | 81 | u16 pio[2]; /* Cached PIO values */ |
80 | u16 mwdma[2]; /* Cached MWDMA values */ | 82 | u16 mwdma[2]; /* Cached MWDMA values */ |
81 | u16 udma[2]; /* Cached UDMA values (per drive) */ | 83 | u16 udma[2]; /* Cached UDMA values (per drive) */ |
84 | u16 quirks; | ||
82 | }; | 85 | }; |
83 | 86 | ||
84 | #define ATA_66 0 | 87 | #define ATA_66 0 |
@@ -557,8 +560,7 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) | |||
557 | * this is necessary. | 560 | * this is necessary. |
558 | */ | 561 | */ |
559 | 562 | ||
560 | pci_read_config_byte(dev, 0x08, &conf); | 563 | if (dev->revision == 0x10) { |
561 | if (conf == 0x10) { | ||
562 | idev->timing10 = 1; | 564 | idev->timing10 = 1; |
563 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; | 565 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; |
564 | if (idev->smart == 0) | 566 | if (idev->smart == 0) |
@@ -577,6 +579,12 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) | |||
577 | 579 | ||
578 | hwif->ultra_mask = ATA_UDMA6; | 580 | hwif->ultra_mask = ATA_UDMA6; |
579 | hwif->mwdma_mask = ATA_MWDMA2; | 581 | hwif->mwdma_mask = ATA_MWDMA2; |
582 | |||
583 | /* Vortex86SX quirk: prevent Ultra-DMA mode to fix BadCRC issue */ | ||
584 | if (idev->quirks & QUIRK_VORTEX86) { | ||
585 | if (dev->revision == 0x11) | ||
586 | hwif->ultra_mask = 0; | ||
587 | } | ||
580 | } | 588 | } |
581 | 589 | ||
582 | static void it8212_disable_raid(struct pci_dev *dev) | 590 | static void it8212_disable_raid(struct pci_dev *dev) |
@@ -649,6 +657,8 @@ static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_devic | |||
649 | return -ENOMEM; | 657 | return -ENOMEM; |
650 | } | 658 | } |
651 | 659 | ||
660 | itdevs->quirks = id->driver_data; | ||
661 | |||
652 | rc = ide_pci_init_one(dev, &it821x_chipset, itdevs); | 662 | rc = ide_pci_init_one(dev, &it821x_chipset, itdevs); |
653 | if (rc) | 663 | if (rc) |
654 | kfree(itdevs); | 664 | kfree(itdevs); |
@@ -668,6 +678,7 @@ static void __devexit it821x_remove(struct pci_dev *dev) | |||
668 | static const struct pci_device_id it821x_pci_tbl[] = { | 678 | static const struct pci_device_id it821x_pci_tbl[] = { |
669 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 }, | 679 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 }, |
670 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 }, | 680 | { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 }, |
681 | { PCI_VDEVICE(RDC, PCI_DEVICE_ID_RDC_D1010), QUIRK_VORTEX86 }, | ||
671 | { 0, }, | 682 | { 0, }, |
672 | }; | 683 | }; |
673 | 684 | ||
diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c index 48cc748c5043..6297956507c0 100644 --- a/drivers/ide/sl82c105.c +++ b/drivers/ide/sl82c105.c | |||
@@ -310,10 +310,6 @@ static const struct ide_port_info sl82c105_chipset __devinitdata = { | |||
310 | .dma_ops = &sl82c105_dma_ops, | 310 | .dma_ops = &sl82c105_dma_ops, |
311 | .host_flags = IDE_HFLAG_IO_32BIT | | 311 | .host_flags = IDE_HFLAG_IO_32BIT | |
312 | IDE_HFLAG_UNMASK_IRQS | | 312 | IDE_HFLAG_UNMASK_IRQS | |
313 | /* FIXME: check for Compatibility mode in generic IDE PCI code */ | ||
314 | #if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT) | ||
315 | IDE_HFLAG_FORCE_LEGACY_IRQS | | ||
316 | #endif | ||
317 | IDE_HFLAG_SERIALIZE_DMA | | 313 | IDE_HFLAG_SERIALIZE_DMA | |
318 | IDE_HFLAG_NO_AUTODMA, | 314 | IDE_HFLAG_NO_AUTODMA, |
319 | .pio_mask = ATA_PIO5, | 315 | .pio_mask = ATA_PIO5, |
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index b4ef218072cd..d9095345f7ca 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c | |||
@@ -202,7 +202,6 @@ static const struct ide_tp_ops tx4938ide_tp_ops = { | |||
202 | .exec_command = ide_exec_command, | 202 | .exec_command = ide_exec_command, |
203 | .read_status = ide_read_status, | 203 | .read_status = ide_read_status, |
204 | .read_altstatus = ide_read_altstatus, | 204 | .read_altstatus = ide_read_altstatus, |
205 | .read_sff_dma_status = ide_read_sff_dma_status, | ||
206 | 205 | ||
207 | .set_irq = ide_set_irq, | 206 | .set_irq = ide_set_irq, |
208 | 207 | ||
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c index fecc0e03c3fc..703c3eeb20a8 100644 --- a/drivers/ide/via82cxxx.c +++ b/drivers/ide/via82cxxx.c | |||
@@ -432,8 +432,6 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i | |||
432 | if (via_clock < 20000 || via_clock > 50000) { | 432 | if (via_clock < 20000 || via_clock > 50000) { |
433 | printk(KERN_WARNING DRV_NAME ": User given PCI clock speed " | 433 | printk(KERN_WARNING DRV_NAME ": User given PCI clock speed " |
434 | "impossible (%d), using 33 MHz instead.\n", via_clock); | 434 | "impossible (%d), using 33 MHz instead.\n", via_clock); |
435 | printk(KERN_WARNING DRV_NAME ": Use ide0=ata66 if you want " | ||
436 | "to assume 80-wire cable.\n"); | ||
437 | via_clock = 33333; | 435 | via_clock = 33333; |
438 | } | 436 | } |
439 | 437 | ||
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 3b77b674cbf6..c7b8a506af65 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -955,7 +955,7 @@ void ehca_poll_eqs(unsigned long data) | |||
955 | struct ehca_eq *eq = &shca->eq; | 955 | struct ehca_eq *eq = &shca->eq; |
956 | int max = 3; | 956 | int max = 3; |
957 | volatile u64 q_ofs, q_ofs2; | 957 | volatile u64 q_ofs, q_ofs2; |
958 | u64 flags; | 958 | unsigned long flags; |
959 | spin_lock_irqsave(&eq->spinlock, flags); | 959 | spin_lock_irqsave(&eq->spinlock, flags); |
960 | q_ofs = eq->ipz_queue.current_q_offset; | 960 | q_ofs = eq->ipz_queue.current_q_offset; |
961 | spin_unlock_irqrestore(&eq->spinlock, flags); | 961 | spin_unlock_irqrestore(&eq->spinlock, flags); |
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index dcefe1fceb5c..61588bd273bd 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -543,14 +543,21 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
543 | { | 543 | { |
544 | static int mlx4_ib_version_printed; | 544 | static int mlx4_ib_version_printed; |
545 | struct mlx4_ib_dev *ibdev; | 545 | struct mlx4_ib_dev *ibdev; |
546 | int num_ports = 0; | ||
546 | int i; | 547 | int i; |
547 | 548 | ||
548 | |||
549 | if (!mlx4_ib_version_printed) { | 549 | if (!mlx4_ib_version_printed) { |
550 | printk(KERN_INFO "%s", mlx4_ib_version); | 550 | printk(KERN_INFO "%s", mlx4_ib_version); |
551 | ++mlx4_ib_version_printed; | 551 | ++mlx4_ib_version_printed; |
552 | } | 552 | } |
553 | 553 | ||
554 | mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) | ||
555 | num_ports++; | ||
556 | |||
557 | /* No point in registering a device with no ports... */ | ||
558 | if (num_ports == 0) | ||
559 | return NULL; | ||
560 | |||
554 | ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev); | 561 | ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev); |
555 | if (!ibdev) { | 562 | if (!ibdev) { |
556 | dev_err(&dev->pdev->dev, "Device struct alloc failed\n"); | 563 | dev_err(&dev->pdev->dev, "Device struct alloc failed\n"); |
@@ -574,9 +581,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
574 | ibdev->ib_dev.owner = THIS_MODULE; | 581 | ibdev->ib_dev.owner = THIS_MODULE; |
575 | ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; | 582 | ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; |
576 | ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey; | 583 | ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey; |
577 | ibdev->num_ports = 0; | 584 | ibdev->num_ports = num_ports; |
578 | mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) | ||
579 | ibdev->num_ports++; | ||
580 | ibdev->ib_dev.phys_port_cnt = ibdev->num_ports; | 585 | ibdev->ib_dev.phys_port_cnt = ibdev->num_ports; |
581 | ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors; | 586 | ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors; |
582 | ibdev->ib_dev.dma_device = &dev->pdev->dev; | 587 | ibdev->ib_dev.dma_device = &dev->pdev->dev; |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 6ba57e91d7ab..a01b4488208b 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -778,12 +778,13 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core, | |||
778 | unsigned long flags; | 778 | unsigned long flags; |
779 | struct list_head *hte; | 779 | struct list_head *hte; |
780 | struct nes_cm_node *cm_node; | 780 | struct nes_cm_node *cm_node; |
781 | __be32 tmp_addr = cpu_to_be32(loc_addr); | ||
781 | 782 | ||
782 | /* get a handle on the hte */ | 783 | /* get a handle on the hte */ |
783 | hte = &cm_core->connected_nodes; | 784 | hte = &cm_core->connected_nodes; |
784 | 785 | ||
785 | nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n", | 786 | nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n", |
786 | &loc_addr, loc_port, cm_core, hte); | 787 | &tmp_addr, loc_port, cm_core, hte); |
787 | 788 | ||
788 | /* walk list and find cm_node associated with this session ID */ | 789 | /* walk list and find cm_node associated with this session ID */ |
789 | spin_lock_irqsave(&cm_core->ht_lock, flags); | 790 | spin_lock_irqsave(&cm_core->ht_lock, flags); |
@@ -816,6 +817,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core, | |||
816 | { | 817 | { |
817 | unsigned long flags; | 818 | unsigned long flags; |
818 | struct nes_cm_listener *listen_node; | 819 | struct nes_cm_listener *listen_node; |
820 | __be32 tmp_addr = cpu_to_be32(dst_addr); | ||
819 | 821 | ||
820 | /* walk list and find cm_node associated with this session ID */ | 822 | /* walk list and find cm_node associated with this session ID */ |
821 | spin_lock_irqsave(&cm_core->listen_list_lock, flags); | 823 | spin_lock_irqsave(&cm_core->listen_list_lock, flags); |
@@ -833,7 +835,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core, | |||
833 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); | 835 | spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); |
834 | 836 | ||
835 | nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n", | 837 | nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n", |
836 | &dst_addr, dst_port); | 838 | &tmp_addr, dst_port); |
837 | 839 | ||
838 | /* no listener */ | 840 | /* no listener */ |
839 | return NULL; | 841 | return NULL; |
@@ -2059,6 +2061,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, | |||
2059 | struct tcphdr *tcph; | 2061 | struct tcphdr *tcph; |
2060 | struct nes_cm_info nfo; | 2062 | struct nes_cm_info nfo; |
2061 | int skb_handled = 1; | 2063 | int skb_handled = 1; |
2064 | __be32 tmp_daddr, tmp_saddr; | ||
2062 | 2065 | ||
2063 | if (!skb) | 2066 | if (!skb) |
2064 | return 0; | 2067 | return 0; |
@@ -2074,8 +2077,11 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, | |||
2074 | nfo.rem_addr = ntohl(iph->saddr); | 2077 | nfo.rem_addr = ntohl(iph->saddr); |
2075 | nfo.rem_port = ntohs(tcph->source); | 2078 | nfo.rem_port = ntohs(tcph->source); |
2076 | 2079 | ||
2080 | tmp_daddr = cpu_to_be32(iph->daddr); | ||
2081 | tmp_saddr = cpu_to_be32(iph->saddr); | ||
2082 | |||
2077 | nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", | 2083 | nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", |
2078 | &iph->daddr, tcph->dest, &iph->saddr, tcph->source); | 2084 | &tmp_daddr, tcph->dest, &tmp_saddr, tcph->source); |
2079 | 2085 | ||
2080 | do { | 2086 | do { |
2081 | cm_node = find_node(cm_core, | 2087 | cm_node = find_node(cm_core, |
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c index aa9b7348c728..6f3bc1b6bf22 100644 --- a/drivers/infiniband/hw/nes/nes_utils.c +++ b/drivers/infiniband/hw/nes/nes_utils.c | |||
@@ -655,6 +655,7 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti | |||
655 | struct nes_adapter *nesadapter = nesdev->nesadapter; | 655 | struct nes_adapter *nesadapter = nesdev->nesadapter; |
656 | int arp_index; | 656 | int arp_index; |
657 | int err = 0; | 657 | int err = 0; |
658 | __be32 tmp_addr; | ||
658 | 659 | ||
659 | for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) { | 660 | for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) { |
660 | if (nesadapter->arp_table[arp_index].ip_addr == ip_addr) | 661 | if (nesadapter->arp_table[arp_index].ip_addr == ip_addr) |
@@ -682,8 +683,9 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti | |||
682 | 683 | ||
683 | /* DELETE or RESOLVE */ | 684 | /* DELETE or RESOLVE */ |
684 | if (arp_index == nesadapter->arp_table_size) { | 685 | if (arp_index == nesadapter->arp_table_size) { |
686 | tmp_addr = cpu_to_be32(ip_addr); | ||
685 | nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n", | 687 | nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n", |
686 | &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); | 688 | &tmp_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); |
687 | return -1; | 689 | return -1; |
688 | } | 690 | } |
689 | 691 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 19e06bc38b39..dce0443f9d69 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -711,26 +711,26 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
711 | 711 | ||
712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); | 712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); |
713 | 713 | ||
714 | if (neigh->ah) | 714 | if (unlikely((memcmp(&neigh->dgid.raw, |
715 | if (unlikely((memcmp(&neigh->dgid.raw, | 715 | skb->dst->neighbour->ha + 4, |
716 | skb->dst->neighbour->ha + 4, | 716 | sizeof(union ib_gid))) || |
717 | sizeof(union ib_gid))) || | 717 | (neigh->dev != dev))) { |
718 | (neigh->dev != dev))) { | 718 | spin_lock_irqsave(&priv->lock, flags); |
719 | spin_lock_irqsave(&priv->lock, flags); | 719 | /* |
720 | /* | 720 | * It's safe to call ipoib_put_ah() inside |
721 | * It's safe to call ipoib_put_ah() inside | 721 | * priv->lock here, because we know that |
722 | * priv->lock here, because we know that | 722 | * path->ah will always hold one more reference, |
723 | * path->ah will always hold one more reference, | 723 | * so ipoib_put_ah() will never do more than |
724 | * so ipoib_put_ah() will never do more than | 724 | * decrement the ref count. |
725 | * decrement the ref count. | 725 | */ |
726 | */ | 726 | if (neigh->ah) |
727 | ipoib_put_ah(neigh->ah); | 727 | ipoib_put_ah(neigh->ah); |
728 | list_del(&neigh->list); | 728 | list_del(&neigh->list); |
729 | ipoib_neigh_free(dev, neigh); | 729 | ipoib_neigh_free(dev, neigh); |
730 | spin_unlock_irqrestore(&priv->lock, flags); | 730 | spin_unlock_irqrestore(&priv->lock, flags); |
731 | ipoib_path_lookup(skb, dev); | 731 | ipoib_path_lookup(skb, dev); |
732 | return NETDEV_TX_OK; | 732 | return NETDEV_TX_OK; |
733 | } | 733 | } |
734 | 734 | ||
735 | if (ipoib_cm_get(neigh)) { | 735 | if (ipoib_cm_get(neigh)) { |
736 | if (ipoib_cm_up(neigh)) { | 736 | if (ipoib_cm_up(neigh)) { |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index a2eb3b9789eb..59d02e0b8df1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -529,6 +529,9 @@ void ipoib_mcast_join_task(struct work_struct *work) | |||
529 | if (!priv->broadcast) { | 529 | if (!priv->broadcast) { |
530 | struct ipoib_mcast *broadcast; | 530 | struct ipoib_mcast *broadcast; |
531 | 531 | ||
532 | if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) | ||
533 | return; | ||
534 | |||
532 | broadcast = ipoib_mcast_alloc(dev, 1); | 535 | broadcast = ipoib_mcast_alloc(dev, 1); |
533 | if (!broadcast) { | 536 | if (!broadcast) { |
534 | ipoib_warn(priv, "failed to allocate broadcast group\n"); | 537 | ipoib_warn(priv, "failed to allocate broadcast group\n"); |
diff --git a/drivers/infiniband/ulp/iser/Kconfig b/drivers/infiniband/ulp/iser/Kconfig index 77dedba829e6..b411c51842da 100644 --- a/drivers/infiniband/ulp/iser/Kconfig +++ b/drivers/infiniband/ulp/iser/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config INFINIBAND_ISER | 1 | config INFINIBAND_ISER |
2 | tristate "iSCSI Extensions for RDMA (iSER)" | 2 | tristate "iSCSI Extensions for RDMA (iSER)" |
3 | depends on SCSI && INET | 3 | depends on SCSI && INET && INFINIBAND_ADDR_TRANS |
4 | select SCSI_ISCSI_ATTRS | 4 | select SCSI_ISCSI_ATTRS |
5 | ---help--- | 5 | ---help--- |
6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol | 6 | Support for the iSCSI Extensions for RDMA (iSER) Protocol |
diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index 074b11ffbf41..e7ab0035d305 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c | |||
@@ -649,7 +649,7 @@ static inline int __init unprotect_pm_master(void) | |||
649 | return e; | 649 | return e; |
650 | } | 650 | } |
651 | 651 | ||
652 | static void __init clocks_init(void) | 652 | static void __init clocks_init(struct device *dev) |
653 | { | 653 | { |
654 | int e = 0; | 654 | int e = 0; |
655 | struct clk *osc; | 655 | struct clk *osc; |
@@ -658,9 +658,9 @@ static void __init clocks_init(void) | |||
658 | 658 | ||
659 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 659 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
660 | if (cpu_is_omap2430()) | 660 | if (cpu_is_omap2430()) |
661 | osc = clk_get(NULL, "osc_ck"); | 661 | osc = clk_get(dev, "osc_ck"); |
662 | else | 662 | else |
663 | osc = clk_get(NULL, "osc_sys_ck"); | 663 | osc = clk_get(dev, "osc_sys_ck"); |
664 | 664 | ||
665 | if (IS_ERR(osc)) { | 665 | if (IS_ERR(osc)) { |
666 | printk(KERN_WARNING "Skipping twl4030 internal clock init and " | 666 | printk(KERN_WARNING "Skipping twl4030 internal clock init and " |
@@ -776,7 +776,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
776 | inuse = true; | 776 | inuse = true; |
777 | 777 | ||
778 | /* setup clock framework */ | 778 | /* setup clock framework */ |
779 | clocks_init(); | 779 | clocks_init(&client->dev); |
780 | 780 | ||
781 | /* Maybe init the T2 Interrupt subsystem */ | 781 | /* Maybe init the T2 Interrupt subsystem */ |
782 | if (client->irq | 782 | if (client->irq |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 710c79e7a2db..6ef2490d5c3e 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -912,8 +912,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) | |||
912 | int i; | 912 | int i; |
913 | 913 | ||
914 | if (msi_x) { | 914 | if (msi_x) { |
915 | nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs, | 915 | nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, |
916 | num_possible_cpus() + 1); | 916 | num_possible_cpus() + 1); |
917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); | 917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); |
918 | if (!entries) | 918 | if (!entries) |
919 | goto no_msi; | 919 | goto no_msi; |
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index 1e93c837514f..4fa3bb2ddfe4 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c | |||
@@ -405,7 +405,6 @@ static void __init superio_serial_init(void) | |||
405 | serial_port.type = PORT_16550A; | 405 | serial_port.type = PORT_16550A; |
406 | serial_port.uartclk = 115200*16; | 406 | serial_port.uartclk = 115200*16; |
407 | serial_port.fifosize = 16; | 407 | serial_port.fifosize = 16; |
408 | spin_lock_init(&serial_port.lock); | ||
409 | 408 | ||
410 | /* serial port #1 */ | 409 | /* serial port #1 */ |
411 | serial_port.iobase = sio_dev.sp1_base; | 410 | serial_port.iobase = sio_dev.sp1_base; |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 235fb7a5a8a5..3dfecb20d5e7 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -438,7 +438,8 @@ static struct intel_iommu *device_to_iommu(u8 bus, u8 devfn) | |||
438 | continue; | 438 | continue; |
439 | 439 | ||
440 | for (i = 0; i < drhd->devices_cnt; i++) | 440 | for (i = 0; i < drhd->devices_cnt; i++) |
441 | if (drhd->devices[i]->bus->number == bus && | 441 | if (drhd->devices[i] && |
442 | drhd->devices[i]->bus->number == bus && | ||
442 | drhd->devices[i]->devfn == devfn) | 443 | drhd->devices[i]->devfn == devfn) |
443 | return drhd->iommu; | 444 | return drhd->iommu; |
444 | 445 | ||
diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c index 645d7a60e412..ec22284eed30 100644 --- a/drivers/pci/syscall.c +++ b/drivers/pci/syscall.c | |||
@@ -14,10 +14,8 @@ | |||
14 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
15 | #include "pci.h" | 15 | #include "pci.h" |
16 | 16 | ||
17 | asmlinkage long | 17 | SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, |
18 | sys_pciconfig_read(unsigned long bus, unsigned long dfn, | 18 | unsigned long, off, unsigned long, len, void __user *, buf) |
19 | unsigned long off, unsigned long len, | ||
20 | void __user *buf) | ||
21 | { | 19 | { |
22 | struct pci_dev *dev; | 20 | struct pci_dev *dev; |
23 | u8 byte; | 21 | u8 byte; |
@@ -86,10 +84,8 @@ error: | |||
86 | return err; | 84 | return err; |
87 | } | 85 | } |
88 | 86 | ||
89 | asmlinkage long | 87 | SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, |
90 | sys_pciconfig_write(unsigned long bus, unsigned long dfn, | 88 | unsigned long, off, unsigned long, len, void __user *, buf) |
91 | unsigned long off, unsigned long len, | ||
92 | void __user *buf) | ||
93 | { | 89 | { |
94 | struct pci_dev *dev; | 90 | struct pci_dev *dev; |
95 | u8 byte; | 91 | u8 byte; |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 1889a63ebc22..0d934bfbdd9b 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2839,6 +2839,8 @@ int __init early_serial_setup(struct uart_port *port) | |||
2839 | p->flags = port->flags; | 2839 | p->flags = port->flags; |
2840 | p->mapbase = port->mapbase; | 2840 | p->mapbase = port->mapbase; |
2841 | p->private_data = port->private_data; | 2841 | p->private_data = port->private_data; |
2842 | p->type = port->type; | ||
2843 | p->line = port->line; | ||
2842 | 2844 | ||
2843 | set_io_from_upio(p); | 2845 | set_io_from_upio(p); |
2844 | if (port->serial_in) | 2846 | if (port->serial_in) |
@@ -1270,7 +1270,7 @@ static void io_destroy(struct kioctx *ioctx) | |||
1270 | * pointer is passed for ctxp. Will fail with -ENOSYS if not | 1270 | * pointer is passed for ctxp. Will fail with -ENOSYS if not |
1271 | * implemented. | 1271 | * implemented. |
1272 | */ | 1272 | */ |
1273 | asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp) | 1273 | SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) |
1274 | { | 1274 | { |
1275 | struct kioctx *ioctx = NULL; | 1275 | struct kioctx *ioctx = NULL; |
1276 | unsigned long ctx; | 1276 | unsigned long ctx; |
@@ -1308,7 +1308,7 @@ out: | |||
1308 | * implemented. May fail with -EFAULT if the context pointed to | 1308 | * implemented. May fail with -EFAULT if the context pointed to |
1309 | * is invalid. | 1309 | * is invalid. |
1310 | */ | 1310 | */ |
1311 | asmlinkage long sys_io_destroy(aio_context_t ctx) | 1311 | SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) |
1312 | { | 1312 | { |
1313 | struct kioctx *ioctx = lookup_ioctx(ctx); | 1313 | struct kioctx *ioctx = lookup_ioctx(ctx); |
1314 | if (likely(NULL != ioctx)) { | 1314 | if (likely(NULL != ioctx)) { |
@@ -1662,8 +1662,8 @@ out_put_req: | |||
1662 | * are available to queue any iocbs. Will return 0 if nr is 0. Will | 1662 | * are available to queue any iocbs. Will return 0 if nr is 0. Will |
1663 | * fail with -ENOSYS if not implemented. | 1663 | * fail with -ENOSYS if not implemented. |
1664 | */ | 1664 | */ |
1665 | asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr, | 1665 | SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr, |
1666 | struct iocb __user * __user *iocbpp) | 1666 | struct iocb __user * __user *, iocbpp) |
1667 | { | 1667 | { |
1668 | struct kioctx *ctx; | 1668 | struct kioctx *ctx; |
1669 | long ret = 0; | 1669 | long ret = 0; |
@@ -1737,8 +1737,8 @@ static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, | |||
1737 | * invalid. May fail with -EAGAIN if the iocb specified was not | 1737 | * invalid. May fail with -EAGAIN if the iocb specified was not |
1738 | * cancelled. Will fail with -ENOSYS if not implemented. | 1738 | * cancelled. Will fail with -ENOSYS if not implemented. |
1739 | */ | 1739 | */ |
1740 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | 1740 | SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, |
1741 | struct io_event __user *result) | 1741 | struct io_event __user *, result) |
1742 | { | 1742 | { |
1743 | int (*cancel)(struct kiocb *iocb, struct io_event *res); | 1743 | int (*cancel)(struct kiocb *iocb, struct io_event *res); |
1744 | struct kioctx *ctx; | 1744 | struct kioctx *ctx; |
@@ -1799,11 +1799,11 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | |||
1799 | * will be updated if not NULL and the operation blocks. Will fail | 1799 | * will be updated if not NULL and the operation blocks. Will fail |
1800 | * with -ENOSYS if not implemented. | 1800 | * with -ENOSYS if not implemented. |
1801 | */ | 1801 | */ |
1802 | asmlinkage long sys_io_getevents(aio_context_t ctx_id, | 1802 | SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id, |
1803 | long min_nr, | 1803 | long, min_nr, |
1804 | long nr, | 1804 | long, nr, |
1805 | struct io_event __user *events, | 1805 | struct io_event __user *, events, |
1806 | struct timespec __user *timeout) | 1806 | struct timespec __user *, timeout) |
1807 | { | 1807 | { |
1808 | struct kioctx *ioctx = lookup_ioctx(ctx_id); | 1808 | struct kioctx *ioctx = lookup_ioctx(ctx_id); |
1809 | long ret = -EINVAL; | 1809 | long ret = -EINVAL; |
diff --git a/fs/buffer.c b/fs/buffer.c index b6e8b8632e2f..b58208f1640a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -3243,7 +3243,7 @@ void block_sync_page(struct page *page) | |||
3243 | * Use of bdflush() is deprecated and will be removed in a future kernel. | 3243 | * Use of bdflush() is deprecated and will be removed in a future kernel. |
3244 | * The `pdflush' kernel threads fully replace bdflush daemons and this call. | 3244 | * The `pdflush' kernel threads fully replace bdflush daemons and this call. |
3245 | */ | 3245 | */ |
3246 | asmlinkage long sys_bdflush(int func, long data) | 3246 | SYSCALL_DEFINE2(bdflush, int, func, long, data) |
3247 | { | 3247 | { |
3248 | static int msg_count; | 3248 | static int msg_count; |
3249 | 3249 | ||
diff --git a/fs/compat.c b/fs/compat.c index 30f2faa22f5c..65a070e705ab 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1709,7 +1709,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
1709 | } | 1709 | } |
1710 | 1710 | ||
1711 | #ifdef HAVE_SET_RESTORE_SIGMASK | 1711 | #ifdef HAVE_SET_RESTORE_SIGMASK |
1712 | asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, | 1712 | static long do_compat_pselect(int n, compat_ulong_t __user *inp, |
1713 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 1713 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
1714 | struct compat_timespec __user *tsp, compat_sigset_t __user *sigmask, | 1714 | struct compat_timespec __user *tsp, compat_sigset_t __user *sigmask, |
1715 | compat_size_t sigsetsize) | 1715 | compat_size_t sigsetsize) |
@@ -1775,8 +1775,8 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | |||
1775 | (compat_size_t __user *)(sig+sizeof(up)))) | 1775 | (compat_size_t __user *)(sig+sizeof(up)))) |
1776 | return -EFAULT; | 1776 | return -EFAULT; |
1777 | } | 1777 | } |
1778 | return compat_sys_pselect7(n, inp, outp, exp, tsp, compat_ptr(up), | 1778 | return do_compat_pselect(n, inp, outp, exp, tsp, compat_ptr(up), |
1779 | sigsetsize); | 1779 | sigsetsize); |
1780 | } | 1780 | } |
1781 | 1781 | ||
1782 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | 1782 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, |
diff --git a/fs/dcache.c b/fs/dcache.c index 4547f66884a0..937df0fb0da5 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -2092,7 +2092,7 @@ Elong: | |||
2092 | * return NULL; | 2092 | * return NULL; |
2093 | * } | 2093 | * } |
2094 | */ | 2094 | */ |
2095 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size) | 2095 | SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size) |
2096 | { | 2096 | { |
2097 | int error; | 2097 | int error; |
2098 | struct path pwd, root; | 2098 | struct path pwd, root; |
diff --git a/fs/dcookies.c b/fs/dcookies.c index 180e9fec4ad8..a21cabdbd87b 100644 --- a/fs/dcookies.c +++ b/fs/dcookies.c | |||
@@ -145,7 +145,7 @@ out: | |||
145 | /* And here is where the userspace process can look up the cookie value | 145 | /* And here is where the userspace process can look up the cookie value |
146 | * to retrieve the path. | 146 | * to retrieve the path. |
147 | */ | 147 | */ |
148 | asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user * buf, size_t len) | 148 | SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) |
149 | { | 149 | { |
150 | unsigned long cookie = (unsigned long)cookie64; | 150 | unsigned long cookie = (unsigned long)cookie64; |
151 | int err = -EINVAL; | 151 | int err = -EINVAL; |
@@ -198,7 +198,13 @@ out: | |||
198 | mutex_unlock(&dcookie_mutex); | 198 | mutex_unlock(&dcookie_mutex); |
199 | return err; | 199 | return err; |
200 | } | 200 | } |
201 | 201 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | |
202 | asmlinkage long SyS_lookup_dcookie(u64 cookie64, long buf, long len) | ||
203 | { | ||
204 | return SYSC_lookup_dcookie(cookie64, (char __user *) buf, (size_t) len); | ||
205 | } | ||
206 | SYSCALL_ALIAS(sys_lookup_dcookie, SyS_lookup_dcookie); | ||
207 | #endif | ||
202 | 208 | ||
203 | static int dcookie_init(void) | 209 | static int dcookie_init(void) |
204 | { | 210 | { |
diff --git a/fs/eventfd.c b/fs/eventfd.c index 08bf558d0408..5de2c2db3aa2 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c | |||
@@ -198,7 +198,7 @@ struct file *eventfd_fget(int fd) | |||
198 | return file; | 198 | return file; |
199 | } | 199 | } |
200 | 200 | ||
201 | asmlinkage long sys_eventfd2(unsigned int count, int flags) | 201 | SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) |
202 | { | 202 | { |
203 | int fd; | 203 | int fd; |
204 | struct eventfd_ctx *ctx; | 204 | struct eventfd_ctx *ctx; |
@@ -228,8 +228,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags) | |||
228 | return fd; | 228 | return fd; |
229 | } | 229 | } |
230 | 230 | ||
231 | asmlinkage long sys_eventfd(unsigned int count) | 231 | SYSCALL_DEFINE1(eventfd, unsigned int, count) |
232 | { | 232 | { |
233 | return sys_eventfd2(count, 0); | 233 | return sys_eventfd2(count, 0); |
234 | } | 234 | } |
235 | |||
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 96355d505347..ba2f9ec71192 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1110,7 +1110,7 @@ retry: | |||
1110 | /* | 1110 | /* |
1111 | * Open an eventpoll file descriptor. | 1111 | * Open an eventpoll file descriptor. |
1112 | */ | 1112 | */ |
1113 | asmlinkage long sys_epoll_create1(int flags) | 1113 | SYSCALL_DEFINE1(epoll_create1, int, flags) |
1114 | { | 1114 | { |
1115 | int error, fd = -1; | 1115 | int error, fd = -1; |
1116 | struct eventpoll *ep; | 1116 | struct eventpoll *ep; |
@@ -1150,7 +1150,7 @@ error_return: | |||
1150 | return fd; | 1150 | return fd; |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | asmlinkage long sys_epoll_create(int size) | 1153 | SYSCALL_DEFINE1(epoll_create, int, size) |
1154 | { | 1154 | { |
1155 | if (size < 0) | 1155 | if (size < 0) |
1156 | return -EINVAL; | 1156 | return -EINVAL; |
@@ -1163,8 +1163,8 @@ asmlinkage long sys_epoll_create(int size) | |||
1163 | * the eventpoll file that enables the insertion/removal/change of | 1163 | * the eventpoll file that enables the insertion/removal/change of |
1164 | * file descriptors inside the interest set. | 1164 | * file descriptors inside the interest set. |
1165 | */ | 1165 | */ |
1166 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, | 1166 | SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, |
1167 | struct epoll_event __user *event) | 1167 | struct epoll_event __user *, event) |
1168 | { | 1168 | { |
1169 | int error; | 1169 | int error; |
1170 | struct file *file, *tfile; | 1170 | struct file *file, *tfile; |
@@ -1261,8 +1261,8 @@ error_return: | |||
1261 | * Implement the event wait interface for the eventpoll file. It is the kernel | 1261 | * Implement the event wait interface for the eventpoll file. It is the kernel |
1262 | * part of the user space epoll_wait(2). | 1262 | * part of the user space epoll_wait(2). |
1263 | */ | 1263 | */ |
1264 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, | 1264 | SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, |
1265 | int maxevents, int timeout) | 1265 | int, maxevents, int, timeout) |
1266 | { | 1266 | { |
1267 | int error; | 1267 | int error; |
1268 | struct file *file; | 1268 | struct file *file; |
@@ -1319,9 +1319,9 @@ error_return: | |||
1319 | * Implement the event wait interface for the eventpoll file. It is the kernel | 1319 | * Implement the event wait interface for the eventpoll file. It is the kernel |
1320 | * part of the user space epoll_pwait(2). | 1320 | * part of the user space epoll_pwait(2). |
1321 | */ | 1321 | */ |
1322 | asmlinkage long sys_epoll_pwait(int epfd, struct epoll_event __user *events, | 1322 | SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events, |
1323 | int maxevents, int timeout, const sigset_t __user *sigmask, | 1323 | int, maxevents, int, timeout, const sigset_t __user *, sigmask, |
1324 | size_t sigsetsize) | 1324 | size_t, sigsetsize) |
1325 | { | 1325 | { |
1326 | int error; | 1326 | int error; |
1327 | sigset_t ksigmask, sigsaved; | 1327 | sigset_t ksigmask, sigsaved; |
@@ -99,7 +99,7 @@ static inline void put_binfmt(struct linux_binfmt * fmt) | |||
99 | * | 99 | * |
100 | * Also note that we take the address to load from from the file itself. | 100 | * Also note that we take the address to load from from the file itself. |
101 | */ | 101 | */ |
102 | asmlinkage long sys_uselib(const char __user * library) | 102 | SYSCALL_DEFINE1(uselib, const char __user *, library) |
103 | { | 103 | { |
104 | struct file *file; | 104 | struct file *file; |
105 | struct nameidata nd; | 105 | struct nameidata nd; |
diff --git a/fs/fcntl.c b/fs/fcntl.c index cdc141946724..bd215cc791da 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -50,7 +50,7 @@ static int get_close_on_exec(unsigned int fd) | |||
50 | return res; | 50 | return res; |
51 | } | 51 | } |
52 | 52 | ||
53 | asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags) | 53 | SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) |
54 | { | 54 | { |
55 | int err = -EBADF; | 55 | int err = -EBADF; |
56 | struct file * file, *tofree; | 56 | struct file * file, *tofree; |
@@ -113,7 +113,7 @@ out_unlock: | |||
113 | return err; | 113 | return err; |
114 | } | 114 | } |
115 | 115 | ||
116 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) | 116 | SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd) |
117 | { | 117 | { |
118 | if (unlikely(newfd == oldfd)) { /* corner case */ | 118 | if (unlikely(newfd == oldfd)) { /* corner case */ |
119 | struct files_struct *files = current->files; | 119 | struct files_struct *files = current->files; |
@@ -126,7 +126,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) | |||
126 | return sys_dup3(oldfd, newfd, 0); | 126 | return sys_dup3(oldfd, newfd, 0); |
127 | } | 127 | } |
128 | 128 | ||
129 | asmlinkage long sys_dup(unsigned int fildes) | 129 | SYSCALL_DEFINE1(dup, unsigned int, fildes) |
130 | { | 130 | { |
131 | int ret = -EBADF; | 131 | int ret = -EBADF; |
132 | struct file *file = fget(fildes); | 132 | struct file *file = fget(fildes); |
@@ -335,7 +335,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg, | |||
335 | return err; | 335 | return err; |
336 | } | 336 | } |
337 | 337 | ||
338 | asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) | 338 | SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) |
339 | { | 339 | { |
340 | struct file *filp; | 340 | struct file *filp; |
341 | long err = -EBADF; | 341 | long err = -EBADF; |
@@ -358,7 +358,8 @@ out: | |||
358 | } | 358 | } |
359 | 359 | ||
360 | #if BITS_PER_LONG == 32 | 360 | #if BITS_PER_LONG == 32 |
361 | asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) | 361 | SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, |
362 | unsigned long, arg) | ||
362 | { | 363 | { |
363 | struct file * filp; | 364 | struct file * filp; |
364 | long err; | 365 | long err; |
diff --git a/fs/filesystems.c b/fs/filesystems.c index d488dcd7f2bb..1aa70260e6d1 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c | |||
@@ -179,7 +179,7 @@ static int fs_maxindex(void) | |||
179 | /* | 179 | /* |
180 | * Whee.. Weird sysv syscall. | 180 | * Whee.. Weird sysv syscall. |
181 | */ | 181 | */ |
182 | asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2) | 182 | SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2) |
183 | { | 183 | { |
184 | int retval = -EINVAL; | 184 | int retval = -EINVAL; |
185 | 185 | ||
diff --git a/fs/ioctl.c b/fs/ioctl.c index 20b0a8a24c6b..240ec63984cb 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
@@ -542,7 +542,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
542 | return error; | 542 | return error; |
543 | } | 543 | } |
544 | 544 | ||
545 | asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | 545 | SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) |
546 | { | 546 | { |
547 | struct file *filp; | 547 | struct file *filp; |
548 | int error = -EBADF; | 548 | int error = -EBADF; |
diff --git a/fs/ioprio.c b/fs/ioprio.c index 1a39ac370942..c7c0b28d7d21 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c | |||
@@ -72,7 +72,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio) | |||
72 | } | 72 | } |
73 | EXPORT_SYMBOL_GPL(set_task_ioprio); | 73 | EXPORT_SYMBOL_GPL(set_task_ioprio); |
74 | 74 | ||
75 | asmlinkage long sys_ioprio_set(int which, int who, int ioprio) | 75 | SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio) |
76 | { | 76 | { |
77 | int class = IOPRIO_PRIO_CLASS(ioprio); | 77 | int class = IOPRIO_PRIO_CLASS(ioprio); |
78 | int data = IOPRIO_PRIO_DATA(ioprio); | 78 | int data = IOPRIO_PRIO_DATA(ioprio); |
@@ -188,7 +188,7 @@ int ioprio_best(unsigned short aprio, unsigned short bprio) | |||
188 | return aprio; | 188 | return aprio; |
189 | } | 189 | } |
190 | 190 | ||
191 | asmlinkage long sys_ioprio_get(int which, int who) | 191 | SYSCALL_DEFINE2(ioprio_get, int, which, int, who) |
192 | { | 192 | { |
193 | struct task_struct *g, *p; | 193 | struct task_struct *g, *p; |
194 | struct user_struct *user; | 194 | struct user_struct *user; |
@@ -252,4 +252,3 @@ asmlinkage long sys_ioprio_get(int which, int who) | |||
252 | read_unlock(&tasklist_lock); | 252 | read_unlock(&tasklist_lock); |
253 | return ret; | 253 | return ret; |
254 | } | 254 | } |
255 | |||
diff --git a/fs/locks.c b/fs/locks.c index 46a2e12f7d42..ec3deea29e37 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1564,7 +1564,7 @@ EXPORT_SYMBOL(flock_lock_file_wait); | |||
1564 | * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other | 1564 | * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other |
1565 | * processes read and write access respectively. | 1565 | * processes read and write access respectively. |
1566 | */ | 1566 | */ |
1567 | asmlinkage long sys_flock(unsigned int fd, unsigned int cmd) | 1567 | SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) |
1568 | { | 1568 | { |
1569 | struct file *filp; | 1569 | struct file *filp; |
1570 | struct file_lock *lock; | 1570 | struct file_lock *lock; |
diff --git a/fs/namei.c b/fs/namei.c index f05bed242422..bbc15c237558 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1962,8 +1962,8 @@ static int may_mknod(mode_t mode) | |||
1962 | } | 1962 | } |
1963 | } | 1963 | } |
1964 | 1964 | ||
1965 | asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode, | 1965 | SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode, |
1966 | unsigned dev) | 1966 | unsigned, dev) |
1967 | { | 1967 | { |
1968 | int error; | 1968 | int error; |
1969 | char *tmp; | 1969 | char *tmp; |
@@ -2017,7 +2017,7 @@ out_unlock: | |||
2017 | return error; | 2017 | return error; |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | asmlinkage long sys_mknod(const char __user *filename, int mode, unsigned dev) | 2020 | SYSCALL_DEFINE3(mknod, const char __user *, filename, int, mode, unsigned, dev) |
2021 | { | 2021 | { |
2022 | return sys_mknodat(AT_FDCWD, filename, mode, dev); | 2022 | return sys_mknodat(AT_FDCWD, filename, mode, dev); |
2023 | } | 2023 | } |
@@ -2044,7 +2044,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
2044 | return error; | 2044 | return error; |
2045 | } | 2045 | } |
2046 | 2046 | ||
2047 | asmlinkage long sys_mkdirat(int dfd, const char __user *pathname, int mode) | 2047 | SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode) |
2048 | { | 2048 | { |
2049 | int error = 0; | 2049 | int error = 0; |
2050 | char * tmp; | 2050 | char * tmp; |
@@ -2081,7 +2081,7 @@ out_err: | |||
2081 | return error; | 2081 | return error; |
2082 | } | 2082 | } |
2083 | 2083 | ||
2084 | asmlinkage long sys_mkdir(const char __user *pathname, int mode) | 2084 | SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode) |
2085 | { | 2085 | { |
2086 | return sys_mkdirat(AT_FDCWD, pathname, mode); | 2086 | return sys_mkdirat(AT_FDCWD, pathname, mode); |
2087 | } | 2087 | } |
@@ -2195,7 +2195,7 @@ exit1: | |||
2195 | return error; | 2195 | return error; |
2196 | } | 2196 | } |
2197 | 2197 | ||
2198 | asmlinkage long sys_rmdir(const char __user *pathname) | 2198 | SYSCALL_DEFINE1(rmdir, const char __user *, pathname) |
2199 | { | 2199 | { |
2200 | return do_rmdir(AT_FDCWD, pathname); | 2200 | return do_rmdir(AT_FDCWD, pathname); |
2201 | } | 2201 | } |
@@ -2291,7 +2291,7 @@ slashes: | |||
2291 | goto exit2; | 2291 | goto exit2; |
2292 | } | 2292 | } |
2293 | 2293 | ||
2294 | asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag) | 2294 | SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag) |
2295 | { | 2295 | { |
2296 | if ((flag & ~AT_REMOVEDIR) != 0) | 2296 | if ((flag & ~AT_REMOVEDIR) != 0) |
2297 | return -EINVAL; | 2297 | return -EINVAL; |
@@ -2302,7 +2302,7 @@ asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag) | |||
2302 | return do_unlinkat(dfd, pathname); | 2302 | return do_unlinkat(dfd, pathname); |
2303 | } | 2303 | } |
2304 | 2304 | ||
2305 | asmlinkage long sys_unlink(const char __user *pathname) | 2305 | SYSCALL_DEFINE1(unlink, const char __user *, pathname) |
2306 | { | 2306 | { |
2307 | return do_unlinkat(AT_FDCWD, pathname); | 2307 | return do_unlinkat(AT_FDCWD, pathname); |
2308 | } | 2308 | } |
@@ -2328,8 +2328,8 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname) | |||
2328 | return error; | 2328 | return error; |
2329 | } | 2329 | } |
2330 | 2330 | ||
2331 | asmlinkage long sys_symlinkat(const char __user *oldname, | 2331 | SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, |
2332 | int newdfd, const char __user *newname) | 2332 | int, newdfd, const char __user *, newname) |
2333 | { | 2333 | { |
2334 | int error; | 2334 | int error; |
2335 | char *from; | 2335 | char *from; |
@@ -2370,7 +2370,7 @@ out_putname: | |||
2370 | return error; | 2370 | return error; |
2371 | } | 2371 | } |
2372 | 2372 | ||
2373 | asmlinkage long sys_symlink(const char __user *oldname, const char __user *newname) | 2373 | SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname) |
2374 | { | 2374 | { |
2375 | return sys_symlinkat(oldname, AT_FDCWD, newname); | 2375 | return sys_symlinkat(oldname, AT_FDCWD, newname); |
2376 | } | 2376 | } |
@@ -2422,9 +2422,8 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de | |||
2422 | * with linux 2.0, and to avoid hard-linking to directories | 2422 | * with linux 2.0, and to avoid hard-linking to directories |
2423 | * and other special files. --ADM | 2423 | * and other special files. --ADM |
2424 | */ | 2424 | */ |
2425 | asmlinkage long sys_linkat(int olddfd, const char __user *oldname, | 2425 | SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, |
2426 | int newdfd, const char __user *newname, | 2426 | int, newdfd, const char __user *, newname, int, flags) |
2427 | int flags) | ||
2428 | { | 2427 | { |
2429 | struct dentry *new_dentry; | 2428 | struct dentry *new_dentry; |
2430 | struct nameidata nd; | 2429 | struct nameidata nd; |
@@ -2473,7 +2472,7 @@ out: | |||
2473 | return error; | 2472 | return error; |
2474 | } | 2473 | } |
2475 | 2474 | ||
2476 | asmlinkage long sys_link(const char __user *oldname, const char __user *newname) | 2475 | SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname) |
2477 | { | 2476 | { |
2478 | return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); | 2477 | return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); |
2479 | } | 2478 | } |
@@ -2624,8 +2623,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2624 | return error; | 2623 | return error; |
2625 | } | 2624 | } |
2626 | 2625 | ||
2627 | asmlinkage long sys_renameat(int olddfd, const char __user *oldname, | 2626 | SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, |
2628 | int newdfd, const char __user *newname) | 2627 | int, newdfd, const char __user *, newname) |
2629 | { | 2628 | { |
2630 | struct dentry *old_dir, *new_dir; | 2629 | struct dentry *old_dir, *new_dir; |
2631 | struct dentry *old_dentry, *new_dentry; | 2630 | struct dentry *old_dentry, *new_dentry; |
@@ -2718,7 +2717,7 @@ exit: | |||
2718 | return error; | 2717 | return error; |
2719 | } | 2718 | } |
2720 | 2719 | ||
2721 | asmlinkage long sys_rename(const char __user *oldname, const char __user *newname) | 2720 | SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname) |
2722 | { | 2721 | { |
2723 | return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname); | 2722 | return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname); |
2724 | } | 2723 | } |
diff --git a/fs/namespace.c b/fs/namespace.c index a40685d800a8..228d8c4bfd18 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1128,7 +1128,7 @@ static int do_umount(struct vfsmount *mnt, int flags) | |||
1128 | * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD | 1128 | * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD |
1129 | */ | 1129 | */ |
1130 | 1130 | ||
1131 | asmlinkage long sys_umount(char __user * name, int flags) | 1131 | SYSCALL_DEFINE2(umount, char __user *, name, int, flags) |
1132 | { | 1132 | { |
1133 | struct path path; | 1133 | struct path path; |
1134 | int retval; | 1134 | int retval; |
@@ -1160,7 +1160,7 @@ out: | |||
1160 | /* | 1160 | /* |
1161 | * The 2.0 compatible umount. No flags. | 1161 | * The 2.0 compatible umount. No flags. |
1162 | */ | 1162 | */ |
1163 | asmlinkage long sys_oldumount(char __user * name) | 1163 | SYSCALL_DEFINE1(oldumount, char __user *, name) |
1164 | { | 1164 | { |
1165 | return sys_umount(name, 0); | 1165 | return sys_umount(name, 0); |
1166 | } | 1166 | } |
@@ -2045,9 +2045,8 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns, | |||
2045 | return new_ns; | 2045 | return new_ns; |
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | asmlinkage long sys_mount(char __user * dev_name, char __user * dir_name, | 2048 | SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, |
2049 | char __user * type, unsigned long flags, | 2049 | char __user *, type, unsigned long, flags, void __user *, data) |
2050 | void __user * data) | ||
2051 | { | 2050 | { |
2052 | int retval; | 2051 | int retval; |
2053 | unsigned long data_page; | 2052 | unsigned long data_page; |
@@ -2172,8 +2171,8 @@ static void chroot_fs_refs(struct path *old_root, struct path *new_root) | |||
2172 | * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root | 2171 | * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root |
2173 | * first. | 2172 | * first. |
2174 | */ | 2173 | */ |
2175 | asmlinkage long sys_pivot_root(const char __user * new_root, | 2174 | SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, |
2176 | const char __user * put_old) | 2175 | const char __user *, put_old) |
2177 | { | 2176 | { |
2178 | struct vfsmount *tmp; | 2177 | struct vfsmount *tmp; |
2179 | struct path new, old, parent_path, root_parent, root; | 2178 | struct path new, old, parent_path, root_parent, root; |
diff --git a/fs/nfsctl.c b/fs/nfsctl.c index b27451909dff..8f9a20556f79 100644 --- a/fs/nfsctl.c +++ b/fs/nfsctl.c | |||
@@ -86,8 +86,8 @@ static struct { | |||
86 | }, | 86 | }, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | long | 89 | SYSCALL_DEFINE3(nfsservctl, int, cmd, struct nfsctl_arg __user *, arg, |
90 | asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res) | 90 | void __user *, res) |
91 | { | 91 | { |
92 | struct file *file; | 92 | struct file *file; |
93 | void __user *p = &arg->u; | 93 | void __user *p = &arg->u; |
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 81b8644b0136..d53a1838d6e8 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -576,7 +576,7 @@ static const struct inotify_operations inotify_user_ops = { | |||
576 | .destroy_watch = free_inotify_user_watch, | 576 | .destroy_watch = free_inotify_user_watch, |
577 | }; | 577 | }; |
578 | 578 | ||
579 | asmlinkage long sys_inotify_init1(int flags) | 579 | SYSCALL_DEFINE1(inotify_init1, int, flags) |
580 | { | 580 | { |
581 | struct inotify_device *dev; | 581 | struct inotify_device *dev; |
582 | struct inotify_handle *ih; | 582 | struct inotify_handle *ih; |
@@ -655,12 +655,13 @@ out_put_fd: | |||
655 | return ret; | 655 | return ret; |
656 | } | 656 | } |
657 | 657 | ||
658 | asmlinkage long sys_inotify_init(void) | 658 | SYSCALL_DEFINE0(inotify_init) |
659 | { | 659 | { |
660 | return sys_inotify_init1(0); | 660 | return sys_inotify_init1(0); |
661 | } | 661 | } |
662 | 662 | ||
663 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *pathname, u32 mask) | 663 | SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, |
664 | u32, mask) | ||
664 | { | 665 | { |
665 | struct inode *inode; | 666 | struct inode *inode; |
666 | struct inotify_device *dev; | 667 | struct inotify_device *dev; |
@@ -704,7 +705,7 @@ fput_and_out: | |||
704 | return ret; | 705 | return ret; |
705 | } | 706 | } |
706 | 707 | ||
707 | asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd) | 708 | SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) |
708 | { | 709 | { |
709 | struct file *filp; | 710 | struct file *filp; |
710 | struct inotify_device *dev; | 711 | struct inotify_device *dev; |
@@ -122,7 +122,7 @@ static int vfs_statfs64(struct dentry *dentry, struct statfs64 *buf) | |||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * buf) | 125 | SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf) |
126 | { | 126 | { |
127 | struct path path; | 127 | struct path path; |
128 | int error; | 128 | int error; |
@@ -138,8 +138,7 @@ asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * b | |||
138 | return error; | 138 | return error; |
139 | } | 139 | } |
140 | 140 | ||
141 | 141 | SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf) | |
142 | asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct statfs64 __user *buf) | ||
143 | { | 142 | { |
144 | struct path path; | 143 | struct path path; |
145 | long error; | 144 | long error; |
@@ -157,8 +156,7 @@ asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct stat | |||
157 | return error; | 156 | return error; |
158 | } | 157 | } |
159 | 158 | ||
160 | 159 | SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) | |
161 | asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user * buf) | ||
162 | { | 160 | { |
163 | struct file * file; | 161 | struct file * file; |
164 | struct statfs tmp; | 162 | struct statfs tmp; |
@@ -176,7 +174,7 @@ out: | |||
176 | return error; | 174 | return error; |
177 | } | 175 | } |
178 | 176 | ||
179 | asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, struct statfs64 __user *buf) | 177 | SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) |
180 | { | 178 | { |
181 | struct file * file; | 179 | struct file * file; |
182 | struct statfs64 tmp; | 180 | struct statfs64 tmp; |
@@ -289,7 +287,7 @@ out: | |||
289 | return error; | 287 | return error; |
290 | } | 288 | } |
291 | 289 | ||
292 | asmlinkage long sys_truncate(const char __user * path, unsigned long length) | 290 | SYSCALL_DEFINE2(truncate, const char __user *, path, unsigned long, length) |
293 | { | 291 | { |
294 | /* on 32-bit boxen it will cut the range 2^31--2^32-1 off */ | 292 | /* on 32-bit boxen it will cut the range 2^31--2^32-1 off */ |
295 | return do_sys_truncate(path, (long)length); | 293 | return do_sys_truncate(path, (long)length); |
@@ -341,7 +339,7 @@ out: | |||
341 | return error; | 339 | return error; |
342 | } | 340 | } |
343 | 341 | ||
344 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) | 342 | SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) |
345 | { | 343 | { |
346 | long ret = do_sys_ftruncate(fd, length, 1); | 344 | long ret = do_sys_ftruncate(fd, length, 1); |
347 | /* avoid REGPARM breakage on x86: */ | 345 | /* avoid REGPARM breakage on x86: */ |
@@ -351,21 +349,35 @@ asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) | |||
351 | 349 | ||
352 | /* LFS versions of truncate are only needed on 32 bit machines */ | 350 | /* LFS versions of truncate are only needed on 32 bit machines */ |
353 | #if BITS_PER_LONG == 32 | 351 | #if BITS_PER_LONG == 32 |
354 | asmlinkage long sys_truncate64(const char __user * path, loff_t length) | 352 | SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length) |
355 | { | 353 | { |
356 | return do_sys_truncate(path, length); | 354 | return do_sys_truncate(path, length); |
357 | } | 355 | } |
356 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
357 | asmlinkage long SyS_truncate64(long path, loff_t length) | ||
358 | { | ||
359 | return SYSC_truncate64((const char __user *) path, length); | ||
360 | } | ||
361 | SYSCALL_ALIAS(sys_truncate64, SyS_truncate64); | ||
362 | #endif | ||
358 | 363 | ||
359 | asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length) | 364 | SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length) |
360 | { | 365 | { |
361 | long ret = do_sys_ftruncate(fd, length, 0); | 366 | long ret = do_sys_ftruncate(fd, length, 0); |
362 | /* avoid REGPARM breakage on x86: */ | 367 | /* avoid REGPARM breakage on x86: */ |
363 | asmlinkage_protect(2, ret, fd, length); | 368 | asmlinkage_protect(2, ret, fd, length); |
364 | return ret; | 369 | return ret; |
365 | } | 370 | } |
371 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
372 | asmlinkage long SyS_ftruncate64(long fd, loff_t length) | ||
373 | { | ||
374 | return SYSC_ftruncate64((unsigned int) fd, length); | ||
375 | } | ||
376 | SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64); | ||
366 | #endif | 377 | #endif |
378 | #endif /* BITS_PER_LONG == 32 */ | ||
367 | 379 | ||
368 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len) | 380 | SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) |
369 | { | 381 | { |
370 | struct file *file; | 382 | struct file *file; |
371 | struct inode *inode; | 383 | struct inode *inode; |
@@ -422,13 +434,20 @@ out_fput: | |||
422 | out: | 434 | out: |
423 | return ret; | 435 | return ret; |
424 | } | 436 | } |
437 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
438 | asmlinkage long SyS_fallocate(long fd, long mode, loff_t offset, loff_t len) | ||
439 | { | ||
440 | return SYSC_fallocate((int)fd, (int)mode, offset, len); | ||
441 | } | ||
442 | SYSCALL_ALIAS(sys_fallocate, SyS_fallocate); | ||
443 | #endif | ||
425 | 444 | ||
426 | /* | 445 | /* |
427 | * access() needs to use the real uid/gid, not the effective uid/gid. | 446 | * access() needs to use the real uid/gid, not the effective uid/gid. |
428 | * We do this by temporarily clearing all FS-related capabilities and | 447 | * We do this by temporarily clearing all FS-related capabilities and |
429 | * switching the fsuid/fsgid around to the real ones. | 448 | * switching the fsuid/fsgid around to the real ones. |
430 | */ | 449 | */ |
431 | asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode) | 450 | SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) |
432 | { | 451 | { |
433 | const struct cred *old_cred; | 452 | const struct cred *old_cred; |
434 | struct cred *override_cred; | 453 | struct cred *override_cred; |
@@ -498,12 +517,12 @@ out: | |||
498 | return res; | 517 | return res; |
499 | } | 518 | } |
500 | 519 | ||
501 | asmlinkage long sys_access(const char __user *filename, int mode) | 520 | SYSCALL_DEFINE2(access, const char __user *, filename, int, mode) |
502 | { | 521 | { |
503 | return sys_faccessat(AT_FDCWD, filename, mode); | 522 | return sys_faccessat(AT_FDCWD, filename, mode); |
504 | } | 523 | } |
505 | 524 | ||
506 | asmlinkage long sys_chdir(const char __user * filename) | 525 | SYSCALL_DEFINE1(chdir, const char __user *, filename) |
507 | { | 526 | { |
508 | struct path path; | 527 | struct path path; |
509 | int error; | 528 | int error; |
@@ -524,7 +543,7 @@ out: | |||
524 | return error; | 543 | return error; |
525 | } | 544 | } |
526 | 545 | ||
527 | asmlinkage long sys_fchdir(unsigned int fd) | 546 | SYSCALL_DEFINE1(fchdir, unsigned int, fd) |
528 | { | 547 | { |
529 | struct file *file; | 548 | struct file *file; |
530 | struct inode *inode; | 549 | struct inode *inode; |
@@ -550,7 +569,7 @@ out: | |||
550 | return error; | 569 | return error; |
551 | } | 570 | } |
552 | 571 | ||
553 | asmlinkage long sys_chroot(const char __user * filename) | 572 | SYSCALL_DEFINE1(chroot, const char __user *, filename) |
554 | { | 573 | { |
555 | struct path path; | 574 | struct path path; |
556 | int error; | 575 | int error; |
@@ -575,7 +594,7 @@ out: | |||
575 | return error; | 594 | return error; |
576 | } | 595 | } |
577 | 596 | ||
578 | asmlinkage long sys_fchmod(unsigned int fd, mode_t mode) | 597 | SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode) |
579 | { | 598 | { |
580 | struct inode * inode; | 599 | struct inode * inode; |
581 | struct dentry * dentry; | 600 | struct dentry * dentry; |
@@ -609,8 +628,7 @@ out: | |||
609 | return err; | 628 | return err; |
610 | } | 629 | } |
611 | 630 | ||
612 | asmlinkage long sys_fchmodat(int dfd, const char __user *filename, | 631 | SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode) |
613 | mode_t mode) | ||
614 | { | 632 | { |
615 | struct path path; | 633 | struct path path; |
616 | struct inode *inode; | 634 | struct inode *inode; |
@@ -639,7 +657,7 @@ out: | |||
639 | return error; | 657 | return error; |
640 | } | 658 | } |
641 | 659 | ||
642 | asmlinkage long sys_chmod(const char __user *filename, mode_t mode) | 660 | SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode) |
643 | { | 661 | { |
644 | return sys_fchmodat(AT_FDCWD, filename, mode); | 662 | return sys_fchmodat(AT_FDCWD, filename, mode); |
645 | } | 663 | } |
@@ -669,7 +687,7 @@ static int chown_common(struct dentry * dentry, uid_t user, gid_t group) | |||
669 | return error; | 687 | return error; |
670 | } | 688 | } |
671 | 689 | ||
672 | asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group) | 690 | SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group) |
673 | { | 691 | { |
674 | struct path path; | 692 | struct path path; |
675 | int error; | 693 | int error; |
@@ -688,8 +706,8 @@ out: | |||
688 | return error; | 706 | return error; |
689 | } | 707 | } |
690 | 708 | ||
691 | asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, | 709 | SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user, |
692 | gid_t group, int flag) | 710 | gid_t, group, int, flag) |
693 | { | 711 | { |
694 | struct path path; | 712 | struct path path; |
695 | int error = -EINVAL; | 713 | int error = -EINVAL; |
@@ -713,7 +731,7 @@ out: | |||
713 | return error; | 731 | return error; |
714 | } | 732 | } |
715 | 733 | ||
716 | asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group) | 734 | SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group) |
717 | { | 735 | { |
718 | struct path path; | 736 | struct path path; |
719 | int error; | 737 | int error; |
@@ -732,8 +750,7 @@ out: | |||
732 | return error; | 750 | return error; |
733 | } | 751 | } |
734 | 752 | ||
735 | 753 | SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) | |
736 | asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group) | ||
737 | { | 754 | { |
738 | struct file * file; | 755 | struct file * file; |
739 | int error = -EBADF; | 756 | int error = -EBADF; |
@@ -1029,7 +1046,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode) | |||
1029 | return fd; | 1046 | return fd; |
1030 | } | 1047 | } |
1031 | 1048 | ||
1032 | asmlinkage long sys_open(const char __user *filename, int flags, int mode) | 1049 | SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) |
1033 | { | 1050 | { |
1034 | long ret; | 1051 | long ret; |
1035 | 1052 | ||
@@ -1042,8 +1059,8 @@ asmlinkage long sys_open(const char __user *filename, int flags, int mode) | |||
1042 | return ret; | 1059 | return ret; |
1043 | } | 1060 | } |
1044 | 1061 | ||
1045 | asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | 1062 | SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, |
1046 | int mode) | 1063 | int, mode) |
1047 | { | 1064 | { |
1048 | long ret; | 1065 | long ret; |
1049 | 1066 | ||
@@ -1062,7 +1079,7 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | |||
1062 | * For backward compatibility? Maybe this should be moved | 1079 | * For backward compatibility? Maybe this should be moved |
1063 | * into arch/i386 instead? | 1080 | * into arch/i386 instead? |
1064 | */ | 1081 | */ |
1065 | asmlinkage long sys_creat(const char __user * pathname, int mode) | 1082 | SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode) |
1066 | { | 1083 | { |
1067 | return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); | 1084 | return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); |
1068 | } | 1085 | } |
@@ -1098,7 +1115,7 @@ EXPORT_SYMBOL(filp_close); | |||
1098 | * releasing the fd. This ensures that one clone task can't release | 1115 | * releasing the fd. This ensures that one clone task can't release |
1099 | * an fd while another clone is opening it. | 1116 | * an fd while another clone is opening it. |
1100 | */ | 1117 | */ |
1101 | asmlinkage long sys_close(unsigned int fd) | 1118 | SYSCALL_DEFINE1(close, unsigned int, fd) |
1102 | { | 1119 | { |
1103 | struct file * filp; | 1120 | struct file * filp; |
1104 | struct files_struct *files = current->files; | 1121 | struct files_struct *files = current->files; |
@@ -1131,14 +1148,13 @@ out_unlock: | |||
1131 | spin_unlock(&files->file_lock); | 1148 | spin_unlock(&files->file_lock); |
1132 | return -EBADF; | 1149 | return -EBADF; |
1133 | } | 1150 | } |
1134 | |||
1135 | EXPORT_SYMBOL(sys_close); | 1151 | EXPORT_SYMBOL(sys_close); |
1136 | 1152 | ||
1137 | /* | 1153 | /* |
1138 | * This routine simulates a hangup on the tty, to arrange that users | 1154 | * This routine simulates a hangup on the tty, to arrange that users |
1139 | * are given clean terminals at login time. | 1155 | * are given clean terminals at login time. |
1140 | */ | 1156 | */ |
1141 | asmlinkage long sys_vhangup(void) | 1157 | SYSCALL_DEFINE0(vhangup) |
1142 | { | 1158 | { |
1143 | if (capable(CAP_SYS_TTY_CONFIG)) { | 1159 | if (capable(CAP_SYS_TTY_CONFIG)) { |
1144 | tty_vhangup_self(); | 1160 | tty_vhangup_self(); |
@@ -1043,7 +1043,7 @@ int do_pipe(int *fd) | |||
1043 | * sys_pipe() is the normal C calling standard for creating | 1043 | * sys_pipe() is the normal C calling standard for creating |
1044 | * a pipe. It's not the way Unix traditionally does this, though. | 1044 | * a pipe. It's not the way Unix traditionally does this, though. |
1045 | */ | 1045 | */ |
1046 | asmlinkage long __weak sys_pipe2(int __user *fildes, int flags) | 1046 | SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags) |
1047 | { | 1047 | { |
1048 | int fd[2]; | 1048 | int fd[2]; |
1049 | int error; | 1049 | int error; |
@@ -1059,7 +1059,7 @@ asmlinkage long __weak sys_pipe2(int __user *fildes, int flags) | |||
1059 | return error; | 1059 | return error; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | asmlinkage long __weak sys_pipe(int __user *fildes) | 1062 | SYSCALL_DEFINE1(pipe, int __user *, fildes) |
1063 | { | 1063 | { |
1064 | return sys_pipe2(fildes, 0); | 1064 | return sys_pipe2(fildes, 0); |
1065 | } | 1065 | } |
diff --git a/fs/quota.c b/fs/quota.c index 4a8c94f05f76..d76ada914f98 100644 --- a/fs/quota.c +++ b/fs/quota.c | |||
@@ -371,7 +371,8 @@ static inline struct super_block *quotactl_block(const char __user *special) | |||
371 | * calls. Maybe we need to add the process quotas etc. in the future, | 371 | * calls. Maybe we need to add the process quotas etc. in the future, |
372 | * but we probably should use rlimits for that. | 372 | * but we probably should use rlimits for that. |
373 | */ | 373 | */ |
374 | asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, void __user *addr) | 374 | SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special, |
375 | qid_t, id, void __user *, addr) | ||
375 | { | 376 | { |
376 | uint cmds, type; | 377 | uint cmds, type; |
377 | struct super_block *sb = NULL; | 378 | struct super_block *sb = NULL; |
diff --git a/fs/read_write.c b/fs/read_write.c index 5cc6924eb158..400fe81c973e 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -147,7 +147,7 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin) | |||
147 | } | 147 | } |
148 | EXPORT_SYMBOL(vfs_llseek); | 148 | EXPORT_SYMBOL(vfs_llseek); |
149 | 149 | ||
150 | asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) | 150 | SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin) |
151 | { | 151 | { |
152 | off_t retval; | 152 | off_t retval; |
153 | struct file * file; | 153 | struct file * file; |
@@ -171,9 +171,9 @@ bad: | |||
171 | } | 171 | } |
172 | 172 | ||
173 | #ifdef __ARCH_WANT_SYS_LLSEEK | 173 | #ifdef __ARCH_WANT_SYS_LLSEEK |
174 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, | 174 | SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, |
175 | unsigned long offset_low, loff_t __user * result, | 175 | unsigned long, offset_low, loff_t __user *, result, |
176 | unsigned int origin) | 176 | unsigned int, origin) |
177 | { | 177 | { |
178 | int retval; | 178 | int retval; |
179 | struct file * file; | 179 | struct file * file; |
@@ -369,7 +369,7 @@ static inline void file_pos_write(struct file *file, loff_t pos) | |||
369 | file->f_pos = pos; | 369 | file->f_pos = pos; |
370 | } | 370 | } |
371 | 371 | ||
372 | asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) | 372 | SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) |
373 | { | 373 | { |
374 | struct file *file; | 374 | struct file *file; |
375 | ssize_t ret = -EBADF; | 375 | ssize_t ret = -EBADF; |
@@ -386,7 +386,8 @@ asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) | |||
386 | return ret; | 386 | return ret; |
387 | } | 387 | } |
388 | 388 | ||
389 | asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count) | 389 | SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, |
390 | size_t, count) | ||
390 | { | 391 | { |
391 | struct file *file; | 392 | struct file *file; |
392 | ssize_t ret = -EBADF; | 393 | ssize_t ret = -EBADF; |
@@ -403,8 +404,8 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t co | |||
403 | return ret; | 404 | return ret; |
404 | } | 405 | } |
405 | 406 | ||
406 | asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | 407 | SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf, |
407 | size_t count, loff_t pos) | 408 | size_t count, loff_t pos) |
408 | { | 409 | { |
409 | struct file *file; | 410 | struct file *file; |
410 | ssize_t ret = -EBADF; | 411 | ssize_t ret = -EBADF; |
@@ -423,9 +424,17 @@ asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | |||
423 | 424 | ||
424 | return ret; | 425 | return ret; |
425 | } | 426 | } |
427 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
428 | asmlinkage long SyS_pread64(long fd, long buf, long count, loff_t pos) | ||
429 | { | ||
430 | return SYSC_pread64((unsigned int) fd, (char __user *) buf, | ||
431 | (size_t) count, pos); | ||
432 | } | ||
433 | SYSCALL_ALIAS(sys_pread64, SyS_pread64); | ||
434 | #endif | ||
426 | 435 | ||
427 | asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | 436 | SYSCALL_DEFINE(pwrite64)(unsigned int fd, const char __user *buf, |
428 | size_t count, loff_t pos) | 437 | size_t count, loff_t pos) |
429 | { | 438 | { |
430 | struct file *file; | 439 | struct file *file; |
431 | ssize_t ret = -EBADF; | 440 | ssize_t ret = -EBADF; |
@@ -444,6 +453,14 @@ asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | |||
444 | 453 | ||
445 | return ret; | 454 | return ret; |
446 | } | 455 | } |
456 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
457 | asmlinkage long SyS_pwrite64(long fd, long buf, long count, loff_t pos) | ||
458 | { | ||
459 | return SYSC_pwrite64((unsigned int) fd, (const char __user *) buf, | ||
460 | (size_t) count, pos); | ||
461 | } | ||
462 | SYSCALL_ALIAS(sys_pwrite64, SyS_pwrite64); | ||
463 | #endif | ||
447 | 464 | ||
448 | /* | 465 | /* |
449 | * Reduce an iovec's length in-place. Return the resulting number of segments | 466 | * Reduce an iovec's length in-place. Return the resulting number of segments |
@@ -672,8 +689,8 @@ ssize_t vfs_writev(struct file *file, const struct iovec __user *vec, | |||
672 | 689 | ||
673 | EXPORT_SYMBOL(vfs_writev); | 690 | EXPORT_SYMBOL(vfs_writev); |
674 | 691 | ||
675 | asmlinkage ssize_t | 692 | SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec, |
676 | sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | 693 | unsigned long, vlen) |
677 | { | 694 | { |
678 | struct file *file; | 695 | struct file *file; |
679 | ssize_t ret = -EBADF; | 696 | ssize_t ret = -EBADF; |
@@ -693,8 +710,8 @@ sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | |||
693 | return ret; | 710 | return ret; |
694 | } | 711 | } |
695 | 712 | ||
696 | asmlinkage ssize_t | 713 | SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec, |
697 | sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | 714 | unsigned long, vlen) |
698 | { | 715 | { |
699 | struct file *file; | 716 | struct file *file; |
700 | ssize_t ret = -EBADF; | 717 | ssize_t ret = -EBADF; |
@@ -812,7 +829,7 @@ out: | |||
812 | return retval; | 829 | return retval; |
813 | } | 830 | } |
814 | 831 | ||
815 | asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, size_t count) | 832 | SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) |
816 | { | 833 | { |
817 | loff_t pos; | 834 | loff_t pos; |
818 | off_t off; | 835 | off_t off; |
@@ -831,7 +848,7 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, siz | |||
831 | return do_sendfile(out_fd, in_fd, NULL, count, 0); | 848 | return do_sendfile(out_fd, in_fd, NULL, count, 0); |
832 | } | 849 | } |
833 | 850 | ||
834 | asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t __user *offset, size_t count) | 851 | SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count) |
835 | { | 852 | { |
836 | loff_t pos; | 853 | loff_t pos; |
837 | ssize_t ret; | 854 | ssize_t ret; |
diff --git a/fs/readdir.c b/fs/readdir.c index b318d9b5af2e..7723401f8d8b 100644 --- a/fs/readdir.c +++ b/fs/readdir.c | |||
@@ -102,7 +102,8 @@ efault: | |||
102 | return -EFAULT; | 102 | return -EFAULT; |
103 | } | 103 | } |
104 | 104 | ||
105 | asmlinkage long old_readdir(unsigned int fd, struct old_linux_dirent __user * dirent, unsigned int count) | 105 | SYSCALL_DEFINE3(old_readdir, unsigned int, fd, |
106 | struct old_linux_dirent __user *, dirent, unsigned int, count) | ||
106 | { | 107 | { |
107 | int error; | 108 | int error; |
108 | struct file * file; | 109 | struct file * file; |
@@ -187,7 +188,8 @@ efault: | |||
187 | return -EFAULT; | 188 | return -EFAULT; |
188 | } | 189 | } |
189 | 190 | ||
190 | asmlinkage long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count) | 191 | SYSCALL_DEFINE3(getdents, unsigned int, fd, |
192 | struct linux_dirent __user *, dirent, unsigned int, count) | ||
191 | { | 193 | { |
192 | struct file * file; | 194 | struct file * file; |
193 | struct linux_dirent __user * lastdirent; | 195 | struct linux_dirent __user * lastdirent; |
@@ -268,7 +270,8 @@ efault: | |||
268 | return -EFAULT; | 270 | return -EFAULT; |
269 | } | 271 | } |
270 | 272 | ||
271 | asmlinkage long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count) | 273 | SYSCALL_DEFINE3(getdents64, unsigned int, fd, |
274 | struct linux_dirent64 __user *, dirent, unsigned int, count) | ||
272 | { | 275 | { |
273 | struct file * file; | 276 | struct file * file; |
274 | struct linux_dirent64 __user * lastdirent; | 277 | struct linux_dirent64 __user * lastdirent; |
diff --git a/fs/select.c b/fs/select.c index 08b91beed806..0fe0e1469df3 100644 --- a/fs/select.c +++ b/fs/select.c | |||
@@ -557,8 +557,8 @@ out_nofds: | |||
557 | return ret; | 557 | return ret; |
558 | } | 558 | } |
559 | 559 | ||
560 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 560 | SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp, |
561 | fd_set __user *exp, struct timeval __user *tvp) | 561 | fd_set __user *, exp, struct timeval __user *, tvp) |
562 | { | 562 | { |
563 | struct timespec end_time, *to = NULL; | 563 | struct timespec end_time, *to = NULL; |
564 | struct timeval tv; | 564 | struct timeval tv; |
@@ -582,9 +582,9 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | |||
582 | } | 582 | } |
583 | 583 | ||
584 | #ifdef HAVE_SET_RESTORE_SIGMASK | 584 | #ifdef HAVE_SET_RESTORE_SIGMASK |
585 | asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, | 585 | static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp, |
586 | fd_set __user *exp, struct timespec __user *tsp, | 586 | fd_set __user *exp, struct timespec __user *tsp, |
587 | const sigset_t __user *sigmask, size_t sigsetsize) | 587 | const sigset_t __user *sigmask, size_t sigsetsize) |
588 | { | 588 | { |
589 | sigset_t ksigmask, sigsaved; | 589 | sigset_t ksigmask, sigsaved; |
590 | struct timespec ts, end_time, *to = NULL; | 590 | struct timespec ts, end_time, *to = NULL; |
@@ -610,7 +610,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, | |||
610 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | 610 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); |
611 | } | 611 | } |
612 | 612 | ||
613 | ret = core_sys_select(n, inp, outp, exp, &end_time); | 613 | ret = core_sys_select(n, inp, outp, exp, to); |
614 | ret = poll_select_copy_remaining(&end_time, tsp, 0, ret); | 614 | ret = poll_select_copy_remaining(&end_time, tsp, 0, ret); |
615 | 615 | ||
616 | if (ret == -ERESTARTNOHAND) { | 616 | if (ret == -ERESTARTNOHAND) { |
@@ -636,8 +636,9 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, | |||
636 | * which has a pointer to the sigset_t itself followed by a size_t containing | 636 | * which has a pointer to the sigset_t itself followed by a size_t containing |
637 | * the sigset size. | 637 | * the sigset size. |
638 | */ | 638 | */ |
639 | asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, | 639 | SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, |
640 | fd_set __user *exp, struct timespec __user *tsp, void __user *sig) | 640 | fd_set __user *, exp, struct timespec __user *, tsp, |
641 | void __user *, sig) | ||
641 | { | 642 | { |
642 | size_t sigsetsize = 0; | 643 | size_t sigsetsize = 0; |
643 | sigset_t __user *up = NULL; | 644 | sigset_t __user *up = NULL; |
@@ -650,7 +651,7 @@ asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, | |||
650 | return -EFAULT; | 651 | return -EFAULT; |
651 | } | 652 | } |
652 | 653 | ||
653 | return sys_pselect7(n, inp, outp, exp, tsp, up, sigsetsize); | 654 | return do_pselect(n, inp, outp, exp, tsp, up, sigsetsize); |
654 | } | 655 | } |
655 | #endif /* HAVE_SET_RESTORE_SIGMASK */ | 656 | #endif /* HAVE_SET_RESTORE_SIGMASK */ |
656 | 657 | ||
@@ -854,8 +855,8 @@ static long do_restart_poll(struct restart_block *restart_block) | |||
854 | return ret; | 855 | return ret; |
855 | } | 856 | } |
856 | 857 | ||
857 | asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | 858 | SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, |
858 | long timeout_msecs) | 859 | long, timeout_msecs) |
859 | { | 860 | { |
860 | struct timespec end_time, *to = NULL; | 861 | struct timespec end_time, *to = NULL; |
861 | int ret; | 862 | int ret; |
@@ -889,9 +890,9 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | |||
889 | } | 890 | } |
890 | 891 | ||
891 | #ifdef HAVE_SET_RESTORE_SIGMASK | 892 | #ifdef HAVE_SET_RESTORE_SIGMASK |
892 | asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, | 893 | SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds, |
893 | struct timespec __user *tsp, const sigset_t __user *sigmask, | 894 | struct timespec __user *, tsp, const sigset_t __user *, sigmask, |
894 | size_t sigsetsize) | 895 | size_t, sigsetsize) |
895 | { | 896 | { |
896 | sigset_t ksigmask, sigsaved; | 897 | sigset_t ksigmask, sigsaved; |
897 | struct timespec ts, end_time, *to = NULL; | 898 | struct timespec ts, end_time, *to = NULL; |
diff --git a/fs/signalfd.c b/fs/signalfd.c index 9c39bc7f8431..b07565c94386 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c | |||
@@ -205,8 +205,8 @@ static const struct file_operations signalfd_fops = { | |||
205 | .read = signalfd_read, | 205 | .read = signalfd_read, |
206 | }; | 206 | }; |
207 | 207 | ||
208 | asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, | 208 | SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, |
209 | size_t sizemask, int flags) | 209 | size_t, sizemask, int, flags) |
210 | { | 210 | { |
211 | sigset_t sigmask; | 211 | sigset_t sigmask; |
212 | struct signalfd_ctx *ctx; | 212 | struct signalfd_ctx *ctx; |
@@ -259,8 +259,8 @@ asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, | |||
259 | return ufd; | 259 | return ufd; |
260 | } | 260 | } |
261 | 261 | ||
262 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, | 262 | SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask, |
263 | size_t sizemask) | 263 | size_t, sizemask) |
264 | { | 264 | { |
265 | return sys_signalfd4(ufd, user_mask, sizemask, 0); | 265 | return sys_signalfd4(ufd, user_mask, sizemask, 0); |
266 | } | 266 | } |
diff --git a/fs/splice.c b/fs/splice.c index a54b3e3f10a7..4ed0ba44a966 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1435,8 +1435,8 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov, | |||
1435 | * Currently we punt and implement it as a normal copy, see pipe_to_user(). | 1435 | * Currently we punt and implement it as a normal copy, see pipe_to_user(). |
1436 | * | 1436 | * |
1437 | */ | 1437 | */ |
1438 | asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, | 1438 | SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, iov, |
1439 | unsigned long nr_segs, unsigned int flags) | 1439 | unsigned long, nr_segs, unsigned int, flags) |
1440 | { | 1440 | { |
1441 | struct file *file; | 1441 | struct file *file; |
1442 | long error; | 1442 | long error; |
@@ -1461,9 +1461,9 @@ asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, | |||
1461 | return error; | 1461 | return error; |
1462 | } | 1462 | } |
1463 | 1463 | ||
1464 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, | 1464 | SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in, |
1465 | int fd_out, loff_t __user *off_out, | 1465 | int, fd_out, loff_t __user *, off_out, |
1466 | size_t len, unsigned int flags) | 1466 | size_t, len, unsigned int, flags) |
1467 | { | 1467 | { |
1468 | long error; | 1468 | long error; |
1469 | struct file *in, *out; | 1469 | struct file *in, *out; |
@@ -1685,7 +1685,7 @@ static long do_tee(struct file *in, struct file *out, size_t len, | |||
1685 | return ret; | 1685 | return ret; |
1686 | } | 1686 | } |
1687 | 1687 | ||
1688 | asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags) | 1688 | SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags) |
1689 | { | 1689 | { |
1690 | struct file *in; | 1690 | struct file *in; |
1691 | int error, fput_in; | 1691 | int error, fput_in; |
@@ -152,7 +152,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta | |||
152 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 152 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user * statbuf) | 155 | SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) |
156 | { | 156 | { |
157 | struct kstat stat; | 157 | struct kstat stat; |
158 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); | 158 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); |
@@ -162,7 +162,8 @@ asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user | |||
162 | 162 | ||
163 | return error; | 163 | return error; |
164 | } | 164 | } |
165 | asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf) | 165 | |
166 | SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) | ||
166 | { | 167 | { |
167 | struct kstat stat; | 168 | struct kstat stat; |
168 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); | 169 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); |
@@ -172,7 +173,8 @@ asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __use | |||
172 | 173 | ||
173 | return error; | 174 | return error; |
174 | } | 175 | } |
175 | asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * statbuf) | 176 | |
177 | SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, statbuf) | ||
176 | { | 178 | { |
177 | struct kstat stat; | 179 | struct kstat stat; |
178 | int error = vfs_fstat(fd, &stat); | 180 | int error = vfs_fstat(fd, &stat); |
@@ -235,7 +237,7 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf) | |||
235 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 237 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
236 | } | 238 | } |
237 | 239 | ||
238 | asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf) | 240 | SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) |
239 | { | 241 | { |
240 | struct kstat stat; | 242 | struct kstat stat; |
241 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); | 243 | int error = vfs_stat_fd(AT_FDCWD, filename, &stat); |
@@ -246,7 +248,7 @@ asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf) | |||
246 | return error; | 248 | return error; |
247 | } | 249 | } |
248 | 250 | ||
249 | asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) | 251 | SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf) |
250 | { | 252 | { |
251 | struct kstat stat; | 253 | struct kstat stat; |
252 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); | 254 | int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); |
@@ -258,8 +260,8 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) | |||
258 | } | 260 | } |
259 | 261 | ||
260 | #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) | 262 | #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) |
261 | asmlinkage long sys_newfstatat(int dfd, char __user *filename, | 263 | SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, |
262 | struct stat __user *statbuf, int flag) | 264 | struct stat __user *, statbuf, int, flag) |
263 | { | 265 | { |
264 | struct kstat stat; | 266 | struct kstat stat; |
265 | int error = -EINVAL; | 267 | int error = -EINVAL; |
@@ -280,7 +282,7 @@ out: | |||
280 | } | 282 | } |
281 | #endif | 283 | #endif |
282 | 284 | ||
283 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) | 285 | SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf) |
284 | { | 286 | { |
285 | struct kstat stat; | 287 | struct kstat stat; |
286 | int error = vfs_fstat(fd, &stat); | 288 | int error = vfs_fstat(fd, &stat); |
@@ -291,8 +293,8 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) | |||
291 | return error; | 293 | return error; |
292 | } | 294 | } |
293 | 295 | ||
294 | asmlinkage long sys_readlinkat(int dfd, const char __user *pathname, | 296 | SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname, |
295 | char __user *buf, int bufsiz) | 297 | char __user *, buf, int, bufsiz) |
296 | { | 298 | { |
297 | struct path path; | 299 | struct path path; |
298 | int error; | 300 | int error; |
@@ -318,8 +320,8 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *pathname, | |||
318 | return error; | 320 | return error; |
319 | } | 321 | } |
320 | 322 | ||
321 | asmlinkage long sys_readlink(const char __user *path, char __user *buf, | 323 | SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf, |
322 | int bufsiz) | 324 | int, bufsiz) |
323 | { | 325 | { |
324 | return sys_readlinkat(AT_FDCWD, path, buf, bufsiz); | 326 | return sys_readlinkat(AT_FDCWD, path, buf, bufsiz); |
325 | } | 327 | } |
@@ -365,7 +367,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf) | |||
365 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 367 | return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
366 | } | 368 | } |
367 | 369 | ||
368 | asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf) | 370 | SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf) |
369 | { | 371 | { |
370 | struct kstat stat; | 372 | struct kstat stat; |
371 | int error = vfs_stat(filename, &stat); | 373 | int error = vfs_stat(filename, &stat); |
@@ -375,7 +377,8 @@ asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbu | |||
375 | 377 | ||
376 | return error; | 378 | return error; |
377 | } | 379 | } |
378 | asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf) | 380 | |
381 | SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf) | ||
379 | { | 382 | { |
380 | struct kstat stat; | 383 | struct kstat stat; |
381 | int error = vfs_lstat(filename, &stat); | 384 | int error = vfs_lstat(filename, &stat); |
@@ -385,7 +388,8 @@ asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statb | |||
385 | 388 | ||
386 | return error; | 389 | return error; |
387 | } | 390 | } |
388 | asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) | 391 | |
392 | SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf) | ||
389 | { | 393 | { |
390 | struct kstat stat; | 394 | struct kstat stat; |
391 | int error = vfs_fstat(fd, &stat); | 395 | int error = vfs_fstat(fd, &stat); |
@@ -396,8 +400,8 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) | |||
396 | return error; | 400 | return error; |
397 | } | 401 | } |
398 | 402 | ||
399 | asmlinkage long sys_fstatat64(int dfd, char __user *filename, | 403 | SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, |
400 | struct stat64 __user *statbuf, int flag) | 404 | struct stat64 __user *, statbuf, int, flag) |
401 | { | 405 | { |
402 | struct kstat stat; | 406 | struct kstat stat; |
403 | int error = -EINVAL; | 407 | int error = -EINVAL; |
diff --git a/fs/super.c b/fs/super.c index ed080c417167..645e5403f2a0 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -544,7 +544,7 @@ rescan: | |||
544 | return NULL; | 544 | return NULL; |
545 | } | 545 | } |
546 | 546 | ||
547 | asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf) | 547 | SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) |
548 | { | 548 | { |
549 | struct super_block *s; | 549 | struct super_block *s; |
550 | struct ustat tmp; | 550 | struct ustat tmp; |
@@ -36,7 +36,7 @@ static void do_sync(unsigned long wait) | |||
36 | laptop_sync_completion(); | 36 | laptop_sync_completion(); |
37 | } | 37 | } |
38 | 38 | ||
39 | asmlinkage long sys_sync(void) | 39 | SYSCALL_DEFINE0(sync) |
40 | { | 40 | { |
41 | do_sync(1); | 41 | do_sync(1); |
42 | return 0; | 42 | return 0; |
@@ -144,12 +144,12 @@ static int do_fsync(unsigned int fd, int datasync) | |||
144 | return ret; | 144 | return ret; |
145 | } | 145 | } |
146 | 146 | ||
147 | asmlinkage long sys_fsync(unsigned int fd) | 147 | SYSCALL_DEFINE1(fsync, unsigned int, fd) |
148 | { | 148 | { |
149 | return do_fsync(fd, 0); | 149 | return do_fsync(fd, 0); |
150 | } | 150 | } |
151 | 151 | ||
152 | asmlinkage long sys_fdatasync(unsigned int fd) | 152 | SYSCALL_DEFINE1(fdatasync, unsigned int, fd) |
153 | { | 153 | { |
154 | return do_fsync(fd, 1); | 154 | return do_fsync(fd, 1); |
155 | } | 155 | } |
@@ -201,8 +201,8 @@ asmlinkage long sys_fdatasync(unsigned int fd) | |||
201 | * already-instantiated disk blocks, there are no guarantees here that the data | 201 | * already-instantiated disk blocks, there are no guarantees here that the data |
202 | * will be available after a crash. | 202 | * will be available after a crash. |
203 | */ | 203 | */ |
204 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | 204 | SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, |
205 | unsigned int flags) | 205 | unsigned int flags) |
206 | { | 206 | { |
207 | int ret; | 207 | int ret; |
208 | struct file *file; | 208 | struct file *file; |
@@ -262,14 +262,32 @@ out_put: | |||
262 | out: | 262 | out: |
263 | return ret; | 263 | return ret; |
264 | } | 264 | } |
265 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
266 | asmlinkage long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes, | ||
267 | long flags) | ||
268 | { | ||
269 | return SYSC_sync_file_range((int) fd, offset, nbytes, | ||
270 | (unsigned int) flags); | ||
271 | } | ||
272 | SYSCALL_ALIAS(sys_sync_file_range, SyS_sync_file_range); | ||
273 | #endif | ||
265 | 274 | ||
266 | /* It would be nice if people remember that not all the world's an i386 | 275 | /* It would be nice if people remember that not all the world's an i386 |
267 | when they introduce new system calls */ | 276 | when they introduce new system calls */ |
268 | asmlinkage long sys_sync_file_range2(int fd, unsigned int flags, | 277 | SYSCALL_DEFINE(sync_file_range2)(int fd, unsigned int flags, |
269 | loff_t offset, loff_t nbytes) | 278 | loff_t offset, loff_t nbytes) |
270 | { | 279 | { |
271 | return sys_sync_file_range(fd, offset, nbytes, flags); | 280 | return sys_sync_file_range(fd, offset, nbytes, flags); |
272 | } | 281 | } |
282 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
283 | asmlinkage long SyS_sync_file_range2(long fd, long flags, | ||
284 | loff_t offset, loff_t nbytes) | ||
285 | { | ||
286 | return SYSC_sync_file_range2((int) fd, (unsigned int) flags, | ||
287 | offset, nbytes); | ||
288 | } | ||
289 | SYSCALL_ALIAS(sys_sync_file_range2, SyS_sync_file_range2); | ||
290 | #endif | ||
273 | 291 | ||
274 | /* | 292 | /* |
275 | * `endbyte' is inclusive | 293 | * `endbyte' is inclusive |
diff --git a/fs/timerfd.c b/fs/timerfd.c index 0862f0e49d0c..6a123b8ff3f5 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c | |||
@@ -177,7 +177,7 @@ static struct file *timerfd_fget(int fd) | |||
177 | return file; | 177 | return file; |
178 | } | 178 | } |
179 | 179 | ||
180 | asmlinkage long sys_timerfd_create(int clockid, int flags) | 180 | SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) |
181 | { | 181 | { |
182 | int ufd; | 182 | int ufd; |
183 | struct timerfd_ctx *ctx; | 183 | struct timerfd_ctx *ctx; |
@@ -208,9 +208,9 @@ asmlinkage long sys_timerfd_create(int clockid, int flags) | |||
208 | return ufd; | 208 | return ufd; |
209 | } | 209 | } |
210 | 210 | ||
211 | asmlinkage long sys_timerfd_settime(int ufd, int flags, | 211 | SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags, |
212 | const struct itimerspec __user *utmr, | 212 | const struct itimerspec __user *, utmr, |
213 | struct itimerspec __user *otmr) | 213 | struct itimerspec __user *, otmr) |
214 | { | 214 | { |
215 | struct file *file; | 215 | struct file *file; |
216 | struct timerfd_ctx *ctx; | 216 | struct timerfd_ctx *ctx; |
@@ -265,7 +265,7 @@ asmlinkage long sys_timerfd_settime(int ufd, int flags, | |||
265 | return 0; | 265 | return 0; |
266 | } | 266 | } |
267 | 267 | ||
268 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr) | 268 | SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct itimerspec __user *, otmr) |
269 | { | 269 | { |
270 | struct file *file; | 270 | struct file *file; |
271 | struct timerfd_ctx *ctx; | 271 | struct timerfd_ctx *ctx; |
diff --git a/fs/utimes.c b/fs/utimes.c index 6929e3e91d05..e4c75db5d373 100644 --- a/fs/utimes.c +++ b/fs/utimes.c | |||
@@ -24,7 +24,7 @@ | |||
24 | * must be owner or have write permission. | 24 | * must be owner or have write permission. |
25 | * Else, update from *times, must be owner or super user. | 25 | * Else, update from *times, must be owner or super user. |
26 | */ | 26 | */ |
27 | asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times) | 27 | SYSCALL_DEFINE2(utime, char __user *, filename, struct utimbuf __user *, times) |
28 | { | 28 | { |
29 | struct timespec tv[2]; | 29 | struct timespec tv[2]; |
30 | 30 | ||
@@ -170,7 +170,8 @@ out: | |||
170 | return error; | 170 | return error; |
171 | } | 171 | } |
172 | 172 | ||
173 | asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __user *utimes, int flags) | 173 | SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, |
174 | struct timespec __user *, utimes, int, flags) | ||
174 | { | 175 | { |
175 | struct timespec tstimes[2]; | 176 | struct timespec tstimes[2]; |
176 | 177 | ||
@@ -187,7 +188,8 @@ asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __ | |||
187 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); | 188 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); |
188 | } | 189 | } |
189 | 190 | ||
190 | asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __user *utimes) | 191 | SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, |
192 | struct timeval __user *, utimes) | ||
191 | { | 193 | { |
192 | struct timeval times[2]; | 194 | struct timeval times[2]; |
193 | struct timespec tstimes[2]; | 195 | struct timespec tstimes[2]; |
@@ -214,7 +216,8 @@ asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __u | |||
214 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); | 216 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); |
215 | } | 217 | } |
216 | 218 | ||
217 | asmlinkage long sys_utimes(char __user *filename, struct timeval __user *utimes) | 219 | SYSCALL_DEFINE2(utimes, char __user *, filename, |
220 | struct timeval __user *, utimes) | ||
218 | { | 221 | { |
219 | return sys_futimesat(AT_FDCWD, filename, utimes); | 222 | return sys_futimesat(AT_FDCWD, filename, utimes); |
220 | } | 223 | } |
diff --git a/fs/xattr.c b/fs/xattr.c index 237804cd6b56..197c4fcac032 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -251,9 +251,9 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value, | |||
251 | return error; | 251 | return error; |
252 | } | 252 | } |
253 | 253 | ||
254 | asmlinkage long | 254 | SYSCALL_DEFINE5(setxattr, const char __user *, pathname, |
255 | sys_setxattr(const char __user *pathname, const char __user *name, | 255 | const char __user *, name, const void __user *, value, |
256 | const void __user *value, size_t size, int flags) | 256 | size_t, size, int, flags) |
257 | { | 257 | { |
258 | struct path path; | 258 | struct path path; |
259 | int error; | 259 | int error; |
@@ -270,9 +270,9 @@ sys_setxattr(const char __user *pathname, const char __user *name, | |||
270 | return error; | 270 | return error; |
271 | } | 271 | } |
272 | 272 | ||
273 | asmlinkage long | 273 | SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname, |
274 | sys_lsetxattr(const char __user *pathname, const char __user *name, | 274 | const char __user *, name, const void __user *, value, |
275 | const void __user *value, size_t size, int flags) | 275 | size_t, size, int, flags) |
276 | { | 276 | { |
277 | struct path path; | 277 | struct path path; |
278 | int error; | 278 | int error; |
@@ -289,9 +289,8 @@ sys_lsetxattr(const char __user *pathname, const char __user *name, | |||
289 | return error; | 289 | return error; |
290 | } | 290 | } |
291 | 291 | ||
292 | asmlinkage long | 292 | SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, |
293 | sys_fsetxattr(int fd, const char __user *name, const void __user *value, | 293 | const void __user *,value, size_t, size, int, flags) |
294 | size_t size, int flags) | ||
295 | { | 294 | { |
296 | struct file *f; | 295 | struct file *f; |
297 | struct dentry *dentry; | 296 | struct dentry *dentry; |
@@ -349,9 +348,8 @@ getxattr(struct dentry *d, const char __user *name, void __user *value, | |||
349 | return error; | 348 | return error; |
350 | } | 349 | } |
351 | 350 | ||
352 | asmlinkage ssize_t | 351 | SYSCALL_DEFINE4(getxattr, const char __user *, pathname, |
353 | sys_getxattr(const char __user *pathname, const char __user *name, | 352 | const char __user *, name, void __user *, value, size_t, size) |
354 | void __user *value, size_t size) | ||
355 | { | 353 | { |
356 | struct path path; | 354 | struct path path; |
357 | ssize_t error; | 355 | ssize_t error; |
@@ -364,9 +362,8 @@ sys_getxattr(const char __user *pathname, const char __user *name, | |||
364 | return error; | 362 | return error; |
365 | } | 363 | } |
366 | 364 | ||
367 | asmlinkage ssize_t | 365 | SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname, |
368 | sys_lgetxattr(const char __user *pathname, const char __user *name, void __user *value, | 366 | const char __user *, name, void __user *, value, size_t, size) |
369 | size_t size) | ||
370 | { | 367 | { |
371 | struct path path; | 368 | struct path path; |
372 | ssize_t error; | 369 | ssize_t error; |
@@ -379,8 +376,8 @@ sys_lgetxattr(const char __user *pathname, const char __user *name, void __user | |||
379 | return error; | 376 | return error; |
380 | } | 377 | } |
381 | 378 | ||
382 | asmlinkage ssize_t | 379 | SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name, |
383 | sys_fgetxattr(int fd, const char __user *name, void __user *value, size_t size) | 380 | void __user *, value, size_t, size) |
384 | { | 381 | { |
385 | struct file *f; | 382 | struct file *f; |
386 | ssize_t error = -EBADF; | 383 | ssize_t error = -EBADF; |
@@ -424,8 +421,8 @@ listxattr(struct dentry *d, char __user *list, size_t size) | |||
424 | return error; | 421 | return error; |
425 | } | 422 | } |
426 | 423 | ||
427 | asmlinkage ssize_t | 424 | SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list, |
428 | sys_listxattr(const char __user *pathname, char __user *list, size_t size) | 425 | size_t, size) |
429 | { | 426 | { |
430 | struct path path; | 427 | struct path path; |
431 | ssize_t error; | 428 | ssize_t error; |
@@ -438,8 +435,8 @@ sys_listxattr(const char __user *pathname, char __user *list, size_t size) | |||
438 | return error; | 435 | return error; |
439 | } | 436 | } |
440 | 437 | ||
441 | asmlinkage ssize_t | 438 | SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list, |
442 | sys_llistxattr(const char __user *pathname, char __user *list, size_t size) | 439 | size_t, size) |
443 | { | 440 | { |
444 | struct path path; | 441 | struct path path; |
445 | ssize_t error; | 442 | ssize_t error; |
@@ -452,8 +449,7 @@ sys_llistxattr(const char __user *pathname, char __user *list, size_t size) | |||
452 | return error; | 449 | return error; |
453 | } | 450 | } |
454 | 451 | ||
455 | asmlinkage ssize_t | 452 | SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size) |
456 | sys_flistxattr(int fd, char __user *list, size_t size) | ||
457 | { | 453 | { |
458 | struct file *f; | 454 | struct file *f; |
459 | ssize_t error = -EBADF; | 455 | ssize_t error = -EBADF; |
@@ -485,8 +481,8 @@ removexattr(struct dentry *d, const char __user *name) | |||
485 | return vfs_removexattr(d, kname); | 481 | return vfs_removexattr(d, kname); |
486 | } | 482 | } |
487 | 483 | ||
488 | asmlinkage long | 484 | SYSCALL_DEFINE2(removexattr, const char __user *, pathname, |
489 | sys_removexattr(const char __user *pathname, const char __user *name) | 485 | const char __user *, name) |
490 | { | 486 | { |
491 | struct path path; | 487 | struct path path; |
492 | int error; | 488 | int error; |
@@ -503,8 +499,8 @@ sys_removexattr(const char __user *pathname, const char __user *name) | |||
503 | return error; | 499 | return error; |
504 | } | 500 | } |
505 | 501 | ||
506 | asmlinkage long | 502 | SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname, |
507 | sys_lremovexattr(const char __user *pathname, const char __user *name) | 503 | const char __user *, name) |
508 | { | 504 | { |
509 | struct path path; | 505 | struct path path; |
510 | int error; | 506 | int error; |
@@ -521,8 +517,7 @@ sys_lremovexattr(const char __user *pathname, const char __user *name) | |||
521 | return error; | 517 | return error; |
522 | } | 518 | } |
523 | 519 | ||
524 | asmlinkage long | 520 | SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) |
525 | sys_fremovexattr(int fd, const char __user *name) | ||
526 | { | 521 | { |
527 | struct file *f; | 522 | struct file *f; |
528 | struct dentry *dentry; | 523 | struct dentry *dentry; |
diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/linux-2.6/xfs_aops.h index 7b26f5ff9692..1dd528849755 100644 --- a/fs/xfs/linux-2.6/xfs_aops.h +++ b/fs/xfs/linux-2.6/xfs_aops.h | |||
@@ -21,8 +21,6 @@ | |||
21 | extern struct workqueue_struct *xfsdatad_workqueue; | 21 | extern struct workqueue_struct *xfsdatad_workqueue; |
22 | extern mempool_t *xfs_ioend_pool; | 22 | extern mempool_t *xfs_ioend_pool; |
23 | 23 | ||
24 | typedef void (*xfs_ioend_func_t)(void *); | ||
25 | |||
26 | /* | 24 | /* |
27 | * xfs_ioend struct manages large extent writes for XFS. | 25 | * xfs_ioend struct manages large extent writes for XFS. |
28 | * It can manage several multi-page bio's at once. | 26 | * It can manage several multi-page bio's at once. |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index cb329edc925b..d71dc44e21ed 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -166,75 +166,6 @@ test_page_region( | |||
166 | } | 166 | } |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * Mapping of multi-page buffers into contiguous virtual space | ||
170 | */ | ||
171 | |||
172 | typedef struct a_list { | ||
173 | void *vm_addr; | ||
174 | struct a_list *next; | ||
175 | } a_list_t; | ||
176 | |||
177 | static a_list_t *as_free_head; | ||
178 | static int as_list_len; | ||
179 | static DEFINE_SPINLOCK(as_lock); | ||
180 | |||
181 | /* | ||
182 | * Try to batch vunmaps because they are costly. | ||
183 | */ | ||
184 | STATIC void | ||
185 | free_address( | ||
186 | void *addr) | ||
187 | { | ||
188 | a_list_t *aentry; | ||
189 | |||
190 | #ifdef CONFIG_XEN | ||
191 | /* | ||
192 | * Xen needs to be able to make sure it can get an exclusive | ||
193 | * RO mapping of pages it wants to turn into a pagetable. If | ||
194 | * a newly allocated page is also still being vmap()ed by xfs, | ||
195 | * it will cause pagetable construction to fail. This is a | ||
196 | * quick workaround to always eagerly unmap pages so that Xen | ||
197 | * is happy. | ||
198 | */ | ||
199 | vunmap(addr); | ||
200 | return; | ||
201 | #endif | ||
202 | |||
203 | aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT); | ||
204 | if (likely(aentry)) { | ||
205 | spin_lock(&as_lock); | ||
206 | aentry->next = as_free_head; | ||
207 | aentry->vm_addr = addr; | ||
208 | as_free_head = aentry; | ||
209 | as_list_len++; | ||
210 | spin_unlock(&as_lock); | ||
211 | } else { | ||
212 | vunmap(addr); | ||
213 | } | ||
214 | } | ||
215 | |||
216 | STATIC void | ||
217 | purge_addresses(void) | ||
218 | { | ||
219 | a_list_t *aentry, *old; | ||
220 | |||
221 | if (as_free_head == NULL) | ||
222 | return; | ||
223 | |||
224 | spin_lock(&as_lock); | ||
225 | aentry = as_free_head; | ||
226 | as_free_head = NULL; | ||
227 | as_list_len = 0; | ||
228 | spin_unlock(&as_lock); | ||
229 | |||
230 | while ((old = aentry) != NULL) { | ||
231 | vunmap(aentry->vm_addr); | ||
232 | aentry = aentry->next; | ||
233 | kfree(old); | ||
234 | } | ||
235 | } | ||
236 | |||
237 | /* | ||
238 | * Internal xfs_buf_t object manipulation | 169 | * Internal xfs_buf_t object manipulation |
239 | */ | 170 | */ |
240 | 171 | ||
@@ -333,7 +264,7 @@ xfs_buf_free( | |||
333 | uint i; | 264 | uint i; |
334 | 265 | ||
335 | if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) | 266 | if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) |
336 | free_address(bp->b_addr - bp->b_offset); | 267 | vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count); |
337 | 268 | ||
338 | for (i = 0; i < bp->b_page_count; i++) { | 269 | for (i = 0; i < bp->b_page_count; i++) { |
339 | struct page *page = bp->b_pages[i]; | 270 | struct page *page = bp->b_pages[i]; |
@@ -455,10 +386,8 @@ _xfs_buf_map_pages( | |||
455 | bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; | 386 | bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; |
456 | bp->b_flags |= XBF_MAPPED; | 387 | bp->b_flags |= XBF_MAPPED; |
457 | } else if (flags & XBF_MAPPED) { | 388 | } else if (flags & XBF_MAPPED) { |
458 | if (as_list_len > 64) | 389 | bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count, |
459 | purge_addresses(); | 390 | -1, PAGE_KERNEL); |
460 | bp->b_addr = vmap(bp->b_pages, bp->b_page_count, | ||
461 | VM_MAP, PAGE_KERNEL); | ||
462 | if (unlikely(bp->b_addr == NULL)) | 391 | if (unlikely(bp->b_addr == NULL)) |
463 | return -ENOMEM; | 392 | return -ENOMEM; |
464 | bp->b_addr += bp->b_offset; | 393 | bp->b_addr += bp->b_offset; |
@@ -1743,8 +1672,6 @@ xfsbufd( | |||
1743 | count++; | 1672 | count++; |
1744 | } | 1673 | } |
1745 | 1674 | ||
1746 | if (as_list_len > 0) | ||
1747 | purge_addresses(); | ||
1748 | if (count) | 1675 | if (count) |
1749 | blk_run_address_space(target->bt_mapping); | 1676 | blk_run_address_space(target->bt_mapping); |
1750 | 1677 | ||
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 595751f78350..87b8cbd23d4b 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c | |||
@@ -126,11 +126,26 @@ xfs_nfs_get_inode( | |||
126 | if (ino == 0) | 126 | if (ino == 0) |
127 | return ERR_PTR(-ESTALE); | 127 | return ERR_PTR(-ESTALE); |
128 | 128 | ||
129 | error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0); | 129 | /* |
130 | if (error) | 130 | * The XFS_IGET_BULKSTAT means that an invalid inode number is just |
131 | * fine and not an indication of a corrupted filesystem. Because | ||
132 | * clients can send any kind of invalid file handle, e.g. after | ||
133 | * a restore on the server we have to deal with this case gracefully. | ||
134 | */ | ||
135 | error = xfs_iget(mp, NULL, ino, XFS_IGET_BULKSTAT, | ||
136 | XFS_ILOCK_SHARED, &ip, 0); | ||
137 | if (error) { | ||
138 | /* | ||
139 | * EINVAL means the inode cluster doesn't exist anymore. | ||
140 | * This implies the filehandle is stale, so we should | ||
141 | * translate it here. | ||
142 | * We don't use ESTALE directly down the chain to not | ||
143 | * confuse applications using bulkstat that expect EINVAL. | ||
144 | */ | ||
145 | if (error == EINVAL) | ||
146 | error = ESTALE; | ||
131 | return ERR_PTR(-error); | 147 | return ERR_PTR(-error); |
132 | if (!ip) | 148 | } |
133 | return ERR_PTR(-EIO); | ||
134 | 149 | ||
135 | if (ip->i_d.di_gen != generation) { | 150 | if (ip->i_d.di_gen != generation) { |
136 | xfs_iput_new(ip, XFS_ILOCK_SHARED); | 151 | xfs_iput_new(ip, XFS_ILOCK_SHARED); |
diff --git a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h index a4e293b93efa..642f1db4def4 100644 --- a/fs/xfs/xfs_acl.h +++ b/fs/xfs/xfs_acl.h | |||
@@ -22,7 +22,6 @@ | |||
22 | * Access Control Lists | 22 | * Access Control Lists |
23 | */ | 23 | */ |
24 | typedef __uint16_t xfs_acl_perm_t; | 24 | typedef __uint16_t xfs_acl_perm_t; |
25 | typedef __int32_t xfs_acl_type_t; | ||
26 | typedef __int32_t xfs_acl_tag_t; | 25 | typedef __int32_t xfs_acl_tag_t; |
27 | typedef __int32_t xfs_acl_id_t; | 26 | typedef __int32_t xfs_acl_id_t; |
28 | 27 | ||
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h index f2e21817a226..d3b3cf742999 100644 --- a/fs/xfs/xfs_ag.h +++ b/fs/xfs/xfs_ag.h | |||
@@ -231,7 +231,7 @@ typedef struct xfs_perag | |||
231 | #define XFS_FSB_TO_AGNO(mp,fsbno) \ | 231 | #define XFS_FSB_TO_AGNO(mp,fsbno) \ |
232 | ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog)) | 232 | ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog)) |
233 | #define XFS_FSB_TO_AGBNO(mp,fsbno) \ | 233 | #define XFS_FSB_TO_AGBNO(mp,fsbno) \ |
234 | ((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog))) | 234 | ((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog))) |
235 | #define XFS_AGB_TO_DADDR(mp,agno,agbno) \ | 235 | #define XFS_AGB_TO_DADDR(mp,agno,agbno) \ |
236 | ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ | 236 | ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ |
237 | (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))) | 237 | (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))) |
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 79da6b2ea99e..6c323f8a4cd1 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -736,7 +736,7 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp) | |||
736 | continue; /* don't copy partial entries */ | 736 | continue; /* don't copy partial entries */ |
737 | if (!(entry->flags & XFS_ATTR_LOCAL)) | 737 | if (!(entry->flags & XFS_ATTR_LOCAL)) |
738 | return(0); | 738 | return(0); |
739 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); | 739 | name_loc = xfs_attr_leaf_name_local(leaf, i); |
740 | if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX) | 740 | if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX) |
741 | return(0); | 741 | return(0); |
742 | if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX) | 742 | if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX) |
@@ -823,7 +823,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) | |||
823 | if (!entry->nameidx) | 823 | if (!entry->nameidx) |
824 | continue; | 824 | continue; |
825 | ASSERT(entry->flags & XFS_ATTR_LOCAL); | 825 | ASSERT(entry->flags & XFS_ATTR_LOCAL); |
826 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); | 826 | name_loc = xfs_attr_leaf_name_local(leaf, i); |
827 | nargs.name = (char *)name_loc->nameval; | 827 | nargs.name = (char *)name_loc->nameval; |
828 | nargs.namelen = name_loc->namelen; | 828 | nargs.namelen = name_loc->namelen; |
829 | nargs.value = (char *)&name_loc->nameval[nargs.namelen]; | 829 | nargs.value = (char *)&name_loc->nameval[nargs.namelen]; |
@@ -1141,14 +1141,14 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex) | |||
1141 | * as part of this transaction (a split operation for example). | 1141 | * as part of this transaction (a split operation for example). |
1142 | */ | 1142 | */ |
1143 | if (entry->flags & XFS_ATTR_LOCAL) { | 1143 | if (entry->flags & XFS_ATTR_LOCAL) { |
1144 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); | 1144 | name_loc = xfs_attr_leaf_name_local(leaf, args->index); |
1145 | name_loc->namelen = args->namelen; | 1145 | name_loc->namelen = args->namelen; |
1146 | name_loc->valuelen = cpu_to_be16(args->valuelen); | 1146 | name_loc->valuelen = cpu_to_be16(args->valuelen); |
1147 | memcpy((char *)name_loc->nameval, args->name, args->namelen); | 1147 | memcpy((char *)name_loc->nameval, args->name, args->namelen); |
1148 | memcpy((char *)&name_loc->nameval[args->namelen], args->value, | 1148 | memcpy((char *)&name_loc->nameval[args->namelen], args->value, |
1149 | be16_to_cpu(name_loc->valuelen)); | 1149 | be16_to_cpu(name_loc->valuelen)); |
1150 | } else { | 1150 | } else { |
1151 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 1151 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
1152 | name_rmt->namelen = args->namelen; | 1152 | name_rmt->namelen = args->namelen; |
1153 | memcpy((char *)name_rmt->name, args->name, args->namelen); | 1153 | memcpy((char *)name_rmt->name, args->name, args->namelen); |
1154 | entry->flags |= XFS_ATTR_INCOMPLETE; | 1154 | entry->flags |= XFS_ATTR_INCOMPLETE; |
@@ -1159,7 +1159,7 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex) | |||
1159 | args->rmtblkcnt = XFS_B_TO_FSB(mp, args->valuelen); | 1159 | args->rmtblkcnt = XFS_B_TO_FSB(mp, args->valuelen); |
1160 | } | 1160 | } |
1161 | xfs_da_log_buf(args->trans, bp, | 1161 | xfs_da_log_buf(args->trans, bp, |
1162 | XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index), | 1162 | XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index), |
1163 | xfs_attr_leaf_entsize(leaf, args->index))); | 1163 | xfs_attr_leaf_entsize(leaf, args->index))); |
1164 | 1164 | ||
1165 | /* | 1165 | /* |
@@ -1749,10 +1749,10 @@ xfs_attr_leaf_remove(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
1749 | /* | 1749 | /* |
1750 | * Compress the remaining entries and zero out the removed stuff. | 1750 | * Compress the remaining entries and zero out the removed stuff. |
1751 | */ | 1751 | */ |
1752 | memset(XFS_ATTR_LEAF_NAME(leaf, args->index), 0, entsize); | 1752 | memset(xfs_attr_leaf_name(leaf, args->index), 0, entsize); |
1753 | be16_add_cpu(&hdr->usedbytes, -entsize); | 1753 | be16_add_cpu(&hdr->usedbytes, -entsize); |
1754 | xfs_da_log_buf(args->trans, bp, | 1754 | xfs_da_log_buf(args->trans, bp, |
1755 | XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index), | 1755 | XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index), |
1756 | entsize)); | 1756 | entsize)); |
1757 | 1757 | ||
1758 | tmp = (be16_to_cpu(hdr->count) - args->index) | 1758 | tmp = (be16_to_cpu(hdr->count) - args->index) |
@@ -1985,7 +1985,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
1985 | continue; | 1985 | continue; |
1986 | } | 1986 | } |
1987 | if (entry->flags & XFS_ATTR_LOCAL) { | 1987 | if (entry->flags & XFS_ATTR_LOCAL) { |
1988 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe); | 1988 | name_loc = xfs_attr_leaf_name_local(leaf, probe); |
1989 | if (name_loc->namelen != args->namelen) | 1989 | if (name_loc->namelen != args->namelen) |
1990 | continue; | 1990 | continue; |
1991 | if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) != 0) | 1991 | if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) != 0) |
@@ -1995,7 +1995,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
1995 | args->index = probe; | 1995 | args->index = probe; |
1996 | return(XFS_ERROR(EEXIST)); | 1996 | return(XFS_ERROR(EEXIST)); |
1997 | } else { | 1997 | } else { |
1998 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, probe); | 1998 | name_rmt = xfs_attr_leaf_name_remote(leaf, probe); |
1999 | if (name_rmt->namelen != args->namelen) | 1999 | if (name_rmt->namelen != args->namelen) |
2000 | continue; | 2000 | continue; |
2001 | if (memcmp(args->name, (char *)name_rmt->name, | 2001 | if (memcmp(args->name, (char *)name_rmt->name, |
@@ -2035,7 +2035,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
2035 | 2035 | ||
2036 | entry = &leaf->entries[args->index]; | 2036 | entry = &leaf->entries[args->index]; |
2037 | if (entry->flags & XFS_ATTR_LOCAL) { | 2037 | if (entry->flags & XFS_ATTR_LOCAL) { |
2038 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); | 2038 | name_loc = xfs_attr_leaf_name_local(leaf, args->index); |
2039 | ASSERT(name_loc->namelen == args->namelen); | 2039 | ASSERT(name_loc->namelen == args->namelen); |
2040 | ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) == 0); | 2040 | ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) == 0); |
2041 | valuelen = be16_to_cpu(name_loc->valuelen); | 2041 | valuelen = be16_to_cpu(name_loc->valuelen); |
@@ -2050,7 +2050,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args) | |||
2050 | args->valuelen = valuelen; | 2050 | args->valuelen = valuelen; |
2051 | memcpy(args->value, &name_loc->nameval[args->namelen], valuelen); | 2051 | memcpy(args->value, &name_loc->nameval[args->namelen], valuelen); |
2052 | } else { | 2052 | } else { |
2053 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2053 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2054 | ASSERT(name_rmt->namelen == args->namelen); | 2054 | ASSERT(name_rmt->namelen == args->namelen); |
2055 | ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0); | 2055 | ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0); |
2056 | valuelen = be32_to_cpu(name_rmt->valuelen); | 2056 | valuelen = be32_to_cpu(name_rmt->valuelen); |
@@ -2143,7 +2143,7 @@ xfs_attr_leaf_moveents(xfs_attr_leafblock_t *leaf_s, int start_s, | |||
2143 | * off for 6.2, should be revisited later. | 2143 | * off for 6.2, should be revisited later. |
2144 | */ | 2144 | */ |
2145 | if (entry_s->flags & XFS_ATTR_INCOMPLETE) { /* skip partials? */ | 2145 | if (entry_s->flags & XFS_ATTR_INCOMPLETE) { /* skip partials? */ |
2146 | memset(XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), 0, tmp); | 2146 | memset(xfs_attr_leaf_name(leaf_s, start_s + i), 0, tmp); |
2147 | be16_add_cpu(&hdr_s->usedbytes, -tmp); | 2147 | be16_add_cpu(&hdr_s->usedbytes, -tmp); |
2148 | be16_add_cpu(&hdr_s->count, -1); | 2148 | be16_add_cpu(&hdr_s->count, -1); |
2149 | entry_d--; /* to compensate for ++ in loop hdr */ | 2149 | entry_d--; /* to compensate for ++ in loop hdr */ |
@@ -2160,11 +2160,11 @@ xfs_attr_leaf_moveents(xfs_attr_leafblock_t *leaf_s, int start_s, | |||
2160 | entry_d->flags = entry_s->flags; | 2160 | entry_d->flags = entry_s->flags; |
2161 | ASSERT(be16_to_cpu(entry_d->nameidx) + tmp | 2161 | ASSERT(be16_to_cpu(entry_d->nameidx) + tmp |
2162 | <= XFS_LBSIZE(mp)); | 2162 | <= XFS_LBSIZE(mp)); |
2163 | memmove(XFS_ATTR_LEAF_NAME(leaf_d, desti), | 2163 | memmove(xfs_attr_leaf_name(leaf_d, desti), |
2164 | XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), tmp); | 2164 | xfs_attr_leaf_name(leaf_s, start_s + i), tmp); |
2165 | ASSERT(be16_to_cpu(entry_s->nameidx) + tmp | 2165 | ASSERT(be16_to_cpu(entry_s->nameidx) + tmp |
2166 | <= XFS_LBSIZE(mp)); | 2166 | <= XFS_LBSIZE(mp)); |
2167 | memset(XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), 0, tmp); | 2167 | memset(xfs_attr_leaf_name(leaf_s, start_s + i), 0, tmp); |
2168 | be16_add_cpu(&hdr_s->usedbytes, -tmp); | 2168 | be16_add_cpu(&hdr_s->usedbytes, -tmp); |
2169 | be16_add_cpu(&hdr_d->usedbytes, tmp); | 2169 | be16_add_cpu(&hdr_d->usedbytes, tmp); |
2170 | be16_add_cpu(&hdr_s->count, -1); | 2170 | be16_add_cpu(&hdr_s->count, -1); |
@@ -2276,12 +2276,12 @@ xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index) | |||
2276 | 2276 | ||
2277 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC); | 2277 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC); |
2278 | if (leaf->entries[index].flags & XFS_ATTR_LOCAL) { | 2278 | if (leaf->entries[index].flags & XFS_ATTR_LOCAL) { |
2279 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, index); | 2279 | name_loc = xfs_attr_leaf_name_local(leaf, index); |
2280 | size = XFS_ATTR_LEAF_ENTSIZE_LOCAL(name_loc->namelen, | 2280 | size = xfs_attr_leaf_entsize_local(name_loc->namelen, |
2281 | be16_to_cpu(name_loc->valuelen)); | 2281 | be16_to_cpu(name_loc->valuelen)); |
2282 | } else { | 2282 | } else { |
2283 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, index); | 2283 | name_rmt = xfs_attr_leaf_name_remote(leaf, index); |
2284 | size = XFS_ATTR_LEAF_ENTSIZE_REMOTE(name_rmt->namelen); | 2284 | size = xfs_attr_leaf_entsize_remote(name_rmt->namelen); |
2285 | } | 2285 | } |
2286 | return(size); | 2286 | return(size); |
2287 | } | 2287 | } |
@@ -2297,13 +2297,13 @@ xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, int *local) | |||
2297 | { | 2297 | { |
2298 | int size; | 2298 | int size; |
2299 | 2299 | ||
2300 | size = XFS_ATTR_LEAF_ENTSIZE_LOCAL(namelen, valuelen); | 2300 | size = xfs_attr_leaf_entsize_local(namelen, valuelen); |
2301 | if (size < XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(blocksize)) { | 2301 | if (size < xfs_attr_leaf_entsize_local_max(blocksize)) { |
2302 | if (local) { | 2302 | if (local) { |
2303 | *local = 1; | 2303 | *local = 1; |
2304 | } | 2304 | } |
2305 | } else { | 2305 | } else { |
2306 | size = XFS_ATTR_LEAF_ENTSIZE_REMOTE(namelen); | 2306 | size = xfs_attr_leaf_entsize_remote(namelen); |
2307 | if (local) { | 2307 | if (local) { |
2308 | *local = 0; | 2308 | *local = 0; |
2309 | } | 2309 | } |
@@ -2372,7 +2372,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) | |||
2372 | 2372 | ||
2373 | if (entry->flags & XFS_ATTR_LOCAL) { | 2373 | if (entry->flags & XFS_ATTR_LOCAL) { |
2374 | xfs_attr_leaf_name_local_t *name_loc = | 2374 | xfs_attr_leaf_name_local_t *name_loc = |
2375 | XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); | 2375 | xfs_attr_leaf_name_local(leaf, i); |
2376 | 2376 | ||
2377 | retval = context->put_listent(context, | 2377 | retval = context->put_listent(context, |
2378 | entry->flags, | 2378 | entry->flags, |
@@ -2384,7 +2384,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) | |||
2384 | return retval; | 2384 | return retval; |
2385 | } else { | 2385 | } else { |
2386 | xfs_attr_leaf_name_remote_t *name_rmt = | 2386 | xfs_attr_leaf_name_remote_t *name_rmt = |
2387 | XFS_ATTR_LEAF_NAME_REMOTE(leaf, i); | 2387 | xfs_attr_leaf_name_remote(leaf, i); |
2388 | 2388 | ||
2389 | int valuelen = be32_to_cpu(name_rmt->valuelen); | 2389 | int valuelen = be32_to_cpu(name_rmt->valuelen); |
2390 | 2390 | ||
@@ -2468,11 +2468,11 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args) | |||
2468 | 2468 | ||
2469 | #ifdef DEBUG | 2469 | #ifdef DEBUG |
2470 | if (entry->flags & XFS_ATTR_LOCAL) { | 2470 | if (entry->flags & XFS_ATTR_LOCAL) { |
2471 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); | 2471 | name_loc = xfs_attr_leaf_name_local(leaf, args->index); |
2472 | namelen = name_loc->namelen; | 2472 | namelen = name_loc->namelen; |
2473 | name = (char *)name_loc->nameval; | 2473 | name = (char *)name_loc->nameval; |
2474 | } else { | 2474 | } else { |
2475 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2475 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2476 | namelen = name_rmt->namelen; | 2476 | namelen = name_rmt->namelen; |
2477 | name = (char *)name_rmt->name; | 2477 | name = (char *)name_rmt->name; |
2478 | } | 2478 | } |
@@ -2487,7 +2487,7 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args) | |||
2487 | 2487 | ||
2488 | if (args->rmtblkno) { | 2488 | if (args->rmtblkno) { |
2489 | ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0); | 2489 | ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0); |
2490 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2490 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2491 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); | 2491 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); |
2492 | name_rmt->valuelen = cpu_to_be32(args->valuelen); | 2492 | name_rmt->valuelen = cpu_to_be32(args->valuelen); |
2493 | xfs_da_log_buf(args->trans, bp, | 2493 | xfs_da_log_buf(args->trans, bp, |
@@ -2534,7 +2534,7 @@ xfs_attr_leaf_setflag(xfs_da_args_t *args) | |||
2534 | xfs_da_log_buf(args->trans, bp, | 2534 | xfs_da_log_buf(args->trans, bp, |
2535 | XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); | 2535 | XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); |
2536 | if ((entry->flags & XFS_ATTR_LOCAL) == 0) { | 2536 | if ((entry->flags & XFS_ATTR_LOCAL) == 0) { |
2537 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); | 2537 | name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); |
2538 | name_rmt->valueblk = 0; | 2538 | name_rmt->valueblk = 0; |
2539 | name_rmt->valuelen = 0; | 2539 | name_rmt->valuelen = 0; |
2540 | xfs_da_log_buf(args->trans, bp, | 2540 | xfs_da_log_buf(args->trans, bp, |
@@ -2607,20 +2607,20 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) | |||
2607 | 2607 | ||
2608 | #ifdef DEBUG | 2608 | #ifdef DEBUG |
2609 | if (entry1->flags & XFS_ATTR_LOCAL) { | 2609 | if (entry1->flags & XFS_ATTR_LOCAL) { |
2610 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf1, args->index); | 2610 | name_loc = xfs_attr_leaf_name_local(leaf1, args->index); |
2611 | namelen1 = name_loc->namelen; | 2611 | namelen1 = name_loc->namelen; |
2612 | name1 = (char *)name_loc->nameval; | 2612 | name1 = (char *)name_loc->nameval; |
2613 | } else { | 2613 | } else { |
2614 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index); | 2614 | name_rmt = xfs_attr_leaf_name_remote(leaf1, args->index); |
2615 | namelen1 = name_rmt->namelen; | 2615 | namelen1 = name_rmt->namelen; |
2616 | name1 = (char *)name_rmt->name; | 2616 | name1 = (char *)name_rmt->name; |
2617 | } | 2617 | } |
2618 | if (entry2->flags & XFS_ATTR_LOCAL) { | 2618 | if (entry2->flags & XFS_ATTR_LOCAL) { |
2619 | name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf2, args->index2); | 2619 | name_loc = xfs_attr_leaf_name_local(leaf2, args->index2); |
2620 | namelen2 = name_loc->namelen; | 2620 | namelen2 = name_loc->namelen; |
2621 | name2 = (char *)name_loc->nameval; | 2621 | name2 = (char *)name_loc->nameval; |
2622 | } else { | 2622 | } else { |
2623 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf2, args->index2); | 2623 | name_rmt = xfs_attr_leaf_name_remote(leaf2, args->index2); |
2624 | namelen2 = name_rmt->namelen; | 2624 | namelen2 = name_rmt->namelen; |
2625 | name2 = (char *)name_rmt->name; | 2625 | name2 = (char *)name_rmt->name; |
2626 | } | 2626 | } |
@@ -2637,7 +2637,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) | |||
2637 | XFS_DA_LOGRANGE(leaf1, entry1, sizeof(*entry1))); | 2637 | XFS_DA_LOGRANGE(leaf1, entry1, sizeof(*entry1))); |
2638 | if (args->rmtblkno) { | 2638 | if (args->rmtblkno) { |
2639 | ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0); | 2639 | ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0); |
2640 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index); | 2640 | name_rmt = xfs_attr_leaf_name_remote(leaf1, args->index); |
2641 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); | 2641 | name_rmt->valueblk = cpu_to_be32(args->rmtblkno); |
2642 | name_rmt->valuelen = cpu_to_be32(args->valuelen); | 2642 | name_rmt->valuelen = cpu_to_be32(args->valuelen); |
2643 | xfs_da_log_buf(args->trans, bp1, | 2643 | xfs_da_log_buf(args->trans, bp1, |
@@ -2648,7 +2648,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) | |||
2648 | xfs_da_log_buf(args->trans, bp2, | 2648 | xfs_da_log_buf(args->trans, bp2, |
2649 | XFS_DA_LOGRANGE(leaf2, entry2, sizeof(*entry2))); | 2649 | XFS_DA_LOGRANGE(leaf2, entry2, sizeof(*entry2))); |
2650 | if ((entry2->flags & XFS_ATTR_LOCAL) == 0) { | 2650 | if ((entry2->flags & XFS_ATTR_LOCAL) == 0) { |
2651 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf2, args->index2); | 2651 | name_rmt = xfs_attr_leaf_name_remote(leaf2, args->index2); |
2652 | name_rmt->valueblk = 0; | 2652 | name_rmt->valueblk = 0; |
2653 | name_rmt->valuelen = 0; | 2653 | name_rmt->valuelen = 0; |
2654 | xfs_da_log_buf(args->trans, bp2, | 2654 | xfs_da_log_buf(args->trans, bp2, |
@@ -2855,7 +2855,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp) | |||
2855 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { | 2855 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { |
2856 | if (be16_to_cpu(entry->nameidx) && | 2856 | if (be16_to_cpu(entry->nameidx) && |
2857 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { | 2857 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { |
2858 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i); | 2858 | name_rmt = xfs_attr_leaf_name_remote(leaf, i); |
2859 | if (name_rmt->valueblk) | 2859 | if (name_rmt->valueblk) |
2860 | count++; | 2860 | count++; |
2861 | } | 2861 | } |
@@ -2883,7 +2883,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp) | |||
2883 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { | 2883 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { |
2884 | if (be16_to_cpu(entry->nameidx) && | 2884 | if (be16_to_cpu(entry->nameidx) && |
2885 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { | 2885 | ((entry->flags & XFS_ATTR_LOCAL) == 0)) { |
2886 | name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i); | 2886 | name_rmt = xfs_attr_leaf_name_remote(leaf, i); |
2887 | if (name_rmt->valueblk) { | 2887 | if (name_rmt->valueblk) { |
2888 | lp->valueblk = be32_to_cpu(name_rmt->valueblk); | 2888 | lp->valueblk = be32_to_cpu(name_rmt->valueblk); |
2889 | lp->valuelen = XFS_B_TO_FSB(dp->i_mount, | 2889 | lp->valuelen = XFS_B_TO_FSB(dp->i_mount, |
diff --git a/fs/xfs/xfs_attr_leaf.h b/fs/xfs/xfs_attr_leaf.h index 83e9af417ca2..9c7d22fdcf4d 100644 --- a/fs/xfs/xfs_attr_leaf.h +++ b/fs/xfs/xfs_attr_leaf.h | |||
@@ -151,8 +151,6 @@ typedef struct xfs_attr_leafblock { | |||
151 | /* | 151 | /* |
152 | * Cast typed pointers for "local" and "remote" name/value structs. | 152 | * Cast typed pointers for "local" and "remote" name/value structs. |
153 | */ | 153 | */ |
154 | #define XFS_ATTR_LEAF_NAME_REMOTE(leafp,idx) \ | ||
155 | xfs_attr_leaf_name_remote(leafp,idx) | ||
156 | static inline xfs_attr_leaf_name_remote_t * | 154 | static inline xfs_attr_leaf_name_remote_t * |
157 | xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) | 155 | xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) |
158 | { | 156 | { |
@@ -160,8 +158,6 @@ xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx) | |||
160 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; | 158 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; |
161 | } | 159 | } |
162 | 160 | ||
163 | #define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx) \ | ||
164 | xfs_attr_leaf_name_local(leafp,idx) | ||
165 | static inline xfs_attr_leaf_name_local_t * | 161 | static inline xfs_attr_leaf_name_local_t * |
166 | xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) | 162 | xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) |
167 | { | 163 | { |
@@ -169,8 +165,6 @@ xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx) | |||
169 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; | 165 | &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; |
170 | } | 166 | } |
171 | 167 | ||
172 | #define XFS_ATTR_LEAF_NAME(leafp,idx) \ | ||
173 | xfs_attr_leaf_name(leafp,idx) | ||
174 | static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx) | 168 | static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx) |
175 | { | 169 | { |
176 | return &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; | 170 | return &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)]; |
@@ -181,24 +175,18 @@ static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx) | |||
181 | * a "local" name/value structure, a "remote" name/value structure, and | 175 | * a "local" name/value structure, a "remote" name/value structure, and |
182 | * a pointer which might be either. | 176 | * a pointer which might be either. |
183 | */ | 177 | */ |
184 | #define XFS_ATTR_LEAF_ENTSIZE_REMOTE(nlen) \ | ||
185 | xfs_attr_leaf_entsize_remote(nlen) | ||
186 | static inline int xfs_attr_leaf_entsize_remote(int nlen) | 178 | static inline int xfs_attr_leaf_entsize_remote(int nlen) |
187 | { | 179 | { |
188 | return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \ | 180 | return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \ |
189 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | 181 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); |
190 | } | 182 | } |
191 | 183 | ||
192 | #define XFS_ATTR_LEAF_ENTSIZE_LOCAL(nlen,vlen) \ | ||
193 | xfs_attr_leaf_entsize_local(nlen,vlen) | ||
194 | static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen) | 184 | static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen) |
195 | { | 185 | { |
196 | return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) + | 186 | return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) + |
197 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); | 187 | XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1); |
198 | } | 188 | } |
199 | 189 | ||
200 | #define XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(bsize) \ | ||
201 | xfs_attr_leaf_entsize_local_max(bsize) | ||
202 | static inline int xfs_attr_leaf_entsize_local_max(int bsize) | 190 | static inline int xfs_attr_leaf_entsize_local_max(int bsize) |
203 | { | 191 | { |
204 | return (((bsize) >> 1) + ((bsize) >> 2)); | 192 | return (((bsize) >> 1) + ((bsize) >> 2)); |
diff --git a/fs/xfs/xfs_bit.h b/fs/xfs/xfs_bit.h index bca7b243c319..f1e3c907044d 100644 --- a/fs/xfs/xfs_bit.h +++ b/fs/xfs/xfs_bit.h | |||
@@ -23,24 +23,16 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * masks with n high/low bits set, 32-bit values & 64-bit values | 26 | * masks with n high/low bits set, 64-bit values |
27 | */ | 27 | */ |
28 | #define XFS_MASK32HI(n) xfs_mask32hi(n) | ||
29 | static inline __uint32_t xfs_mask32hi(int n) | ||
30 | { | ||
31 | return (__uint32_t)-1 << (32 - (n)); | ||
32 | } | ||
33 | #define XFS_MASK64HI(n) xfs_mask64hi(n) | ||
34 | static inline __uint64_t xfs_mask64hi(int n) | 28 | static inline __uint64_t xfs_mask64hi(int n) |
35 | { | 29 | { |
36 | return (__uint64_t)-1 << (64 - (n)); | 30 | return (__uint64_t)-1 << (64 - (n)); |
37 | } | 31 | } |
38 | #define XFS_MASK32LO(n) xfs_mask32lo(n) | ||
39 | static inline __uint32_t xfs_mask32lo(int n) | 32 | static inline __uint32_t xfs_mask32lo(int n) |
40 | { | 33 | { |
41 | return ((__uint32_t)1 << (n)) - 1; | 34 | return ((__uint32_t)1 << (n)) - 1; |
42 | } | 35 | } |
43 | #define XFS_MASK64LO(n) xfs_mask64lo(n) | ||
44 | static inline __uint64_t xfs_mask64lo(int n) | 36 | static inline __uint64_t xfs_mask64lo(int n) |
45 | { | 37 | { |
46 | return ((__uint64_t)1 << (n)) - 1; | 38 | return ((__uint64_t)1 << (n)) - 1; |
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 8f1ec73725d3..ba6b08c2fb02 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -110,16 +110,16 @@ __xfs_bmbt_get_all( | |||
110 | 110 | ||
111 | ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN)); | 111 | ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN)); |
112 | s->br_startoff = ((xfs_fileoff_t)l0 & | 112 | s->br_startoff = ((xfs_fileoff_t)l0 & |
113 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; | 113 | xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; |
114 | #if XFS_BIG_BLKNOS | 114 | #if XFS_BIG_BLKNOS |
115 | s->br_startblock = (((xfs_fsblock_t)l0 & XFS_MASK64LO(9)) << 43) | | 115 | s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) | |
116 | (((xfs_fsblock_t)l1) >> 21); | 116 | (((xfs_fsblock_t)l1) >> 21); |
117 | #else | 117 | #else |
118 | #ifdef DEBUG | 118 | #ifdef DEBUG |
119 | { | 119 | { |
120 | xfs_dfsbno_t b; | 120 | xfs_dfsbno_t b; |
121 | 121 | ||
122 | b = (((xfs_dfsbno_t)l0 & XFS_MASK64LO(9)) << 43) | | 122 | b = (((xfs_dfsbno_t)l0 & xfs_mask64lo(9)) << 43) | |
123 | (((xfs_dfsbno_t)l1) >> 21); | 123 | (((xfs_dfsbno_t)l1) >> 21); |
124 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); | 124 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); |
125 | s->br_startblock = (xfs_fsblock_t)b; | 125 | s->br_startblock = (xfs_fsblock_t)b; |
@@ -128,7 +128,7 @@ __xfs_bmbt_get_all( | |||
128 | s->br_startblock = (xfs_fsblock_t)(((xfs_dfsbno_t)l1) >> 21); | 128 | s->br_startblock = (xfs_fsblock_t)(((xfs_dfsbno_t)l1) >> 21); |
129 | #endif /* DEBUG */ | 129 | #endif /* DEBUG */ |
130 | #endif /* XFS_BIG_BLKNOS */ | 130 | #endif /* XFS_BIG_BLKNOS */ |
131 | s->br_blockcount = (xfs_filblks_t)(l1 & XFS_MASK64LO(21)); | 131 | s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21)); |
132 | /* This is xfs_extent_state() in-line */ | 132 | /* This is xfs_extent_state() in-line */ |
133 | if (ext_flag) { | 133 | if (ext_flag) { |
134 | ASSERT(s->br_blockcount != 0); /* saved for DMIG */ | 134 | ASSERT(s->br_blockcount != 0); /* saved for DMIG */ |
@@ -153,7 +153,7 @@ xfs_filblks_t | |||
153 | xfs_bmbt_get_blockcount( | 153 | xfs_bmbt_get_blockcount( |
154 | xfs_bmbt_rec_host_t *r) | 154 | xfs_bmbt_rec_host_t *r) |
155 | { | 155 | { |
156 | return (xfs_filblks_t)(r->l1 & XFS_MASK64LO(21)); | 156 | return (xfs_filblks_t)(r->l1 & xfs_mask64lo(21)); |
157 | } | 157 | } |
158 | 158 | ||
159 | /* | 159 | /* |
@@ -164,13 +164,13 @@ xfs_bmbt_get_startblock( | |||
164 | xfs_bmbt_rec_host_t *r) | 164 | xfs_bmbt_rec_host_t *r) |
165 | { | 165 | { |
166 | #if XFS_BIG_BLKNOS | 166 | #if XFS_BIG_BLKNOS |
167 | return (((xfs_fsblock_t)r->l0 & XFS_MASK64LO(9)) << 43) | | 167 | return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) | |
168 | (((xfs_fsblock_t)r->l1) >> 21); | 168 | (((xfs_fsblock_t)r->l1) >> 21); |
169 | #else | 169 | #else |
170 | #ifdef DEBUG | 170 | #ifdef DEBUG |
171 | xfs_dfsbno_t b; | 171 | xfs_dfsbno_t b; |
172 | 172 | ||
173 | b = (((xfs_dfsbno_t)r->l0 & XFS_MASK64LO(9)) << 43) | | 173 | b = (((xfs_dfsbno_t)r->l0 & xfs_mask64lo(9)) << 43) | |
174 | (((xfs_dfsbno_t)r->l1) >> 21); | 174 | (((xfs_dfsbno_t)r->l1) >> 21); |
175 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); | 175 | ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); |
176 | return (xfs_fsblock_t)b; | 176 | return (xfs_fsblock_t)b; |
@@ -188,7 +188,7 @@ xfs_bmbt_get_startoff( | |||
188 | xfs_bmbt_rec_host_t *r) | 188 | xfs_bmbt_rec_host_t *r) |
189 | { | 189 | { |
190 | return ((xfs_fileoff_t)r->l0 & | 190 | return ((xfs_fileoff_t)r->l0 & |
191 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; | 191 | xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; |
192 | } | 192 | } |
193 | 193 | ||
194 | xfs_exntst_t | 194 | xfs_exntst_t |
@@ -219,7 +219,7 @@ xfs_filblks_t | |||
219 | xfs_bmbt_disk_get_blockcount( | 219 | xfs_bmbt_disk_get_blockcount( |
220 | xfs_bmbt_rec_t *r) | 220 | xfs_bmbt_rec_t *r) |
221 | { | 221 | { |
222 | return (xfs_filblks_t)(be64_to_cpu(r->l1) & XFS_MASK64LO(21)); | 222 | return (xfs_filblks_t)(be64_to_cpu(r->l1) & xfs_mask64lo(21)); |
223 | } | 223 | } |
224 | 224 | ||
225 | /* | 225 | /* |
@@ -230,7 +230,7 @@ xfs_bmbt_disk_get_startoff( | |||
230 | xfs_bmbt_rec_t *r) | 230 | xfs_bmbt_rec_t *r) |
231 | { | 231 | { |
232 | return ((xfs_fileoff_t)be64_to_cpu(r->l0) & | 232 | return ((xfs_fileoff_t)be64_to_cpu(r->l0) & |
233 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; | 233 | xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
@@ -248,33 +248,33 @@ xfs_bmbt_set_allf( | |||
248 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; | 248 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; |
249 | 249 | ||
250 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); | 250 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); |
251 | ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0); | 251 | ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); |
252 | ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); | 252 | ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); |
253 | 253 | ||
254 | #if XFS_BIG_BLKNOS | 254 | #if XFS_BIG_BLKNOS |
255 | ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0); | 255 | ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); |
256 | 256 | ||
257 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 257 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
258 | ((xfs_bmbt_rec_base_t)startoff << 9) | | 258 | ((xfs_bmbt_rec_base_t)startoff << 9) | |
259 | ((xfs_bmbt_rec_base_t)startblock >> 43); | 259 | ((xfs_bmbt_rec_base_t)startblock >> 43); |
260 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | | 260 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | |
261 | ((xfs_bmbt_rec_base_t)blockcount & | 261 | ((xfs_bmbt_rec_base_t)blockcount & |
262 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 262 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
263 | #else /* !XFS_BIG_BLKNOS */ | 263 | #else /* !XFS_BIG_BLKNOS */ |
264 | if (ISNULLSTARTBLOCK(startblock)) { | 264 | if (ISNULLSTARTBLOCK(startblock)) { |
265 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 265 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
266 | ((xfs_bmbt_rec_base_t)startoff << 9) | | 266 | ((xfs_bmbt_rec_base_t)startoff << 9) | |
267 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(9); | 267 | (xfs_bmbt_rec_base_t)xfs_mask64lo(9); |
268 | r->l1 = XFS_MASK64HI(11) | | 268 | r->l1 = xfs_mask64hi(11) | |
269 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 269 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
270 | ((xfs_bmbt_rec_base_t)blockcount & | 270 | ((xfs_bmbt_rec_base_t)blockcount & |
271 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 271 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
272 | } else { | 272 | } else { |
273 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 273 | r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
274 | ((xfs_bmbt_rec_base_t)startoff << 9); | 274 | ((xfs_bmbt_rec_base_t)startoff << 9); |
275 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | | 275 | r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | |
276 | ((xfs_bmbt_rec_base_t)blockcount & | 276 | ((xfs_bmbt_rec_base_t)blockcount & |
277 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 277 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
278 | } | 278 | } |
279 | #endif /* XFS_BIG_BLKNOS */ | 279 | #endif /* XFS_BIG_BLKNOS */ |
280 | } | 280 | } |
@@ -306,11 +306,11 @@ xfs_bmbt_disk_set_allf( | |||
306 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; | 306 | int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; |
307 | 307 | ||
308 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); | 308 | ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); |
309 | ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0); | 309 | ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); |
310 | ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); | 310 | ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); |
311 | 311 | ||
312 | #if XFS_BIG_BLKNOS | 312 | #if XFS_BIG_BLKNOS |
313 | ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0); | 313 | ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); |
314 | 314 | ||
315 | r->l0 = cpu_to_be64( | 315 | r->l0 = cpu_to_be64( |
316 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 316 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
@@ -319,17 +319,17 @@ xfs_bmbt_disk_set_allf( | |||
319 | r->l1 = cpu_to_be64( | 319 | r->l1 = cpu_to_be64( |
320 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 320 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
321 | ((xfs_bmbt_rec_base_t)blockcount & | 321 | ((xfs_bmbt_rec_base_t)blockcount & |
322 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); | 322 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); |
323 | #else /* !XFS_BIG_BLKNOS */ | 323 | #else /* !XFS_BIG_BLKNOS */ |
324 | if (ISNULLSTARTBLOCK(startblock)) { | 324 | if (ISNULLSTARTBLOCK(startblock)) { |
325 | r->l0 = cpu_to_be64( | 325 | r->l0 = cpu_to_be64( |
326 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 326 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
327 | ((xfs_bmbt_rec_base_t)startoff << 9) | | 327 | ((xfs_bmbt_rec_base_t)startoff << 9) | |
328 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(9)); | 328 | (xfs_bmbt_rec_base_t)xfs_mask64lo(9)); |
329 | r->l1 = cpu_to_be64(XFS_MASK64HI(11) | | 329 | r->l1 = cpu_to_be64(xfs_mask64hi(11) | |
330 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 330 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
331 | ((xfs_bmbt_rec_base_t)blockcount & | 331 | ((xfs_bmbt_rec_base_t)blockcount & |
332 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); | 332 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); |
333 | } else { | 333 | } else { |
334 | r->l0 = cpu_to_be64( | 334 | r->l0 = cpu_to_be64( |
335 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | | 335 | ((xfs_bmbt_rec_base_t)extent_flag << 63) | |
@@ -337,7 +337,7 @@ xfs_bmbt_disk_set_allf( | |||
337 | r->l1 = cpu_to_be64( | 337 | r->l1 = cpu_to_be64( |
338 | ((xfs_bmbt_rec_base_t)startblock << 21) | | 338 | ((xfs_bmbt_rec_base_t)startblock << 21) | |
339 | ((xfs_bmbt_rec_base_t)blockcount & | 339 | ((xfs_bmbt_rec_base_t)blockcount & |
340 | (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); | 340 | (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); |
341 | } | 341 | } |
342 | #endif /* XFS_BIG_BLKNOS */ | 342 | #endif /* XFS_BIG_BLKNOS */ |
343 | } | 343 | } |
@@ -362,9 +362,9 @@ xfs_bmbt_set_blockcount( | |||
362 | xfs_bmbt_rec_host_t *r, | 362 | xfs_bmbt_rec_host_t *r, |
363 | xfs_filblks_t v) | 363 | xfs_filblks_t v) |
364 | { | 364 | { |
365 | ASSERT((v & XFS_MASK64HI(43)) == 0); | 365 | ASSERT((v & xfs_mask64hi(43)) == 0); |
366 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(43)) | | 366 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64hi(43)) | |
367 | (xfs_bmbt_rec_base_t)(v & XFS_MASK64LO(21)); | 367 | (xfs_bmbt_rec_base_t)(v & xfs_mask64lo(21)); |
368 | } | 368 | } |
369 | 369 | ||
370 | /* | 370 | /* |
@@ -376,21 +376,21 @@ xfs_bmbt_set_startblock( | |||
376 | xfs_fsblock_t v) | 376 | xfs_fsblock_t v) |
377 | { | 377 | { |
378 | #if XFS_BIG_BLKNOS | 378 | #if XFS_BIG_BLKNOS |
379 | ASSERT((v & XFS_MASK64HI(12)) == 0); | 379 | ASSERT((v & xfs_mask64hi(12)) == 0); |
380 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(55)) | | 380 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) | |
381 | (xfs_bmbt_rec_base_t)(v >> 43); | 381 | (xfs_bmbt_rec_base_t)(v >> 43); |
382 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)) | | 382 | r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) | |
383 | (xfs_bmbt_rec_base_t)(v << 21); | 383 | (xfs_bmbt_rec_base_t)(v << 21); |
384 | #else /* !XFS_BIG_BLKNOS */ | 384 | #else /* !XFS_BIG_BLKNOS */ |
385 | if (ISNULLSTARTBLOCK(v)) { | 385 | if (ISNULLSTARTBLOCK(v)) { |
386 | r->l0 |= (xfs_bmbt_rec_base_t)XFS_MASK64LO(9); | 386 | r->l0 |= (xfs_bmbt_rec_base_t)xfs_mask64lo(9); |
387 | r->l1 = (xfs_bmbt_rec_base_t)XFS_MASK64HI(11) | | 387 | r->l1 = (xfs_bmbt_rec_base_t)xfs_mask64hi(11) | |
388 | ((xfs_bmbt_rec_base_t)v << 21) | | 388 | ((xfs_bmbt_rec_base_t)v << 21) | |
389 | (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 389 | (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
390 | } else { | 390 | } else { |
391 | r->l0 &= ~(xfs_bmbt_rec_base_t)XFS_MASK64LO(9); | 391 | r->l0 &= ~(xfs_bmbt_rec_base_t)xfs_mask64lo(9); |
392 | r->l1 = ((xfs_bmbt_rec_base_t)v << 21) | | 392 | r->l1 = ((xfs_bmbt_rec_base_t)v << 21) | |
393 | (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); | 393 | (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); |
394 | } | 394 | } |
395 | #endif /* XFS_BIG_BLKNOS */ | 395 | #endif /* XFS_BIG_BLKNOS */ |
396 | } | 396 | } |
@@ -403,10 +403,10 @@ xfs_bmbt_set_startoff( | |||
403 | xfs_bmbt_rec_host_t *r, | 403 | xfs_bmbt_rec_host_t *r, |
404 | xfs_fileoff_t v) | 404 | xfs_fileoff_t v) |
405 | { | 405 | { |
406 | ASSERT((v & XFS_MASK64HI(9)) == 0); | 406 | ASSERT((v & xfs_mask64hi(9)) == 0); |
407 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) XFS_MASK64HI(1)) | | 407 | r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) xfs_mask64hi(1)) | |
408 | ((xfs_bmbt_rec_base_t)v << 9) | | 408 | ((xfs_bmbt_rec_base_t)v << 9) | |
409 | (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(9)); | 409 | (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64lo(9)); |
410 | } | 410 | } |
411 | 411 | ||
412 | /* | 412 | /* |
@@ -419,9 +419,9 @@ xfs_bmbt_set_state( | |||
419 | { | 419 | { |
420 | ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN); | 420 | ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN); |
421 | if (v == XFS_EXT_NORM) | 421 | if (v == XFS_EXT_NORM) |
422 | r->l0 &= XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN); | 422 | r->l0 &= xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN); |
423 | else | 423 | else |
424 | r->l0 |= XFS_MASK64HI(BMBT_EXNTFLAG_BITLEN); | 424 | r->l0 |= xfs_mask64hi(BMBT_EXNTFLAG_BITLEN); |
425 | } | 425 | } |
426 | 426 | ||
427 | /* | 427 | /* |
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c index 7ed59267420d..2c3ef20f8842 100644 --- a/fs/xfs/xfs_btree.c +++ b/fs/xfs/xfs_btree.c | |||
@@ -730,8 +730,8 @@ xfs_btree_readahead_lblock( | |||
730 | struct xfs_btree_block *block) | 730 | struct xfs_btree_block *block) |
731 | { | 731 | { |
732 | int rval = 0; | 732 | int rval = 0; |
733 | xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); | 733 | xfs_dfsbno_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); |
734 | xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); | 734 | xfs_dfsbno_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); |
735 | 735 | ||
736 | if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { | 736 | if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { |
737 | xfs_btree_reada_bufl(cur->bc_mp, left, 1); | 737 | xfs_btree_reada_bufl(cur->bc_mp, left, 1); |
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index e2fa0a1d8e96..e1f0a06aaf04 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -517,9 +517,9 @@ xfs_dir2_block_getdents( | |||
517 | /* | 517 | /* |
518 | * If it didn't fit, set the final offset to here & return. | 518 | * If it didn't fit, set the final offset to here & return. |
519 | */ | 519 | */ |
520 | if (filldir(dirent, dep->name, dep->namelen, cook, | 520 | if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff, |
521 | ino, DT_UNKNOWN)) { | 521 | ino, DT_UNKNOWN)) { |
522 | *offset = cook; | 522 | *offset = cook & 0x7fffffff; |
523 | xfs_da_brelse(NULL, bp); | 523 | xfs_da_brelse(NULL, bp); |
524 | return 0; | 524 | return 0; |
525 | } | 525 | } |
@@ -529,7 +529,8 @@ xfs_dir2_block_getdents( | |||
529 | * Reached the end of the block. | 529 | * Reached the end of the block. |
530 | * Set the offset to a non-existent block 1 and return. | 530 | * Set the offset to a non-existent block 1 and return. |
531 | */ | 531 | */ |
532 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); | 532 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & |
533 | 0x7fffffff; | ||
533 | xfs_da_brelse(NULL, bp); | 534 | xfs_da_brelse(NULL, bp); |
534 | return 0; | 535 | return 0; |
535 | } | 536 | } |
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index 93535992cb60..ef805a374eec 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
@@ -1092,7 +1092,7 @@ xfs_dir2_leaf_getdents( | |||
1092 | * Won't fit. Return to caller. | 1092 | * Won't fit. Return to caller. |
1093 | */ | 1093 | */ |
1094 | if (filldir(dirent, dep->name, dep->namelen, | 1094 | if (filldir(dirent, dep->name, dep->namelen, |
1095 | xfs_dir2_byte_to_dataptr(mp, curoff), | 1095 | xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff, |
1096 | ino, DT_UNKNOWN)) | 1096 | ino, DT_UNKNOWN)) |
1097 | break; | 1097 | break; |
1098 | 1098 | ||
@@ -1108,9 +1108,9 @@ xfs_dir2_leaf_getdents( | |||
1108 | * All done. Set output offset value to current offset. | 1108 | * All done. Set output offset value to current offset. |
1109 | */ | 1109 | */ |
1110 | if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR)) | 1110 | if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR)) |
1111 | *offset = XFS_DIR2_MAX_DATAPTR; | 1111 | *offset = XFS_DIR2_MAX_DATAPTR & 0x7fffffff; |
1112 | else | 1112 | else |
1113 | *offset = xfs_dir2_byte_to_dataptr(mp, curoff); | 1113 | *offset = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff; |
1114 | kmem_free(map); | 1114 | kmem_free(map); |
1115 | if (bp) | 1115 | if (bp) |
1116 | xfs_da_brelse(NULL, bp); | 1116 | xfs_da_brelse(NULL, bp); |
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index b46af0013ec9..a8a8a6efad5b 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -752,8 +752,8 @@ xfs_dir2_sf_getdents( | |||
752 | #if XFS_BIG_INUMS | 752 | #if XFS_BIG_INUMS |
753 | ino += mp->m_inoadd; | 753 | ino += mp->m_inoadd; |
754 | #endif | 754 | #endif |
755 | if (filldir(dirent, ".", 1, dot_offset, ino, DT_DIR)) { | 755 | if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, ino, DT_DIR)) { |
756 | *offset = dot_offset; | 756 | *offset = dot_offset & 0x7fffffff; |
757 | return 0; | 757 | return 0; |
758 | } | 758 | } |
759 | } | 759 | } |
@@ -766,8 +766,8 @@ xfs_dir2_sf_getdents( | |||
766 | #if XFS_BIG_INUMS | 766 | #if XFS_BIG_INUMS |
767 | ino += mp->m_inoadd; | 767 | ino += mp->m_inoadd; |
768 | #endif | 768 | #endif |
769 | if (filldir(dirent, "..", 2, dotdot_offset, ino, DT_DIR)) { | 769 | if (filldir(dirent, "..", 2, dotdot_offset & 0x7fffffff, ino, DT_DIR)) { |
770 | *offset = dotdot_offset; | 770 | *offset = dotdot_offset & 0x7fffffff; |
771 | return 0; | 771 | return 0; |
772 | } | 772 | } |
773 | } | 773 | } |
@@ -791,14 +791,15 @@ xfs_dir2_sf_getdents( | |||
791 | #endif | 791 | #endif |
792 | 792 | ||
793 | if (filldir(dirent, sfep->name, sfep->namelen, | 793 | if (filldir(dirent, sfep->name, sfep->namelen, |
794 | off, ino, DT_UNKNOWN)) { | 794 | off & 0x7fffffff, ino, DT_UNKNOWN)) { |
795 | *offset = off; | 795 | *offset = off & 0x7fffffff; |
796 | return 0; | 796 | return 0; |
797 | } | 797 | } |
798 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); | 798 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); |
799 | } | 799 | } |
800 | 800 | ||
801 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); | 801 | *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & |
802 | 0x7fffffff; | ||
802 | return 0; | 803 | return 0; |
803 | } | 804 | } |
804 | 805 | ||
diff --git a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h index 0f5191644ab2..b2f724502f1b 100644 --- a/fs/xfs/xfs_types.h +++ b/fs/xfs/xfs_types.h | |||
@@ -45,7 +45,7 @@ typedef __uint32_t prid_t; /* project ID */ | |||
45 | typedef __uint32_t inst_t; /* an instruction */ | 45 | typedef __uint32_t inst_t; /* an instruction */ |
46 | 46 | ||
47 | typedef __s64 xfs_off_t; /* <file offset> type */ | 47 | typedef __s64 xfs_off_t; /* <file offset> type */ |
48 | typedef __u64 xfs_ino_t; /* <inode> type */ | 48 | typedef unsigned long long xfs_ino_t; /* <inode> type */ |
49 | typedef __s64 xfs_daddr_t; /* <disk address> type */ | 49 | typedef __s64 xfs_daddr_t; /* <disk address> type */ |
50 | typedef char * xfs_caddr_t; /* <core address> type */ | 50 | typedef char * xfs_caddr_t; /* <core address> type */ |
51 | typedef __u32 xfs_dev_t; | 51 | typedef __u32 xfs_dev_t; |
@@ -111,8 +111,6 @@ typedef __uint64_t xfs_fileoff_t; /* block number in a file */ | |||
111 | typedef __int64_t xfs_sfiloff_t; /* signed block number in a file */ | 111 | typedef __int64_t xfs_sfiloff_t; /* signed block number in a file */ |
112 | typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */ | 112 | typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */ |
113 | 113 | ||
114 | typedef __uint8_t xfs_arch_t; /* architecture of an xfs fs */ | ||
115 | |||
116 | /* | 114 | /* |
117 | * Null values for the types. | 115 | * Null values for the types. |
118 | */ | 116 | */ |
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild index 1f44e7c76995..0f8956def738 100644 --- a/include/asm-frv/Kbuild +++ b/include/asm-frv/Kbuild | |||
@@ -3,4 +3,3 @@ include include/asm-generic/Kbuild.asm | |||
3 | header-y += registers.h | 3 | header-y += registers.h |
4 | 4 | ||
5 | unifdef-y += termios.h | 5 | unifdef-y += termios.h |
6 | unifdef-y += swab.h | ||
diff --git a/include/asm-frv/byteorder.h b/include/asm-frv/byteorder.h index 1187e51ecd13..f29b7593e088 100644 --- a/include/asm-frv/byteorder.h +++ b/include/asm-frv/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_BYTEORDER_H | 1 | #ifndef _ASM_BYTEORDER_H |
2 | #define _ASM_BYTEORDER_H | 2 | #define _ASM_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_BYTEORDER_H */ | 6 | #endif /* _ASM_BYTEORDER_H */ |
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index 1870d5e05f1c..70d185534b9d 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm | |||
@@ -31,6 +31,7 @@ unifdef-y += socket.h | |||
31 | unifdef-y += sockios.h | 31 | unifdef-y += sockios.h |
32 | unifdef-y += stat.h | 32 | unifdef-y += stat.h |
33 | unifdef-y += statfs.h | 33 | unifdef-y += statfs.h |
34 | unifdef-y += swab.h | ||
34 | unifdef-y += termbits.h | 35 | unifdef-y += termbits.h |
35 | unifdef-y += termios.h | 36 | unifdef-y += termios.h |
36 | unifdef-y += types.h | 37 | unifdef-y += types.h |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 72ebe91005a8..8e6d0ca70aba 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -301,7 +301,7 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm, | |||
301 | * track_pfn_vma_new is called when a _new_ pfn mapping is being established | 301 | * track_pfn_vma_new is called when a _new_ pfn mapping is being established |
302 | * for physical range indicated by pfn and size. | 302 | * for physical range indicated by pfn and size. |
303 | */ | 303 | */ |
304 | static inline int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | 304 | static inline int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot, |
305 | unsigned long pfn, unsigned long size) | 305 | unsigned long pfn, unsigned long size) |
306 | { | 306 | { |
307 | return 0; | 307 | return 0; |
@@ -332,7 +332,7 @@ static inline void untrack_pfn_vma(struct vm_area_struct *vma, | |||
332 | { | 332 | { |
333 | } | 333 | } |
334 | #else | 334 | #else |
335 | extern int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot, | 335 | extern int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot, |
336 | unsigned long pfn, unsigned long size); | 336 | unsigned long pfn, unsigned long size); |
337 | extern int track_pfn_vma_copy(struct vm_area_struct *vma); | 337 | extern int track_pfn_vma_copy(struct vm_area_struct *vma); |
338 | extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn, | 338 | extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn, |
diff --git a/include/asm-m32r/Kbuild b/include/asm-m32r/Kbuild index 27b108a86b39..c68e1680da01 100644 --- a/include/asm-m32r/Kbuild +++ b/include/asm-m32r/Kbuild | |||
@@ -1,2 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | unifdef-y += swab.h | ||
diff --git a/include/asm-m32r/byteorder.h b/include/asm-m32r/byteorder.h index 61ff9cfd8451..21855d8b028b 100644 --- a/include/asm-m32r/byteorder.h +++ b/include/asm-m32r/byteorder.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ASM_M32R_BYTEORDER_H | 1 | #ifndef _ASM_M32R_BYTEORDER_H |
2 | #define _ASM_M32R_BYTEORDER_H | 2 | #define _ASM_M32R_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | |||
6 | #if defined(__LITTLE_ENDIAN__) | 4 | #if defined(__LITTLE_ENDIAN__) |
7 | # include <linux/byteorder/little_endian.h> | 5 | # include <linux/byteorder/little_endian.h> |
8 | #else | 6 | #else |
diff --git a/include/asm-m68k/Kbuild b/include/asm-m68k/Kbuild index 52fd96b4142a..1a922fad76f7 100644 --- a/include/asm-m68k/Kbuild +++ b/include/asm-m68k/Kbuild | |||
@@ -1,3 +1,2 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | header-y += cachectl.h | 2 | header-y += cachectl.h |
3 | unifdef-y += swab.h | ||
diff --git a/include/asm-m68k/byteorder.h b/include/asm-m68k/byteorder.h index 300866523b86..31b260a88803 100644 --- a/include/asm-m68k/byteorder.h +++ b/include/asm-m68k/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _M68K_BYTEORDER_H | 1 | #ifndef _M68K_BYTEORDER_H |
2 | #define _M68K_BYTEORDER_H | 2 | #define _M68K_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/big_endian.h> | 4 | #include <linux/byteorder/big_endian.h> |
6 | 5 | ||
7 | #endif /* _M68K_BYTEORDER_H */ | 6 | #endif /* _M68K_BYTEORDER_H */ |
diff --git a/include/asm-mn10300/Kbuild b/include/asm-mn10300/Kbuild index 27b108a86b39..c68e1680da01 100644 --- a/include/asm-mn10300/Kbuild +++ b/include/asm-mn10300/Kbuild | |||
@@ -1,2 +1 @@ | |||
1 | include include/asm-generic/Kbuild.asm | include include/asm-generic/Kbuild.asm | |
2 | unifdef-y += swab.h | ||
diff --git a/include/asm-mn10300/byteorder.h b/include/asm-mn10300/byteorder.h index 45b18ded19e6..5dd0bdd9feee 100644 --- a/include/asm-mn10300/byteorder.h +++ b/include/asm-mn10300/byteorder.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_BYTEORDER_H | 1 | #ifndef _ASM_BYTEORDER_H |
2 | #define _ASM_BYTEORDER_H | 2 | #define _ASM_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/swab.h> | ||
5 | #include <linux/byteorder/little_endian.h> | 4 | #include <linux/byteorder/little_endian.h> |
6 | 5 | ||
7 | #endif /* _ASM_BYTEORDER_H */ | 6 | #endif /* _ASM_BYTEORDER_H */ |
diff --git a/include/linux/compat.h b/include/linux/compat.h index e88f3ecf38b4..3fd2194ff573 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -280,5 +280,18 @@ asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | |||
280 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | 280 | asmlinkage long compat_sys_timerfd_gettime(int ufd, |
281 | struct compat_itimerspec __user *otmr); | 281 | struct compat_itimerspec __user *otmr); |
282 | 282 | ||
283 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | ||
284 | __u32 __user *pages, | ||
285 | const int __user *nodes, | ||
286 | int __user *status, | ||
287 | int flags); | ||
288 | asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, | ||
289 | struct compat_timeval __user *t); | ||
290 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | ||
291 | struct compat_stat __user *statbuf, | ||
292 | int flag); | ||
293 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | ||
294 | int flags, int mode); | ||
295 | |||
283 | #endif /* CONFIG_COMPAT */ | 296 | #endif /* CONFIG_COMPAT */ |
284 | #endif /* _LINUX_COMPAT_H */ | 297 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 3644f6323384..194da5a4b0d6 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -871,7 +871,7 @@ struct ide_host { | |||
871 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ | 871 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ |
872 | 872 | ||
873 | /* used for hosts requiring serialization */ | 873 | /* used for hosts requiring serialization */ |
874 | volatile long host_busy; | 874 | volatile unsigned long host_busy; |
875 | }; | 875 | }; |
876 | 876 | ||
877 | #define IDE_HOST_BUSY 0 | 877 | #define IDE_HOST_BUSY 0 |
diff --git a/include/linux/mm.h b/include/linux/mm.h index b91a73fd1bcc..e8ddc98b8405 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -260,7 +260,6 @@ static inline int put_page_testzero(struct page *page) | |||
260 | */ | 260 | */ |
261 | static inline int get_page_unless_zero(struct page *page) | 261 | static inline int get_page_unless_zero(struct page *page) |
262 | { | 262 | { |
263 | VM_BUG_ON(PageTail(page)); | ||
264 | return atomic_inc_not_zero(&page->_count); | 263 | return atomic_inc_not_zero(&page->_count); |
265 | } | 264 | } |
266 | 265 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d543365518ab..d56ad9c21c09 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2174,6 +2174,7 @@ | |||
2174 | #define PCI_DEVICE_ID_RDC_R6040 0x6040 | 2174 | #define PCI_DEVICE_ID_RDC_R6040 0x6040 |
2175 | #define PCI_DEVICE_ID_RDC_R6060 0x6060 | 2175 | #define PCI_DEVICE_ID_RDC_R6060 0x6060 |
2176 | #define PCI_DEVICE_ID_RDC_R6061 0x6061 | 2176 | #define PCI_DEVICE_ID_RDC_R6061 0x6061 |
2177 | #define PCI_DEVICE_ID_RDC_D1010 0x1010 | ||
2177 | 2178 | ||
2178 | #define PCI_VENDOR_ID_LENOVO 0x17aa | 2179 | #define PCI_VENDOR_ID_LENOVO 0x17aa |
2179 | 2180 | ||
diff --git a/include/linux/swab.h b/include/linux/swab.h index be5284d4a053..ea0c02fd5163 100644 --- a/include/linux/swab.h +++ b/include/linux/swab.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | #include <asm/byteorder.h> | 6 | #include <asm/swab.h> |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * casts are necessary for constants, because we never know how for sure | 9 | * casts are necessary for constants, because we never know how for sure |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 18d0a243a7b3..16875f89e6a7 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -54,6 +54,7 @@ struct compat_stat; | |||
54 | struct compat_timeval; | 54 | struct compat_timeval; |
55 | struct robust_list_head; | 55 | struct robust_list_head; |
56 | struct getcpu_cache; | 56 | struct getcpu_cache; |
57 | struct old_linux_dirent; | ||
57 | 58 | ||
58 | #include <linux/types.h> | 59 | #include <linux/types.h> |
59 | #include <linux/aio_abi.h> | 60 | #include <linux/aio_abi.h> |
@@ -65,6 +66,74 @@ struct getcpu_cache; | |||
65 | #include <linux/quota.h> | 66 | #include <linux/quota.h> |
66 | #include <linux/key.h> | 67 | #include <linux/key.h> |
67 | 68 | ||
69 | #define __SC_DECL1(t1, a1) t1 a1 | ||
70 | #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) | ||
71 | #define __SC_DECL3(t3, a3, ...) t3 a3, __SC_DECL2(__VA_ARGS__) | ||
72 | #define __SC_DECL4(t4, a4, ...) t4 a4, __SC_DECL3(__VA_ARGS__) | ||
73 | #define __SC_DECL5(t5, a5, ...) t5 a5, __SC_DECL4(__VA_ARGS__) | ||
74 | #define __SC_DECL6(t6, a6, ...) t6 a6, __SC_DECL5(__VA_ARGS__) | ||
75 | |||
76 | #define __SC_LONG1(t1, a1) long a1 | ||
77 | #define __SC_LONG2(t2, a2, ...) long a2, __SC_LONG1(__VA_ARGS__) | ||
78 | #define __SC_LONG3(t3, a3, ...) long a3, __SC_LONG2(__VA_ARGS__) | ||
79 | #define __SC_LONG4(t4, a4, ...) long a4, __SC_LONG3(__VA_ARGS__) | ||
80 | #define __SC_LONG5(t5, a5, ...) long a5, __SC_LONG4(__VA_ARGS__) | ||
81 | #define __SC_LONG6(t6, a6, ...) long a6, __SC_LONG5(__VA_ARGS__) | ||
82 | |||
83 | #define __SC_CAST1(t1, a1) (t1) a1 | ||
84 | #define __SC_CAST2(t2, a2, ...) (t2) a2, __SC_CAST1(__VA_ARGS__) | ||
85 | #define __SC_CAST3(t3, a3, ...) (t3) a3, __SC_CAST2(__VA_ARGS__) | ||
86 | #define __SC_CAST4(t4, a4, ...) (t4) a4, __SC_CAST3(__VA_ARGS__) | ||
87 | #define __SC_CAST5(t5, a5, ...) (t5) a5, __SC_CAST4(__VA_ARGS__) | ||
88 | #define __SC_CAST6(t6, a6, ...) (t6) a6, __SC_CAST5(__VA_ARGS__) | ||
89 | |||
90 | #define __SC_TEST(type) BUILD_BUG_ON(sizeof(type) > sizeof(long)) | ||
91 | #define __SC_TEST1(t1, a1) __SC_TEST(t1) | ||
92 | #define __SC_TEST2(t2, a2, ...) __SC_TEST(t2); __SC_TEST1(__VA_ARGS__) | ||
93 | #define __SC_TEST3(t3, a3, ...) __SC_TEST(t3); __SC_TEST2(__VA_ARGS__) | ||
94 | #define __SC_TEST4(t4, a4, ...) __SC_TEST(t4); __SC_TEST3(__VA_ARGS__) | ||
95 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | ||
96 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | ||
97 | |||
98 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | ||
99 | #define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__) | ||
100 | #define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__) | ||
101 | #define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__) | ||
102 | #define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__) | ||
103 | #define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__) | ||
104 | #define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__) | ||
105 | |||
106 | #ifdef CONFIG_PPC64 | ||
107 | #define SYSCALL_ALIAS(alias, name) \ | ||
108 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ | ||
109 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) | ||
110 | #else | ||
111 | #define SYSCALL_ALIAS(alias, name) \ | ||
112 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) | ||
113 | #endif | ||
114 | |||
115 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
116 | |||
117 | #define SYSCALL_DEFINE(name) static inline long SYSC_##name | ||
118 | #define SYSCALL_DEFINEx(x, name, ...) \ | ||
119 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \ | ||
120 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \ | ||
121 | asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \ | ||
122 | { \ | ||
123 | __SC_TEST##x(__VA_ARGS__); \ | ||
124 | return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \ | ||
125 | } \ | ||
126 | SYSCALL_ALIAS(sys_##name, SyS_##name); \ | ||
127 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)) | ||
128 | |||
129 | #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
130 | |||
131 | #define SYSCALL_DEFINE(name) asmlinkage long sys_##name | ||
132 | #define SYSCALL_DEFINEx(x, name, ...) \ | ||
133 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)) | ||
134 | |||
135 | #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
136 | |||
68 | asmlinkage long sys_time(time_t __user *tloc); | 137 | asmlinkage long sys_time(time_t __user *tloc); |
69 | asmlinkage long sys_stime(time_t __user *tptr); | 138 | asmlinkage long sys_stime(time_t __user *tptr); |
70 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, | 139 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, |
@@ -77,7 +146,7 @@ asmlinkage long sys_times(struct tms __user *tbuf); | |||
77 | 146 | ||
78 | asmlinkage long sys_gettid(void); | 147 | asmlinkage long sys_gettid(void); |
79 | asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); | 148 | asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); |
80 | asmlinkage unsigned long sys_alarm(unsigned int seconds); | 149 | asmlinkage long sys_alarm(unsigned int seconds); |
81 | asmlinkage long sys_getpid(void); | 150 | asmlinkage long sys_getpid(void); |
82 | asmlinkage long sys_getppid(void); | 151 | asmlinkage long sys_getppid(void); |
83 | asmlinkage long sys_getuid(void); | 152 | asmlinkage long sys_getuid(void); |
@@ -166,7 +235,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, | |||
166 | unsigned long flags); | 235 | unsigned long flags); |
167 | 236 | ||
168 | asmlinkage long sys_exit(int error_code); | 237 | asmlinkage long sys_exit(int error_code); |
169 | asmlinkage void sys_exit_group(int error_code); | 238 | asmlinkage long sys_exit_group(int error_code); |
170 | asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, | 239 | asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, |
171 | int options, struct rusage __user *ru); | 240 | int options, struct rusage __user *ru); |
172 | asmlinkage long sys_waitid(int which, pid_t pid, | 241 | asmlinkage long sys_waitid(int which, pid_t pid, |
@@ -196,7 +265,7 @@ asmlinkage long sys_tkill(int pid, int sig); | |||
196 | asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo); | 265 | asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo); |
197 | asmlinkage long sys_sgetmask(void); | 266 | asmlinkage long sys_sgetmask(void); |
198 | asmlinkage long sys_ssetmask(int newmask); | 267 | asmlinkage long sys_ssetmask(int newmask); |
199 | asmlinkage unsigned long sys_signal(int sig, __sighandler_t handler); | 268 | asmlinkage long sys_signal(int sig, __sighandler_t handler); |
200 | asmlinkage long sys_pause(void); | 269 | asmlinkage long sys_pause(void); |
201 | 270 | ||
202 | asmlinkage long sys_sync(void); | 271 | asmlinkage long sys_sync(void); |
@@ -246,29 +315,29 @@ asmlinkage long sys_lsetxattr(const char __user *path, const char __user *name, | |||
246 | const void __user *value, size_t size, int flags); | 315 | const void __user *value, size_t size, int flags); |
247 | asmlinkage long sys_fsetxattr(int fd, const char __user *name, | 316 | asmlinkage long sys_fsetxattr(int fd, const char __user *name, |
248 | const void __user *value, size_t size, int flags); | 317 | const void __user *value, size_t size, int flags); |
249 | asmlinkage ssize_t sys_getxattr(const char __user *path, const char __user *name, | 318 | asmlinkage long sys_getxattr(const char __user *path, const char __user *name, |
250 | void __user *value, size_t size); | 319 | void __user *value, size_t size); |
251 | asmlinkage ssize_t sys_lgetxattr(const char __user *path, const char __user *name, | 320 | asmlinkage long sys_lgetxattr(const char __user *path, const char __user *name, |
252 | void __user *value, size_t size); | 321 | void __user *value, size_t size); |
253 | asmlinkage ssize_t sys_fgetxattr(int fd, const char __user *name, | 322 | asmlinkage long sys_fgetxattr(int fd, const char __user *name, |
254 | void __user *value, size_t size); | 323 | void __user *value, size_t size); |
255 | asmlinkage ssize_t sys_listxattr(const char __user *path, char __user *list, | 324 | asmlinkage long sys_listxattr(const char __user *path, char __user *list, |
256 | size_t size); | 325 | size_t size); |
257 | asmlinkage ssize_t sys_llistxattr(const char __user *path, char __user *list, | 326 | asmlinkage long sys_llistxattr(const char __user *path, char __user *list, |
258 | size_t size); | 327 | size_t size); |
259 | asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size); | 328 | asmlinkage long sys_flistxattr(int fd, char __user *list, size_t size); |
260 | asmlinkage long sys_removexattr(const char __user *path, | 329 | asmlinkage long sys_removexattr(const char __user *path, |
261 | const char __user *name); | 330 | const char __user *name); |
262 | asmlinkage long sys_lremovexattr(const char __user *path, | 331 | asmlinkage long sys_lremovexattr(const char __user *path, |
263 | const char __user *name); | 332 | const char __user *name); |
264 | asmlinkage long sys_fremovexattr(int fd, const char __user *name); | 333 | asmlinkage long sys_fremovexattr(int fd, const char __user *name); |
265 | 334 | ||
266 | asmlinkage unsigned long sys_brk(unsigned long brk); | 335 | asmlinkage long sys_brk(unsigned long brk); |
267 | asmlinkage long sys_mprotect(unsigned long start, size_t len, | 336 | asmlinkage long sys_mprotect(unsigned long start, size_t len, |
268 | unsigned long prot); | 337 | unsigned long prot); |
269 | asmlinkage unsigned long sys_mremap(unsigned long addr, | 338 | asmlinkage long sys_mremap(unsigned long addr, |
270 | unsigned long old_len, unsigned long new_len, | 339 | unsigned long old_len, unsigned long new_len, |
271 | unsigned long flags, unsigned long new_addr); | 340 | unsigned long flags, unsigned long new_addr); |
272 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, | 341 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, |
273 | unsigned long prot, unsigned long pgoff, | 342 | unsigned long prot, unsigned long pgoff, |
274 | unsigned long flags); | 343 | unsigned long flags); |
@@ -321,10 +390,10 @@ asmlinkage long sys_io_submit(aio_context_t, long, | |||
321 | struct iocb __user * __user *); | 390 | struct iocb __user * __user *); |
322 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | 391 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, |
323 | struct io_event __user *result); | 392 | struct io_event __user *result); |
324 | asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, | 393 | asmlinkage long sys_sendfile(int out_fd, int in_fd, |
325 | off_t __user *offset, size_t count); | 394 | off_t __user *offset, size_t count); |
326 | asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, | 395 | asmlinkage long sys_sendfile64(int out_fd, int in_fd, |
327 | loff_t __user *offset, size_t count); | 396 | loff_t __user *offset, size_t count); |
328 | asmlinkage long sys_readlink(const char __user *path, | 397 | asmlinkage long sys_readlink(const char __user *path, |
329 | char __user *buf, int bufsiz); | 398 | char __user *buf, int bufsiz); |
330 | asmlinkage long sys_creat(const char __user *pathname, int mode); | 399 | asmlinkage long sys_creat(const char __user *pathname, int mode); |
@@ -368,26 +437,25 @@ asmlinkage long sys_utime(char __user *filename, | |||
368 | struct utimbuf __user *times); | 437 | struct utimbuf __user *times); |
369 | asmlinkage long sys_utimes(char __user *filename, | 438 | asmlinkage long sys_utimes(char __user *filename, |
370 | struct timeval __user *utimes); | 439 | struct timeval __user *utimes); |
371 | asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, | 440 | asmlinkage long sys_lseek(unsigned int fd, off_t offset, |
372 | unsigned int origin); | 441 | unsigned int origin); |
373 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, | 442 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, |
374 | unsigned long offset_low, loff_t __user *result, | 443 | unsigned long offset_low, loff_t __user *result, |
375 | unsigned int origin); | 444 | unsigned int origin); |
376 | asmlinkage ssize_t sys_read(unsigned int fd, char __user *buf, | 445 | asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); |
377 | size_t count); | 446 | asmlinkage long sys_readahead(int fd, loff_t offset, size_t count); |
378 | asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count); | 447 | asmlinkage long sys_readv(unsigned long fd, |
379 | asmlinkage ssize_t sys_readv(unsigned long fd, | 448 | const struct iovec __user *vec, |
380 | const struct iovec __user *vec, | 449 | unsigned long vlen); |
381 | unsigned long vlen); | 450 | asmlinkage long sys_write(unsigned int fd, const char __user *buf, |
382 | asmlinkage ssize_t sys_write(unsigned int fd, const char __user *buf, | 451 | size_t count); |
383 | size_t count); | 452 | asmlinkage long sys_writev(unsigned long fd, |
384 | asmlinkage ssize_t sys_writev(unsigned long fd, | 453 | const struct iovec __user *vec, |
385 | const struct iovec __user *vec, | 454 | unsigned long vlen); |
386 | unsigned long vlen); | 455 | asmlinkage long sys_pread64(unsigned int fd, char __user *buf, |
387 | asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | 456 | size_t count, loff_t pos); |
388 | size_t count, loff_t pos); | 457 | asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf, |
389 | asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | 458 | size_t count, loff_t pos); |
390 | size_t count, loff_t pos); | ||
391 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); | 459 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); |
392 | asmlinkage long sys_mkdir(const char __user *pathname, int mode); | 460 | asmlinkage long sys_mkdir(const char __user *pathname, int mode); |
393 | asmlinkage long sys_chdir(const char __user *filename); | 461 | asmlinkage long sys_chdir(const char __user *filename); |
@@ -476,7 +544,7 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); | |||
476 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); | 544 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); |
477 | asmlinkage long sys_mq_unlink(const char __user *name); | 545 | asmlinkage long sys_mq_unlink(const char __user *name); |
478 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); | 546 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); |
479 | asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); | 547 | asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); |
480 | asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); | 548 | asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); |
481 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); | 549 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); |
482 | 550 | ||
@@ -530,11 +598,6 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, | |||
530 | const int __user *nodes, | 598 | const int __user *nodes, |
531 | int __user *status, | 599 | int __user *status, |
532 | int flags); | 600 | int flags); |
533 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | ||
534 | __u32 __user *pages, | ||
535 | const int __user *nodes, | ||
536 | int __user *status, | ||
537 | int flags); | ||
538 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, | 601 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, |
539 | unsigned long mode, | 602 | unsigned long mode, |
540 | unsigned long __user *nmask, | 603 | unsigned long __user *nmask, |
@@ -583,13 +646,6 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *bu | |||
583 | int bufsiz); | 646 | int bufsiz); |
584 | asmlinkage long sys_utimensat(int dfd, char __user *filename, | 647 | asmlinkage long sys_utimensat(int dfd, char __user *filename, |
585 | struct timespec __user *utimes, int flags); | 648 | struct timespec __user *utimes, int flags); |
586 | asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, | ||
587 | struct compat_timeval __user *t); | ||
588 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | ||
589 | struct compat_stat __user *statbuf, | ||
590 | int flag); | ||
591 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | ||
592 | int flags, int mode); | ||
593 | asmlinkage long sys_unshare(unsigned long unshare_flags); | 649 | asmlinkage long sys_unshare(unsigned long unshare_flags); |
594 | 650 | ||
595 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, | 651 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, |
@@ -621,6 +677,15 @@ asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); | |||
621 | asmlinkage long sys_eventfd(unsigned int count); | 677 | asmlinkage long sys_eventfd(unsigned int count); |
622 | asmlinkage long sys_eventfd2(unsigned int count, int flags); | 678 | asmlinkage long sys_eventfd2(unsigned int count, int flags); |
623 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | 679 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
680 | asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int); | ||
681 | asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, | ||
682 | fd_set __user *, struct timespec __user *, | ||
683 | void __user *); | ||
684 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, | ||
685 | struct timespec __user *, const sigset_t __user *, | ||
686 | size_t); | ||
687 | asmlinkage long sys_pipe2(int __user *, int); | ||
688 | asmlinkage long sys_pipe(int __user *); | ||
624 | 689 | ||
625 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 690 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
626 | 691 | ||
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 23fdb8492b8e..54b4077fed79 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -650,8 +650,8 @@ static struct file *do_open(struct dentry *dentry, int oflag) | |||
650 | return dentry_open(dentry, mqueue_mnt, oflag, cred); | 650 | return dentry_open(dentry, mqueue_mnt, oflag, cred); |
651 | } | 651 | } |
652 | 652 | ||
653 | asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode, | 653 | SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, |
654 | struct mq_attr __user *u_attr) | 654 | struct mq_attr __user *, u_attr) |
655 | { | 655 | { |
656 | struct dentry *dentry; | 656 | struct dentry *dentry; |
657 | struct file *filp; | 657 | struct file *filp; |
@@ -721,7 +721,7 @@ out_putname: | |||
721 | return fd; | 721 | return fd; |
722 | } | 722 | } |
723 | 723 | ||
724 | asmlinkage long sys_mq_unlink(const char __user *u_name) | 724 | SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name) |
725 | { | 725 | { |
726 | int err; | 726 | int err; |
727 | char *name; | 727 | char *name; |
@@ -814,9 +814,9 @@ static inline void pipelined_receive(struct mqueue_inode_info *info) | |||
814 | sender->state = STATE_READY; | 814 | sender->state = STATE_READY; |
815 | } | 815 | } |
816 | 816 | ||
817 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, | 817 | SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, |
818 | size_t msg_len, unsigned int msg_prio, | 818 | size_t, msg_len, unsigned int, msg_prio, |
819 | const struct timespec __user *u_abs_timeout) | 819 | const struct timespec __user *, u_abs_timeout) |
820 | { | 820 | { |
821 | struct file *filp; | 821 | struct file *filp; |
822 | struct inode *inode; | 822 | struct inode *inode; |
@@ -907,9 +907,9 @@ out: | |||
907 | return ret; | 907 | return ret; |
908 | } | 908 | } |
909 | 909 | ||
910 | asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, | 910 | SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, |
911 | size_t msg_len, unsigned int __user *u_msg_prio, | 911 | size_t, msg_len, unsigned int __user *, u_msg_prio, |
912 | const struct timespec __user *u_abs_timeout) | 912 | const struct timespec __user *, u_abs_timeout) |
913 | { | 913 | { |
914 | long timeout; | 914 | long timeout; |
915 | ssize_t ret; | 915 | ssize_t ret; |
@@ -997,8 +997,8 @@ out: | |||
997 | * and he isn't currently owner of notification, will be silently discarded. | 997 | * and he isn't currently owner of notification, will be silently discarded. |
998 | * It isn't explicitly defined in the POSIX. | 998 | * It isn't explicitly defined in the POSIX. |
999 | */ | 999 | */ |
1000 | asmlinkage long sys_mq_notify(mqd_t mqdes, | 1000 | SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, |
1001 | const struct sigevent __user *u_notification) | 1001 | const struct sigevent __user *, u_notification) |
1002 | { | 1002 | { |
1003 | int ret; | 1003 | int ret; |
1004 | struct file *filp; | 1004 | struct file *filp; |
@@ -1123,9 +1123,9 @@ out: | |||
1123 | return ret; | 1123 | return ret; |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, | 1126 | SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, |
1127 | const struct mq_attr __user *u_mqstat, | 1127 | const struct mq_attr __user *, u_mqstat, |
1128 | struct mq_attr __user *u_omqstat) | 1128 | struct mq_attr __user *, u_omqstat) |
1129 | { | 1129 | { |
1130 | int ret; | 1130 | int ret; |
1131 | struct mq_attr mqstat, omqstat; | 1131 | struct mq_attr mqstat, omqstat; |
@@ -309,7 +309,7 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg) | |||
309 | return security_msg_queue_associate(msq, msgflg); | 309 | return security_msg_queue_associate(msq, msgflg); |
310 | } | 310 | } |
311 | 311 | ||
312 | asmlinkage long sys_msgget(key_t key, int msgflg) | 312 | SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg) |
313 | { | 313 | { |
314 | struct ipc_namespace *ns; | 314 | struct ipc_namespace *ns; |
315 | struct ipc_ops msg_ops; | 315 | struct ipc_ops msg_ops; |
@@ -466,7 +466,7 @@ out_up: | |||
466 | return err; | 466 | return err; |
467 | } | 467 | } |
468 | 468 | ||
469 | asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf) | 469 | SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf) |
470 | { | 470 | { |
471 | struct msg_queue *msq; | 471 | struct msg_queue *msq; |
472 | int err, version; | 472 | int err, version; |
@@ -723,8 +723,8 @@ out_free: | |||
723 | return err; | 723 | return err; |
724 | } | 724 | } |
725 | 725 | ||
726 | asmlinkage long | 726 | SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, |
727 | sys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg) | 727 | int, msgflg) |
728 | { | 728 | { |
729 | long mtype; | 729 | long mtype; |
730 | 730 | ||
@@ -904,8 +904,8 @@ out_unlock: | |||
904 | return msgsz; | 904 | return msgsz; |
905 | } | 905 | } |
906 | 906 | ||
907 | asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz, | 907 | SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, |
908 | long msgtyp, int msgflg) | 908 | long, msgtyp, int, msgflg) |
909 | { | 909 | { |
910 | long err, mtype; | 910 | long err, mtype; |
911 | 911 | ||
@@ -308,7 +308,7 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp, | |||
308 | return 0; | 308 | return 0; |
309 | } | 309 | } |
310 | 310 | ||
311 | asmlinkage long sys_semget(key_t key, int nsems, int semflg) | 311 | SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg) |
312 | { | 312 | { |
313 | struct ipc_namespace *ns; | 313 | struct ipc_namespace *ns; |
314 | struct ipc_ops sem_ops; | 314 | struct ipc_ops sem_ops; |
@@ -887,7 +887,7 @@ out_up: | |||
887 | return err; | 887 | return err; |
888 | } | 888 | } |
889 | 889 | ||
890 | asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg) | 890 | SYSCALL_DEFINE(semctl)(int semid, int semnum, int cmd, union semun arg) |
891 | { | 891 | { |
892 | int err = -EINVAL; | 892 | int err = -EINVAL; |
893 | int version; | 893 | int version; |
@@ -923,6 +923,13 @@ asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg) | |||
923 | return -EINVAL; | 923 | return -EINVAL; |
924 | } | 924 | } |
925 | } | 925 | } |
926 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
927 | asmlinkage long SyS_semctl(int semid, int semnum, int cmd, union semun arg) | ||
928 | { | ||
929 | return SYSC_semctl((int) semid, (int) semnum, (int) cmd, arg); | ||
930 | } | ||
931 | SYSCALL_ALIAS(sys_semctl, SyS_semctl); | ||
932 | #endif | ||
926 | 933 | ||
927 | /* If the task doesn't already have a undo_list, then allocate one | 934 | /* If the task doesn't already have a undo_list, then allocate one |
928 | * here. We guarantee there is only one thread using this undo list, | 935 | * here. We guarantee there is only one thread using this undo list, |
@@ -1048,8 +1055,8 @@ out: | |||
1048 | return un; | 1055 | return un; |
1049 | } | 1056 | } |
1050 | 1057 | ||
1051 | asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops, | 1058 | SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, |
1052 | unsigned nsops, const struct timespec __user *timeout) | 1059 | unsigned, nsops, const struct timespec __user *, timeout) |
1053 | { | 1060 | { |
1054 | int error = -EINVAL; | 1061 | int error = -EINVAL; |
1055 | struct sem_array *sma; | 1062 | struct sem_array *sma; |
@@ -1225,7 +1232,8 @@ out_free: | |||
1225 | return error; | 1232 | return error; |
1226 | } | 1233 | } |
1227 | 1234 | ||
1228 | asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops) | 1235 | SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops, |
1236 | unsigned, nsops) | ||
1229 | { | 1237 | { |
1230 | return sys_semtimedop(semid, tsops, nsops, NULL); | 1238 | return sys_semtimedop(semid, tsops, nsops, NULL); |
1231 | } | 1239 | } |
@@ -440,7 +440,7 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp, | |||
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | 442 | ||
443 | asmlinkage long sys_shmget (key_t key, size_t size, int shmflg) | 443 | SYSCALL_DEFINE3(shmget, key_t, key, size_t, size, int, shmflg) |
444 | { | 444 | { |
445 | struct ipc_namespace *ns; | 445 | struct ipc_namespace *ns; |
446 | struct ipc_ops shm_ops; | 446 | struct ipc_ops shm_ops; |
@@ -621,7 +621,7 @@ out_up: | |||
621 | return err; | 621 | return err; |
622 | } | 622 | } |
623 | 623 | ||
624 | asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) | 624 | SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) |
625 | { | 625 | { |
626 | struct shmid_kernel *shp; | 626 | struct shmid_kernel *shp; |
627 | int err, version; | 627 | int err, version; |
@@ -939,7 +939,7 @@ out_put_dentry: | |||
939 | goto out_nattch; | 939 | goto out_nattch; |
940 | } | 940 | } |
941 | 941 | ||
942 | asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg) | 942 | SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg) |
943 | { | 943 | { |
944 | unsigned long ret; | 944 | unsigned long ret; |
945 | long err; | 945 | long err; |
@@ -955,7 +955,7 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg) | |||
955 | * detach and kill segment if marked destroyed. | 955 | * detach and kill segment if marked destroyed. |
956 | * The work is done in shm_close. | 956 | * The work is done in shm_close. |
957 | */ | 957 | */ |
958 | asmlinkage long sys_shmdt(char __user *shmaddr) | 958 | SYSCALL_DEFINE1(shmdt, char __user *, shmaddr) |
959 | { | 959 | { |
960 | struct mm_struct *mm = current->mm; | 960 | struct mm_struct *mm = current->mm; |
961 | struct vm_area_struct *vma, *next; | 961 | struct vm_area_struct *vma, *next; |
diff --git a/kernel/Makefile b/kernel/Makefile index 2aebc4cd7878..170a9213c1b6 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -40,9 +40,8 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o | |||
40 | obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o | 40 | obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o |
41 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o | 41 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o |
42 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o | 42 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o |
43 | ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y) | 43 | obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o |
44 | obj-y += smp.o | 44 | ifneq ($(CONFIG_SMP),y) |
45 | else | ||
46 | obj-y += up.o | 45 | obj-y += up.o |
47 | endif | 46 | endif |
48 | obj-$(CONFIG_SMP) += spinlock.o | 47 | obj-$(CONFIG_SMP) += spinlock.o |
diff --git a/kernel/acct.c b/kernel/acct.c index d57b7cbb98b6..7afa31564162 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -277,7 +277,7 @@ static int acct_on(char *name) | |||
277 | * should be written. If the filename is NULL, accounting will be | 277 | * should be written. If the filename is NULL, accounting will be |
278 | * shutdown. | 278 | * shutdown. |
279 | */ | 279 | */ |
280 | asmlinkage long sys_acct(const char __user *name) | 280 | SYSCALL_DEFINE1(acct, const char __user *, name) |
281 | { | 281 | { |
282 | int error; | 282 | int error; |
283 | 283 | ||
diff --git a/kernel/capability.c b/kernel/capability.c index 688926e496be..4e17041963f5 100644 --- a/kernel/capability.c +++ b/kernel/capability.c | |||
@@ -161,7 +161,7 @@ static inline int cap_get_target_pid(pid_t pid, kernel_cap_t *pEp, | |||
161 | * | 161 | * |
162 | * Returns 0 on success and < 0 on error. | 162 | * Returns 0 on success and < 0 on error. |
163 | */ | 163 | */ |
164 | asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) | 164 | SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr) |
165 | { | 165 | { |
166 | int ret = 0; | 166 | int ret = 0; |
167 | pid_t pid; | 167 | pid_t pid; |
@@ -235,7 +235,7 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) | |||
235 | * | 235 | * |
236 | * Returns 0 on success and < 0 on error. | 236 | * Returns 0 on success and < 0 on error. |
237 | */ | 237 | */ |
238 | asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data) | 238 | SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data) |
239 | { | 239 | { |
240 | struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S]; | 240 | struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S]; |
241 | unsigned i, tocopy; | 241 | unsigned i, tocopy; |
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index 0511716e9424..667c841c2952 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c | |||
@@ -209,8 +209,7 @@ static int __init proc_execdomains_init(void) | |||
209 | module_init(proc_execdomains_init); | 209 | module_init(proc_execdomains_init); |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | asmlinkage long | 212 | SYSCALL_DEFINE1(personality, u_long, personality) |
213 | sys_personality(u_long personality) | ||
214 | { | 213 | { |
215 | u_long old = current->personality; | 214 | u_long old = current->personality; |
216 | 215 | ||
diff --git a/kernel/exit.c b/kernel/exit.c index c7740fa3252c..f80dec3f1875 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1141,7 +1141,7 @@ NORET_TYPE void complete_and_exit(struct completion *comp, long code) | |||
1141 | 1141 | ||
1142 | EXPORT_SYMBOL(complete_and_exit); | 1142 | EXPORT_SYMBOL(complete_and_exit); |
1143 | 1143 | ||
1144 | asmlinkage long sys_exit(int error_code) | 1144 | SYSCALL_DEFINE1(exit, int, error_code) |
1145 | { | 1145 | { |
1146 | do_exit((error_code&0xff)<<8); | 1146 | do_exit((error_code&0xff)<<8); |
1147 | } | 1147 | } |
@@ -1182,9 +1182,11 @@ do_group_exit(int exit_code) | |||
1182 | * wait4()-ing process will get the correct exit code - even if this | 1182 | * wait4()-ing process will get the correct exit code - even if this |
1183 | * thread is not the thread group leader. | 1183 | * thread is not the thread group leader. |
1184 | */ | 1184 | */ |
1185 | asmlinkage void sys_exit_group(int error_code) | 1185 | SYSCALL_DEFINE1(exit_group, int, error_code) |
1186 | { | 1186 | { |
1187 | do_group_exit((error_code & 0xff) << 8); | 1187 | do_group_exit((error_code & 0xff) << 8); |
1188 | /* NOTREACHED */ | ||
1189 | return 0; | ||
1188 | } | 1190 | } |
1189 | 1191 | ||
1190 | static struct pid *task_pid_type(struct task_struct *task, enum pid_type type) | 1192 | static struct pid *task_pid_type(struct task_struct *task, enum pid_type type) |
@@ -1752,9 +1754,8 @@ end: | |||
1752 | return retval; | 1754 | return retval; |
1753 | } | 1755 | } |
1754 | 1756 | ||
1755 | asmlinkage long sys_waitid(int which, pid_t upid, | 1757 | SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, |
1756 | struct siginfo __user *infop, int options, | 1758 | infop, int, options, struct rusage __user *, ru) |
1757 | struct rusage __user *ru) | ||
1758 | { | 1759 | { |
1759 | struct pid *pid = NULL; | 1760 | struct pid *pid = NULL; |
1760 | enum pid_type type; | 1761 | enum pid_type type; |
@@ -1793,8 +1794,8 @@ asmlinkage long sys_waitid(int which, pid_t upid, | |||
1793 | return ret; | 1794 | return ret; |
1794 | } | 1795 | } |
1795 | 1796 | ||
1796 | asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr, | 1797 | SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, |
1797 | int options, struct rusage __user *ru) | 1798 | int, options, struct rusage __user *, ru) |
1798 | { | 1799 | { |
1799 | struct pid *pid = NULL; | 1800 | struct pid *pid = NULL; |
1800 | enum pid_type type; | 1801 | enum pid_type type; |
@@ -1831,7 +1832,7 @@ asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr, | |||
1831 | * sys_waitpid() remains for compatibility. waitpid() should be | 1832 | * sys_waitpid() remains for compatibility. waitpid() should be |
1832 | * implemented by calling sys_wait4() from libc.a. | 1833 | * implemented by calling sys_wait4() from libc.a. |
1833 | */ | 1834 | */ |
1834 | asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options) | 1835 | SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options) |
1835 | { | 1836 | { |
1836 | return sys_wait4(pid, stat_addr, options, NULL); | 1837 | return sys_wait4(pid, stat_addr, options, NULL); |
1837 | } | 1838 | } |
diff --git a/kernel/fork.c b/kernel/fork.c index 1d68f1255dd8..bf0cef8bbdf2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -901,7 +901,7 @@ static void copy_flags(unsigned long clone_flags, struct task_struct *p) | |||
901 | clear_freeze_flag(p); | 901 | clear_freeze_flag(p); |
902 | } | 902 | } |
903 | 903 | ||
904 | asmlinkage long sys_set_tid_address(int __user *tidptr) | 904 | SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr) |
905 | { | 905 | { |
906 | current->clear_child_tid = tidptr; | 906 | current->clear_child_tid = tidptr; |
907 | 907 | ||
@@ -1603,7 +1603,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp | |||
1603 | * constructed. Here we are modifying the current, active, | 1603 | * constructed. Here we are modifying the current, active, |
1604 | * task_struct. | 1604 | * task_struct. |
1605 | */ | 1605 | */ |
1606 | asmlinkage long sys_unshare(unsigned long unshare_flags) | 1606 | SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) |
1607 | { | 1607 | { |
1608 | int err = 0; | 1608 | int err = 0; |
1609 | struct fs_struct *fs, *new_fs = NULL; | 1609 | struct fs_struct *fs, *new_fs = NULL; |
diff --git a/kernel/futex.c b/kernel/futex.c index 002aa189eb09..f89d373a9c6d 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -1733,9 +1733,8 @@ pi_faulted: | |||
1733 | * @head: pointer to the list-head | 1733 | * @head: pointer to the list-head |
1734 | * @len: length of the list-head, as userspace expects | 1734 | * @len: length of the list-head, as userspace expects |
1735 | */ | 1735 | */ |
1736 | asmlinkage long | 1736 | SYSCALL_DEFINE2(set_robust_list, struct robust_list_head __user *, head, |
1737 | sys_set_robust_list(struct robust_list_head __user *head, | 1737 | size_t, len) |
1738 | size_t len) | ||
1739 | { | 1738 | { |
1740 | if (!futex_cmpxchg_enabled) | 1739 | if (!futex_cmpxchg_enabled) |
1741 | return -ENOSYS; | 1740 | return -ENOSYS; |
@@ -1756,9 +1755,9 @@ sys_set_robust_list(struct robust_list_head __user *head, | |||
1756 | * @head_ptr: pointer to a list-head pointer, the kernel fills it in | 1755 | * @head_ptr: pointer to a list-head pointer, the kernel fills it in |
1757 | * @len_ptr: pointer to a length field, the kernel fills in the header size | 1756 | * @len_ptr: pointer to a length field, the kernel fills in the header size |
1758 | */ | 1757 | */ |
1759 | asmlinkage long | 1758 | SYSCALL_DEFINE3(get_robust_list, int, pid, |
1760 | sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr, | 1759 | struct robust_list_head __user * __user *, head_ptr, |
1761 | size_t __user *len_ptr) | 1760 | size_t __user *, len_ptr) |
1762 | { | 1761 | { |
1763 | struct robust_list_head __user *head; | 1762 | struct robust_list_head __user *head; |
1764 | unsigned long ret; | 1763 | unsigned long ret; |
@@ -1978,9 +1977,9 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, | |||
1978 | } | 1977 | } |
1979 | 1978 | ||
1980 | 1979 | ||
1981 | asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val, | 1980 | SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val, |
1982 | struct timespec __user *utime, u32 __user *uaddr2, | 1981 | struct timespec __user *, utime, u32 __user *, uaddr2, |
1983 | u32 val3) | 1982 | u32, val3) |
1984 | { | 1983 | { |
1985 | struct timespec ts; | 1984 | struct timespec ts; |
1986 | ktime_t t, *tp = NULL; | 1985 | ktime_t t, *tp = NULL; |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 1455b7651b6b..2dc30c59c5fd 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -1467,8 +1467,8 @@ out: | |||
1467 | return ret; | 1467 | return ret; |
1468 | } | 1468 | } |
1469 | 1469 | ||
1470 | asmlinkage long | 1470 | SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, |
1471 | sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp) | 1471 | struct timespec __user *, rmtp) |
1472 | { | 1472 | { |
1473 | struct timespec tu; | 1473 | struct timespec tu; |
1474 | 1474 | ||
diff --git a/kernel/itimer.c b/kernel/itimer.c index db7c358b9a02..6a5fe93dd8bd 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c | |||
@@ -100,7 +100,7 @@ int do_getitimer(int which, struct itimerval *value) | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | asmlinkage long sys_getitimer(int which, struct itimerval __user *value) | 103 | SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value) |
104 | { | 104 | { |
105 | int error = -EFAULT; | 105 | int error = -EFAULT; |
106 | struct itimerval get_buffer; | 106 | struct itimerval get_buffer; |
@@ -260,9 +260,8 @@ unsigned int alarm_setitimer(unsigned int seconds) | |||
260 | return it_old.it_value.tv_sec; | 260 | return it_old.it_value.tv_sec; |
261 | } | 261 | } |
262 | 262 | ||
263 | asmlinkage long sys_setitimer(int which, | 263 | SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value, |
264 | struct itimerval __user *value, | 264 | struct itimerval __user *, ovalue) |
265 | struct itimerval __user *ovalue) | ||
266 | { | 265 | { |
267 | struct itimerval set_buffer, get_buffer; | 266 | struct itimerval set_buffer, get_buffer; |
268 | int error; | 267 | int error; |
diff --git a/kernel/kexec.c b/kernel/kexec.c index 3fb855ad6aa0..8a6d7b08864e 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -934,9 +934,8 @@ struct kimage *kexec_crash_image; | |||
934 | 934 | ||
935 | static DEFINE_MUTEX(kexec_mutex); | 935 | static DEFINE_MUTEX(kexec_mutex); |
936 | 936 | ||
937 | asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, | 937 | SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, |
938 | struct kexec_segment __user *segments, | 938 | struct kexec_segment __user *, segments, unsigned long, flags) |
939 | unsigned long flags) | ||
940 | { | 939 | { |
941 | struct kimage **dest_image, *image; | 940 | struct kimage **dest_image, *image; |
942 | int result; | 941 | int result; |
diff --git a/kernel/module.c b/kernel/module.c index c9332c90d5a0..e8b51d41dd72 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -743,8 +743,8 @@ static void wait_for_zero_refcount(struct module *mod) | |||
743 | mutex_lock(&module_mutex); | 743 | mutex_lock(&module_mutex); |
744 | } | 744 | } |
745 | 745 | ||
746 | asmlinkage long | 746 | SYSCALL_DEFINE2(delete_module, const char __user *, name_user, |
747 | sys_delete_module(const char __user *name_user, unsigned int flags) | 747 | unsigned int, flags) |
748 | { | 748 | { |
749 | struct module *mod; | 749 | struct module *mod; |
750 | char name[MODULE_NAME_LEN]; | 750 | char name[MODULE_NAME_LEN]; |
@@ -2296,10 +2296,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2296 | } | 2296 | } |
2297 | 2297 | ||
2298 | /* This is where the real work happens */ | 2298 | /* This is where the real work happens */ |
2299 | asmlinkage long | 2299 | SYSCALL_DEFINE3(init_module, void __user *, umod, |
2300 | sys_init_module(void __user *umod, | 2300 | unsigned long, len, const char __user *, uargs) |
2301 | unsigned long len, | ||
2302 | const char __user *uargs) | ||
2303 | { | 2301 | { |
2304 | struct module *mod; | 2302 | struct module *mod; |
2305 | int ret = 0; | 2303 | int ret = 0; |
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 887c63787de6..052ec4d195c7 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -477,10 +477,9 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) | |||
477 | 477 | ||
478 | /* Create a POSIX.1b interval timer. */ | 478 | /* Create a POSIX.1b interval timer. */ |
479 | 479 | ||
480 | asmlinkage long | 480 | SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock, |
481 | sys_timer_create(const clockid_t which_clock, | 481 | struct sigevent __user *, timer_event_spec, |
482 | struct sigevent __user *timer_event_spec, | 482 | timer_t __user *, created_timer_id) |
483 | timer_t __user * created_timer_id) | ||
484 | { | 483 | { |
485 | struct k_itimer *new_timer; | 484 | struct k_itimer *new_timer; |
486 | int error, new_timer_id; | 485 | int error, new_timer_id; |
@@ -661,8 +660,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) | |||
661 | } | 660 | } |
662 | 661 | ||
663 | /* Get the time remaining on a POSIX.1b interval timer. */ | 662 | /* Get the time remaining on a POSIX.1b interval timer. */ |
664 | asmlinkage long | 663 | SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, |
665 | sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting) | 664 | struct itimerspec __user *, setting) |
666 | { | 665 | { |
667 | struct k_itimer *timr; | 666 | struct k_itimer *timr; |
668 | struct itimerspec cur_setting; | 667 | struct itimerspec cur_setting; |
@@ -691,8 +690,7 @@ sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting) | |||
691 | * the call back to do_schedule_next_timer(). So all we need to do is | 690 | * the call back to do_schedule_next_timer(). So all we need to do is |
692 | * to pick up the frozen overrun. | 691 | * to pick up the frozen overrun. |
693 | */ | 692 | */ |
694 | asmlinkage long | 693 | SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id) |
695 | sys_timer_getoverrun(timer_t timer_id) | ||
696 | { | 694 | { |
697 | struct k_itimer *timr; | 695 | struct k_itimer *timr; |
698 | int overrun; | 696 | int overrun; |
@@ -760,10 +758,9 @@ common_timer_set(struct k_itimer *timr, int flags, | |||
760 | } | 758 | } |
761 | 759 | ||
762 | /* Set a POSIX.1b interval timer */ | 760 | /* Set a POSIX.1b interval timer */ |
763 | asmlinkage long | 761 | SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, |
764 | sys_timer_settime(timer_t timer_id, int flags, | 762 | const struct itimerspec __user *, new_setting, |
765 | const struct itimerspec __user *new_setting, | 763 | struct itimerspec __user *, old_setting) |
766 | struct itimerspec __user *old_setting) | ||
767 | { | 764 | { |
768 | struct k_itimer *timr; | 765 | struct k_itimer *timr; |
769 | struct itimerspec new_spec, old_spec; | 766 | struct itimerspec new_spec, old_spec; |
@@ -816,8 +813,7 @@ static inline int timer_delete_hook(struct k_itimer *timer) | |||
816 | } | 813 | } |
817 | 814 | ||
818 | /* Delete a POSIX.1b interval timer. */ | 815 | /* Delete a POSIX.1b interval timer. */ |
819 | asmlinkage long | 816 | SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) |
820 | sys_timer_delete(timer_t timer_id) | ||
821 | { | 817 | { |
822 | struct k_itimer *timer; | 818 | struct k_itimer *timer; |
823 | unsigned long flags; | 819 | unsigned long flags; |
@@ -903,8 +899,8 @@ int do_posix_clock_nonanosleep(const clockid_t clock, int flags, | |||
903 | } | 899 | } |
904 | EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); | 900 | EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); |
905 | 901 | ||
906 | asmlinkage long sys_clock_settime(const clockid_t which_clock, | 902 | SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, |
907 | const struct timespec __user *tp) | 903 | const struct timespec __user *, tp) |
908 | { | 904 | { |
909 | struct timespec new_tp; | 905 | struct timespec new_tp; |
910 | 906 | ||
@@ -916,8 +912,8 @@ asmlinkage long sys_clock_settime(const clockid_t which_clock, | |||
916 | return CLOCK_DISPATCH(which_clock, clock_set, (which_clock, &new_tp)); | 912 | return CLOCK_DISPATCH(which_clock, clock_set, (which_clock, &new_tp)); |
917 | } | 913 | } |
918 | 914 | ||
919 | asmlinkage long | 915 | SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, |
920 | sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp) | 916 | struct timespec __user *,tp) |
921 | { | 917 | { |
922 | struct timespec kernel_tp; | 918 | struct timespec kernel_tp; |
923 | int error; | 919 | int error; |
@@ -933,8 +929,8 @@ sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp) | |||
933 | 929 | ||
934 | } | 930 | } |
935 | 931 | ||
936 | asmlinkage long | 932 | SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, |
937 | sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp) | 933 | struct timespec __user *, tp) |
938 | { | 934 | { |
939 | struct timespec rtn_tp; | 935 | struct timespec rtn_tp; |
940 | int error; | 936 | int error; |
@@ -963,10 +959,9 @@ static int common_nsleep(const clockid_t which_clock, int flags, | |||
963 | which_clock); | 959 | which_clock); |
964 | } | 960 | } |
965 | 961 | ||
966 | asmlinkage long | 962 | SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, |
967 | sys_clock_nanosleep(const clockid_t which_clock, int flags, | 963 | const struct timespec __user *, rqtp, |
968 | const struct timespec __user *rqtp, | 964 | struct timespec __user *, rmtp) |
969 | struct timespec __user *rmtp) | ||
970 | { | 965 | { |
971 | struct timespec t; | 966 | struct timespec t; |
972 | 967 | ||
diff --git a/kernel/printk.c b/kernel/printk.c index 7015733793e8..69188f226a93 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -382,7 +382,7 @@ out: | |||
382 | return error; | 382 | return error; |
383 | } | 383 | } |
384 | 384 | ||
385 | asmlinkage long sys_syslog(int type, char __user *buf, int len) | 385 | SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) |
386 | { | 386 | { |
387 | return do_syslog(type, buf, len); | 387 | return do_syslog(type, buf, len); |
388 | } | 388 | } |
@@ -742,11 +742,6 @@ EXPORT_SYMBOL(vprintk); | |||
742 | 742 | ||
743 | #else | 743 | #else |
744 | 744 | ||
745 | asmlinkage long sys_syslog(int type, char __user *buf, int len) | ||
746 | { | ||
747 | return -ENOSYS; | ||
748 | } | ||
749 | |||
750 | static void call_console_drivers(unsigned start, unsigned end) | 745 | static void call_console_drivers(unsigned start, unsigned end) |
751 | { | 746 | { |
752 | } | 747 | } |
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 29dc700e198c..c9cf48b21f05 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -574,7 +574,7 @@ struct task_struct *ptrace_get_task_struct(pid_t pid) | |||
574 | #define arch_ptrace_attach(child) do { } while (0) | 574 | #define arch_ptrace_attach(child) do { } while (0) |
575 | #endif | 575 | #endif |
576 | 576 | ||
577 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | 577 | SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data) |
578 | { | 578 | { |
579 | struct task_struct *child; | 579 | struct task_struct *child; |
580 | long ret; | 580 | long ret; |
diff --git a/kernel/sched.c b/kernel/sched.c index 8be2c13b50d0..eb1931eef587 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -5126,7 +5126,7 @@ int can_nice(const struct task_struct *p, const int nice) | |||
5126 | * sys_setpriority is a more generic, but much slower function that | 5126 | * sys_setpriority is a more generic, but much slower function that |
5127 | * does similar things. | 5127 | * does similar things. |
5128 | */ | 5128 | */ |
5129 | asmlinkage long sys_nice(int increment) | 5129 | SYSCALL_DEFINE1(nice, int, increment) |
5130 | { | 5130 | { |
5131 | long nice, retval; | 5131 | long nice, retval; |
5132 | 5132 | ||
@@ -5433,8 +5433,8 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | |||
5433 | * @policy: new policy. | 5433 | * @policy: new policy. |
5434 | * @param: structure containing the new RT priority. | 5434 | * @param: structure containing the new RT priority. |
5435 | */ | 5435 | */ |
5436 | asmlinkage long | 5436 | SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, |
5437 | sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | 5437 | struct sched_param __user *, param) |
5438 | { | 5438 | { |
5439 | /* negative values for policy are not valid */ | 5439 | /* negative values for policy are not valid */ |
5440 | if (policy < 0) | 5440 | if (policy < 0) |
@@ -5448,7 +5448,7 @@ sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) | |||
5448 | * @pid: the pid in question. | 5448 | * @pid: the pid in question. |
5449 | * @param: structure containing the new RT priority. | 5449 | * @param: structure containing the new RT priority. |
5450 | */ | 5450 | */ |
5451 | asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) | 5451 | SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param) |
5452 | { | 5452 | { |
5453 | return do_sched_setscheduler(pid, -1, param); | 5453 | return do_sched_setscheduler(pid, -1, param); |
5454 | } | 5454 | } |
@@ -5457,7 +5457,7 @@ asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) | |||
5457 | * sys_sched_getscheduler - get the policy (scheduling class) of a thread | 5457 | * sys_sched_getscheduler - get the policy (scheduling class) of a thread |
5458 | * @pid: the pid in question. | 5458 | * @pid: the pid in question. |
5459 | */ | 5459 | */ |
5460 | asmlinkage long sys_sched_getscheduler(pid_t pid) | 5460 | SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) |
5461 | { | 5461 | { |
5462 | struct task_struct *p; | 5462 | struct task_struct *p; |
5463 | int retval; | 5463 | int retval; |
@@ -5482,7 +5482,7 @@ asmlinkage long sys_sched_getscheduler(pid_t pid) | |||
5482 | * @pid: the pid in question. | 5482 | * @pid: the pid in question. |
5483 | * @param: structure containing the RT priority. | 5483 | * @param: structure containing the RT priority. |
5484 | */ | 5484 | */ |
5485 | asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param __user *param) | 5485 | SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) |
5486 | { | 5486 | { |
5487 | struct sched_param lp; | 5487 | struct sched_param lp; |
5488 | struct task_struct *p; | 5488 | struct task_struct *p; |
@@ -5600,8 +5600,8 @@ static int get_user_cpu_mask(unsigned long __user *user_mask_ptr, unsigned len, | |||
5600 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr | 5600 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr |
5601 | * @user_mask_ptr: user-space pointer to the new cpu mask | 5601 | * @user_mask_ptr: user-space pointer to the new cpu mask |
5602 | */ | 5602 | */ |
5603 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | 5603 | SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len, |
5604 | unsigned long __user *user_mask_ptr) | 5604 | unsigned long __user *, user_mask_ptr) |
5605 | { | 5605 | { |
5606 | cpumask_var_t new_mask; | 5606 | cpumask_var_t new_mask; |
5607 | int retval; | 5607 | int retval; |
@@ -5648,8 +5648,8 @@ out_unlock: | |||
5648 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr | 5648 | * @len: length in bytes of the bitmask pointed to by user_mask_ptr |
5649 | * @user_mask_ptr: user-space pointer to hold the current cpu mask | 5649 | * @user_mask_ptr: user-space pointer to hold the current cpu mask |
5650 | */ | 5650 | */ |
5651 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | 5651 | SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, |
5652 | unsigned long __user *user_mask_ptr) | 5652 | unsigned long __user *, user_mask_ptr) |
5653 | { | 5653 | { |
5654 | int ret; | 5654 | int ret; |
5655 | cpumask_var_t mask; | 5655 | cpumask_var_t mask; |
@@ -5678,7 +5678,7 @@ asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | |||
5678 | * This function yields the current CPU to other tasks. If there are no | 5678 | * This function yields the current CPU to other tasks. If there are no |
5679 | * other threads running on this CPU then this function will return. | 5679 | * other threads running on this CPU then this function will return. |
5680 | */ | 5680 | */ |
5681 | asmlinkage long sys_sched_yield(void) | 5681 | SYSCALL_DEFINE0(sched_yield) |
5682 | { | 5682 | { |
5683 | struct rq *rq = this_rq_lock(); | 5683 | struct rq *rq = this_rq_lock(); |
5684 | 5684 | ||
@@ -5819,7 +5819,7 @@ long __sched io_schedule_timeout(long timeout) | |||
5819 | * this syscall returns the maximum rt_priority that can be used | 5819 | * this syscall returns the maximum rt_priority that can be used |
5820 | * by a given scheduling class. | 5820 | * by a given scheduling class. |
5821 | */ | 5821 | */ |
5822 | asmlinkage long sys_sched_get_priority_max(int policy) | 5822 | SYSCALL_DEFINE1(sched_get_priority_max, int, policy) |
5823 | { | 5823 | { |
5824 | int ret = -EINVAL; | 5824 | int ret = -EINVAL; |
5825 | 5825 | ||
@@ -5844,7 +5844,7 @@ asmlinkage long sys_sched_get_priority_max(int policy) | |||
5844 | * this syscall returns the minimum rt_priority that can be used | 5844 | * this syscall returns the minimum rt_priority that can be used |
5845 | * by a given scheduling class. | 5845 | * by a given scheduling class. |
5846 | */ | 5846 | */ |
5847 | asmlinkage long sys_sched_get_priority_min(int policy) | 5847 | SYSCALL_DEFINE1(sched_get_priority_min, int, policy) |
5848 | { | 5848 | { |
5849 | int ret = -EINVAL; | 5849 | int ret = -EINVAL; |
5850 | 5850 | ||
@@ -5869,8 +5869,8 @@ asmlinkage long sys_sched_get_priority_min(int policy) | |||
5869 | * this syscall writes the default timeslice value of a given process | 5869 | * this syscall writes the default timeslice value of a given process |
5870 | * into the user-space timespec buffer. A value of '0' means infinity. | 5870 | * into the user-space timespec buffer. A value of '0' means infinity. |
5871 | */ | 5871 | */ |
5872 | asmlinkage | 5872 | SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, |
5873 | long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval) | 5873 | struct timespec __user *, interval) |
5874 | { | 5874 | { |
5875 | struct task_struct *p; | 5875 | struct task_struct *p; |
5876 | unsigned int time_slice; | 5876 | unsigned int time_slice; |
diff --git a/kernel/signal.c b/kernel/signal.c index 3152ac3b62e2..e73759783dc8 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1961,7 +1961,7 @@ EXPORT_SYMBOL(unblock_all_signals); | |||
1961 | * System call entry points. | 1961 | * System call entry points. |
1962 | */ | 1962 | */ |
1963 | 1963 | ||
1964 | asmlinkage long sys_restart_syscall(void) | 1964 | SYSCALL_DEFINE0(restart_syscall) |
1965 | { | 1965 | { |
1966 | struct restart_block *restart = ¤t_thread_info()->restart_block; | 1966 | struct restart_block *restart = ¤t_thread_info()->restart_block; |
1967 | return restart->fn(restart); | 1967 | return restart->fn(restart); |
@@ -2014,8 +2014,8 @@ int sigprocmask(int how, sigset_t *set, sigset_t *oldset) | |||
2014 | return error; | 2014 | return error; |
2015 | } | 2015 | } |
2016 | 2016 | ||
2017 | asmlinkage long | 2017 | SYSCALL_DEFINE4(rt_sigprocmask, int, how, sigset_t __user *, set, |
2018 | sys_rt_sigprocmask(int how, sigset_t __user *set, sigset_t __user *oset, size_t sigsetsize) | 2018 | sigset_t __user *, oset, size_t, sigsetsize) |
2019 | { | 2019 | { |
2020 | int error = -EINVAL; | 2020 | int error = -EINVAL; |
2021 | sigset_t old_set, new_set; | 2021 | sigset_t old_set, new_set; |
@@ -2074,8 +2074,7 @@ out: | |||
2074 | return error; | 2074 | return error; |
2075 | } | 2075 | } |
2076 | 2076 | ||
2077 | asmlinkage long | 2077 | SYSCALL_DEFINE2(rt_sigpending, sigset_t __user *, set, size_t, sigsetsize) |
2078 | sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize) | ||
2079 | { | 2078 | { |
2080 | return do_sigpending(set, sigsetsize); | 2079 | return do_sigpending(set, sigsetsize); |
2081 | } | 2080 | } |
@@ -2146,11 +2145,9 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) | |||
2146 | 2145 | ||
2147 | #endif | 2146 | #endif |
2148 | 2147 | ||
2149 | asmlinkage long | 2148 | SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, |
2150 | sys_rt_sigtimedwait(const sigset_t __user *uthese, | 2149 | siginfo_t __user *, uinfo, const struct timespec __user *, uts, |
2151 | siginfo_t __user *uinfo, | 2150 | size_t, sigsetsize) |
2152 | const struct timespec __user *uts, | ||
2153 | size_t sigsetsize) | ||
2154 | { | 2151 | { |
2155 | int ret, sig; | 2152 | int ret, sig; |
2156 | sigset_t these; | 2153 | sigset_t these; |
@@ -2223,8 +2220,7 @@ sys_rt_sigtimedwait(const sigset_t __user *uthese, | |||
2223 | return ret; | 2220 | return ret; |
2224 | } | 2221 | } |
2225 | 2222 | ||
2226 | asmlinkage long | 2223 | SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) |
2227 | sys_kill(pid_t pid, int sig) | ||
2228 | { | 2224 | { |
2229 | struct siginfo info; | 2225 | struct siginfo info; |
2230 | 2226 | ||
@@ -2283,7 +2279,7 @@ static int do_tkill(pid_t tgid, pid_t pid, int sig) | |||
2283 | * exists but it's not belonging to the target process anymore. This | 2279 | * exists but it's not belonging to the target process anymore. This |
2284 | * method solves the problem of threads exiting and PIDs getting reused. | 2280 | * method solves the problem of threads exiting and PIDs getting reused. |
2285 | */ | 2281 | */ |
2286 | asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig) | 2282 | SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid_t, pid, int, sig) |
2287 | { | 2283 | { |
2288 | /* This is only valid for single tasks */ | 2284 | /* This is only valid for single tasks */ |
2289 | if (pid <= 0 || tgid <= 0) | 2285 | if (pid <= 0 || tgid <= 0) |
@@ -2295,8 +2291,7 @@ asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig) | |||
2295 | /* | 2291 | /* |
2296 | * Send a signal to only one task, even if it's a CLONE_THREAD task. | 2292 | * Send a signal to only one task, even if it's a CLONE_THREAD task. |
2297 | */ | 2293 | */ |
2298 | asmlinkage long | 2294 | SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig) |
2299 | sys_tkill(pid_t pid, int sig) | ||
2300 | { | 2295 | { |
2301 | /* This is only valid for single tasks */ | 2296 | /* This is only valid for single tasks */ |
2302 | if (pid <= 0) | 2297 | if (pid <= 0) |
@@ -2305,8 +2300,8 @@ sys_tkill(pid_t pid, int sig) | |||
2305 | return do_tkill(0, pid, sig); | 2300 | return do_tkill(0, pid, sig); |
2306 | } | 2301 | } |
2307 | 2302 | ||
2308 | asmlinkage long | 2303 | SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig, |
2309 | sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo) | 2304 | siginfo_t __user *, uinfo) |
2310 | { | 2305 | { |
2311 | siginfo_t info; | 2306 | siginfo_t info; |
2312 | 2307 | ||
@@ -2434,8 +2429,7 @@ out: | |||
2434 | 2429 | ||
2435 | #ifdef __ARCH_WANT_SYS_SIGPENDING | 2430 | #ifdef __ARCH_WANT_SYS_SIGPENDING |
2436 | 2431 | ||
2437 | asmlinkage long | 2432 | SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set) |
2438 | sys_sigpending(old_sigset_t __user *set) | ||
2439 | { | 2433 | { |
2440 | return do_sigpending(set, sizeof(*set)); | 2434 | return do_sigpending(set, sizeof(*set)); |
2441 | } | 2435 | } |
@@ -2446,8 +2440,8 @@ sys_sigpending(old_sigset_t __user *set) | |||
2446 | /* Some platforms have their own version with special arguments others | 2440 | /* Some platforms have their own version with special arguments others |
2447 | support only sys_rt_sigprocmask. */ | 2441 | support only sys_rt_sigprocmask. */ |
2448 | 2442 | ||
2449 | asmlinkage long | 2443 | SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set, |
2450 | sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset) | 2444 | old_sigset_t __user *, oset) |
2451 | { | 2445 | { |
2452 | int error; | 2446 | int error; |
2453 | old_sigset_t old_set, new_set; | 2447 | old_sigset_t old_set, new_set; |
@@ -2497,11 +2491,10 @@ out: | |||
2497 | #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ | 2491 | #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ |
2498 | 2492 | ||
2499 | #ifdef __ARCH_WANT_SYS_RT_SIGACTION | 2493 | #ifdef __ARCH_WANT_SYS_RT_SIGACTION |
2500 | asmlinkage long | 2494 | SYSCALL_DEFINE4(rt_sigaction, int, sig, |
2501 | sys_rt_sigaction(int sig, | 2495 | const struct sigaction __user *, act, |
2502 | const struct sigaction __user *act, | 2496 | struct sigaction __user *, oact, |
2503 | struct sigaction __user *oact, | 2497 | size_t, sigsetsize) |
2504 | size_t sigsetsize) | ||
2505 | { | 2498 | { |
2506 | struct k_sigaction new_sa, old_sa; | 2499 | struct k_sigaction new_sa, old_sa; |
2507 | int ret = -EINVAL; | 2500 | int ret = -EINVAL; |
@@ -2531,15 +2524,13 @@ out: | |||
2531 | /* | 2524 | /* |
2532 | * For backwards compatibility. Functionality superseded by sigprocmask. | 2525 | * For backwards compatibility. Functionality superseded by sigprocmask. |
2533 | */ | 2526 | */ |
2534 | asmlinkage long | 2527 | SYSCALL_DEFINE0(sgetmask) |
2535 | sys_sgetmask(void) | ||
2536 | { | 2528 | { |
2537 | /* SMP safe */ | 2529 | /* SMP safe */ |
2538 | return current->blocked.sig[0]; | 2530 | return current->blocked.sig[0]; |
2539 | } | 2531 | } |
2540 | 2532 | ||
2541 | asmlinkage long | 2533 | SYSCALL_DEFINE1(ssetmask, int, newmask) |
2542 | sys_ssetmask(int newmask) | ||
2543 | { | 2534 | { |
2544 | int old; | 2535 | int old; |
2545 | 2536 | ||
@@ -2559,8 +2550,7 @@ sys_ssetmask(int newmask) | |||
2559 | /* | 2550 | /* |
2560 | * For backwards compatibility. Functionality superseded by sigaction. | 2551 | * For backwards compatibility. Functionality superseded by sigaction. |
2561 | */ | 2552 | */ |
2562 | asmlinkage unsigned long | 2553 | SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) |
2563 | sys_signal(int sig, __sighandler_t handler) | ||
2564 | { | 2554 | { |
2565 | struct k_sigaction new_sa, old_sa; | 2555 | struct k_sigaction new_sa, old_sa; |
2566 | int ret; | 2556 | int ret; |
@@ -2577,8 +2567,7 @@ sys_signal(int sig, __sighandler_t handler) | |||
2577 | 2567 | ||
2578 | #ifdef __ARCH_WANT_SYS_PAUSE | 2568 | #ifdef __ARCH_WANT_SYS_PAUSE |
2579 | 2569 | ||
2580 | asmlinkage long | 2570 | SYSCALL_DEFINE0(pause) |
2581 | sys_pause(void) | ||
2582 | { | 2571 | { |
2583 | current->state = TASK_INTERRUPTIBLE; | 2572 | current->state = TASK_INTERRUPTIBLE; |
2584 | schedule(); | 2573 | schedule(); |
@@ -2588,7 +2577,7 @@ sys_pause(void) | |||
2588 | #endif | 2577 | #endif |
2589 | 2578 | ||
2590 | #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND | 2579 | #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND |
2591 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) | 2580 | SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize) |
2592 | { | 2581 | { |
2593 | sigset_t newset; | 2582 | sigset_t newset; |
2594 | 2583 | ||
diff --git a/kernel/sys.c b/kernel/sys.c index 763c3c17ded3..e7dc0e10a485 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -143,7 +143,7 @@ out: | |||
143 | return error; | 143 | return error; |
144 | } | 144 | } |
145 | 145 | ||
146 | asmlinkage long sys_setpriority(int which, int who, int niceval) | 146 | SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) |
147 | { | 147 | { |
148 | struct task_struct *g, *p; | 148 | struct task_struct *g, *p; |
149 | struct user_struct *user; | 149 | struct user_struct *user; |
@@ -208,7 +208,7 @@ out: | |||
208 | * has been offset by 20 (ie it returns 40..1 instead of -20..19) | 208 | * has been offset by 20 (ie it returns 40..1 instead of -20..19) |
209 | * to stay compatible. | 209 | * to stay compatible. |
210 | */ | 210 | */ |
211 | asmlinkage long sys_getpriority(int which, int who) | 211 | SYSCALL_DEFINE2(getpriority, int, which, int, who) |
212 | { | 212 | { |
213 | struct task_struct *g, *p; | 213 | struct task_struct *g, *p; |
214 | struct user_struct *user; | 214 | struct user_struct *user; |
@@ -355,7 +355,8 @@ EXPORT_SYMBOL_GPL(kernel_power_off); | |||
355 | * | 355 | * |
356 | * reboot doesn't sync: do that yourself before calling this. | 356 | * reboot doesn't sync: do that yourself before calling this. |
357 | */ | 357 | */ |
358 | asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user * arg) | 358 | SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, |
359 | void __user *, arg) | ||
359 | { | 360 | { |
360 | char buffer[256]; | 361 | char buffer[256]; |
361 | 362 | ||
@@ -478,7 +479,7 @@ void ctrl_alt_del(void) | |||
478 | * SMP: There are not races, the GIDs are checked only by filesystem | 479 | * SMP: There are not races, the GIDs are checked only by filesystem |
479 | * operations (as far as semantic preservation is concerned). | 480 | * operations (as far as semantic preservation is concerned). |
480 | */ | 481 | */ |
481 | asmlinkage long sys_setregid(gid_t rgid, gid_t egid) | 482 | SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid) |
482 | { | 483 | { |
483 | const struct cred *old; | 484 | const struct cred *old; |
484 | struct cred *new; | 485 | struct cred *new; |
@@ -529,7 +530,7 @@ error: | |||
529 | * | 530 | * |
530 | * SMP: Same implicit races as above. | 531 | * SMP: Same implicit races as above. |
531 | */ | 532 | */ |
532 | asmlinkage long sys_setgid(gid_t gid) | 533 | SYSCALL_DEFINE1(setgid, gid_t, gid) |
533 | { | 534 | { |
534 | const struct cred *old; | 535 | const struct cred *old; |
535 | struct cred *new; | 536 | struct cred *new; |
@@ -597,7 +598,7 @@ static int set_user(struct cred *new) | |||
597 | * 100% compatible with BSD. A program which uses just setuid() will be | 598 | * 100% compatible with BSD. A program which uses just setuid() will be |
598 | * 100% compatible with POSIX with saved IDs. | 599 | * 100% compatible with POSIX with saved IDs. |
599 | */ | 600 | */ |
600 | asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) | 601 | SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) |
601 | { | 602 | { |
602 | const struct cred *old; | 603 | const struct cred *old; |
603 | struct cred *new; | 604 | struct cred *new; |
@@ -661,7 +662,7 @@ error: | |||
661 | * will allow a root program to temporarily drop privileges and be able to | 662 | * will allow a root program to temporarily drop privileges and be able to |
662 | * regain them by swapping the real and effective uid. | 663 | * regain them by swapping the real and effective uid. |
663 | */ | 664 | */ |
664 | asmlinkage long sys_setuid(uid_t uid) | 665 | SYSCALL_DEFINE1(setuid, uid_t, uid) |
665 | { | 666 | { |
666 | const struct cred *old; | 667 | const struct cred *old; |
667 | struct cred *new; | 668 | struct cred *new; |
@@ -705,7 +706,7 @@ error: | |||
705 | * This function implements a generic ability to update ruid, euid, | 706 | * This function implements a generic ability to update ruid, euid, |
706 | * and suid. This allows you to implement the 4.4 compatible seteuid(). | 707 | * and suid. This allows you to implement the 4.4 compatible seteuid(). |
707 | */ | 708 | */ |
708 | asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) | 709 | SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) |
709 | { | 710 | { |
710 | const struct cred *old; | 711 | const struct cred *old; |
711 | struct cred *new; | 712 | struct cred *new; |
@@ -756,7 +757,7 @@ error: | |||
756 | return retval; | 757 | return retval; |
757 | } | 758 | } |
758 | 759 | ||
759 | asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid) | 760 | SYSCALL_DEFINE3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid) |
760 | { | 761 | { |
761 | const struct cred *cred = current_cred(); | 762 | const struct cred *cred = current_cred(); |
762 | int retval; | 763 | int retval; |
@@ -771,7 +772,7 @@ asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __us | |||
771 | /* | 772 | /* |
772 | * Same as above, but for rgid, egid, sgid. | 773 | * Same as above, but for rgid, egid, sgid. |
773 | */ | 774 | */ |
774 | asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) | 775 | SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) |
775 | { | 776 | { |
776 | const struct cred *old; | 777 | const struct cred *old; |
777 | struct cred *new; | 778 | struct cred *new; |
@@ -814,7 +815,7 @@ error: | |||
814 | return retval; | 815 | return retval; |
815 | } | 816 | } |
816 | 817 | ||
817 | asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid) | 818 | SYSCALL_DEFINE3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid) |
818 | { | 819 | { |
819 | const struct cred *cred = current_cred(); | 820 | const struct cred *cred = current_cred(); |
820 | int retval; | 821 | int retval; |
@@ -833,7 +834,7 @@ asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __us | |||
833 | * whatever uid it wants to). It normally shadows "euid", except when | 834 | * whatever uid it wants to). It normally shadows "euid", except when |
834 | * explicitly set by setfsuid() or for access.. | 835 | * explicitly set by setfsuid() or for access.. |
835 | */ | 836 | */ |
836 | asmlinkage long sys_setfsuid(uid_t uid) | 837 | SYSCALL_DEFINE1(setfsuid, uid_t, uid) |
837 | { | 838 | { |
838 | const struct cred *old; | 839 | const struct cred *old; |
839 | struct cred *new; | 840 | struct cred *new; |
@@ -870,7 +871,7 @@ change_okay: | |||
870 | /* | 871 | /* |
871 | * Samma på svenska.. | 872 | * Samma på svenska.. |
872 | */ | 873 | */ |
873 | asmlinkage long sys_setfsgid(gid_t gid) | 874 | SYSCALL_DEFINE1(setfsgid, gid_t, gid) |
874 | { | 875 | { |
875 | const struct cred *old; | 876 | const struct cred *old; |
876 | struct cred *new; | 877 | struct cred *new; |
@@ -919,7 +920,7 @@ void do_sys_times(struct tms *tms) | |||
919 | tms->tms_cstime = cputime_to_clock_t(cstime); | 920 | tms->tms_cstime = cputime_to_clock_t(cstime); |
920 | } | 921 | } |
921 | 922 | ||
922 | asmlinkage long sys_times(struct tms __user * tbuf) | 923 | SYSCALL_DEFINE1(times, struct tms __user *, tbuf) |
923 | { | 924 | { |
924 | if (tbuf) { | 925 | if (tbuf) { |
925 | struct tms tmp; | 926 | struct tms tmp; |
@@ -944,7 +945,7 @@ asmlinkage long sys_times(struct tms __user * tbuf) | |||
944 | * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. | 945 | * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. |
945 | * LBT 04.03.94 | 946 | * LBT 04.03.94 |
946 | */ | 947 | */ |
947 | asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) | 948 | SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) |
948 | { | 949 | { |
949 | struct task_struct *p; | 950 | struct task_struct *p; |
950 | struct task_struct *group_leader = current->group_leader; | 951 | struct task_struct *group_leader = current->group_leader; |
@@ -1015,7 +1016,7 @@ out: | |||
1015 | return err; | 1016 | return err; |
1016 | } | 1017 | } |
1017 | 1018 | ||
1018 | asmlinkage long sys_getpgid(pid_t pid) | 1019 | SYSCALL_DEFINE1(getpgid, pid_t, pid) |
1019 | { | 1020 | { |
1020 | struct task_struct *p; | 1021 | struct task_struct *p; |
1021 | struct pid *grp; | 1022 | struct pid *grp; |
@@ -1045,14 +1046,14 @@ out: | |||
1045 | 1046 | ||
1046 | #ifdef __ARCH_WANT_SYS_GETPGRP | 1047 | #ifdef __ARCH_WANT_SYS_GETPGRP |
1047 | 1048 | ||
1048 | asmlinkage long sys_getpgrp(void) | 1049 | SYSCALL_DEFINE0(getpgrp) |
1049 | { | 1050 | { |
1050 | return sys_getpgid(0); | 1051 | return sys_getpgid(0); |
1051 | } | 1052 | } |
1052 | 1053 | ||
1053 | #endif | 1054 | #endif |
1054 | 1055 | ||
1055 | asmlinkage long sys_getsid(pid_t pid) | 1056 | SYSCALL_DEFINE1(getsid, pid_t, pid) |
1056 | { | 1057 | { |
1057 | struct task_struct *p; | 1058 | struct task_struct *p; |
1058 | struct pid *sid; | 1059 | struct pid *sid; |
@@ -1080,7 +1081,7 @@ out: | |||
1080 | return retval; | 1081 | return retval; |
1081 | } | 1082 | } |
1082 | 1083 | ||
1083 | asmlinkage long sys_setsid(void) | 1084 | SYSCALL_DEFINE0(setsid) |
1084 | { | 1085 | { |
1085 | struct task_struct *group_leader = current->group_leader; | 1086 | struct task_struct *group_leader = current->group_leader; |
1086 | struct pid *sid = task_pid(group_leader); | 1087 | struct pid *sid = task_pid(group_leader); |
@@ -1311,7 +1312,7 @@ int set_current_groups(struct group_info *group_info) | |||
1311 | 1312 | ||
1312 | EXPORT_SYMBOL(set_current_groups); | 1313 | EXPORT_SYMBOL(set_current_groups); |
1313 | 1314 | ||
1314 | asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist) | 1315 | SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist) |
1315 | { | 1316 | { |
1316 | const struct cred *cred = current_cred(); | 1317 | const struct cred *cred = current_cred(); |
1317 | int i; | 1318 | int i; |
@@ -1340,7 +1341,7 @@ out: | |||
1340 | * without another task interfering. | 1341 | * without another task interfering. |
1341 | */ | 1342 | */ |
1342 | 1343 | ||
1343 | asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist) | 1344 | SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist) |
1344 | { | 1345 | { |
1345 | struct group_info *group_info; | 1346 | struct group_info *group_info; |
1346 | int retval; | 1347 | int retval; |
@@ -1394,7 +1395,7 @@ EXPORT_SYMBOL(in_egroup_p); | |||
1394 | 1395 | ||
1395 | DECLARE_RWSEM(uts_sem); | 1396 | DECLARE_RWSEM(uts_sem); |
1396 | 1397 | ||
1397 | asmlinkage long sys_newuname(struct new_utsname __user * name) | 1398 | SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) |
1398 | { | 1399 | { |
1399 | int errno = 0; | 1400 | int errno = 0; |
1400 | 1401 | ||
@@ -1405,7 +1406,7 @@ asmlinkage long sys_newuname(struct new_utsname __user * name) | |||
1405 | return errno; | 1406 | return errno; |
1406 | } | 1407 | } |
1407 | 1408 | ||
1408 | asmlinkage long sys_sethostname(char __user *name, int len) | 1409 | SYSCALL_DEFINE2(sethostname, char __user *, name, int, len) |
1409 | { | 1410 | { |
1410 | int errno; | 1411 | int errno; |
1411 | char tmp[__NEW_UTS_LEN]; | 1412 | char tmp[__NEW_UTS_LEN]; |
@@ -1429,7 +1430,7 @@ asmlinkage long sys_sethostname(char __user *name, int len) | |||
1429 | 1430 | ||
1430 | #ifdef __ARCH_WANT_SYS_GETHOSTNAME | 1431 | #ifdef __ARCH_WANT_SYS_GETHOSTNAME |
1431 | 1432 | ||
1432 | asmlinkage long sys_gethostname(char __user *name, int len) | 1433 | SYSCALL_DEFINE2(gethostname, char __user *, name, int, len) |
1433 | { | 1434 | { |
1434 | int i, errno; | 1435 | int i, errno; |
1435 | struct new_utsname *u; | 1436 | struct new_utsname *u; |
@@ -1454,7 +1455,7 @@ asmlinkage long sys_gethostname(char __user *name, int len) | |||
1454 | * Only setdomainname; getdomainname can be implemented by calling | 1455 | * Only setdomainname; getdomainname can be implemented by calling |
1455 | * uname() | 1456 | * uname() |
1456 | */ | 1457 | */ |
1457 | asmlinkage long sys_setdomainname(char __user *name, int len) | 1458 | SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len) |
1458 | { | 1459 | { |
1459 | int errno; | 1460 | int errno; |
1460 | char tmp[__NEW_UTS_LEN]; | 1461 | char tmp[__NEW_UTS_LEN]; |
@@ -1477,7 +1478,7 @@ asmlinkage long sys_setdomainname(char __user *name, int len) | |||
1477 | return errno; | 1478 | return errno; |
1478 | } | 1479 | } |
1479 | 1480 | ||
1480 | asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim) | 1481 | SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim) |
1481 | { | 1482 | { |
1482 | if (resource >= RLIM_NLIMITS) | 1483 | if (resource >= RLIM_NLIMITS) |
1483 | return -EINVAL; | 1484 | return -EINVAL; |
@@ -1496,7 +1497,8 @@ asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim) | |||
1496 | * Back compatibility for getrlimit. Needed for some apps. | 1497 | * Back compatibility for getrlimit. Needed for some apps. |
1497 | */ | 1498 | */ |
1498 | 1499 | ||
1499 | asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim) | 1500 | SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource, |
1501 | struct rlimit __user *, rlim) | ||
1500 | { | 1502 | { |
1501 | struct rlimit x; | 1503 | struct rlimit x; |
1502 | if (resource >= RLIM_NLIMITS) | 1504 | if (resource >= RLIM_NLIMITS) |
@@ -1514,7 +1516,7 @@ asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *r | |||
1514 | 1516 | ||
1515 | #endif | 1517 | #endif |
1516 | 1518 | ||
1517 | asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim) | 1519 | SYSCALL_DEFINE2(setrlimit, unsigned int, resource, struct rlimit __user *, rlim) |
1518 | { | 1520 | { |
1519 | struct rlimit new_rlim, *old_rlim; | 1521 | struct rlimit new_rlim, *old_rlim; |
1520 | int retval; | 1522 | int retval; |
@@ -1687,7 +1689,7 @@ int getrusage(struct task_struct *p, int who, struct rusage __user *ru) | |||
1687 | return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; | 1689 | return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; |
1688 | } | 1690 | } |
1689 | 1691 | ||
1690 | asmlinkage long sys_getrusage(int who, struct rusage __user *ru) | 1692 | SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru) |
1691 | { | 1693 | { |
1692 | if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN && | 1694 | if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN && |
1693 | who != RUSAGE_THREAD) | 1695 | who != RUSAGE_THREAD) |
@@ -1695,14 +1697,14 @@ asmlinkage long sys_getrusage(int who, struct rusage __user *ru) | |||
1695 | return getrusage(current, who, ru); | 1697 | return getrusage(current, who, ru); |
1696 | } | 1698 | } |
1697 | 1699 | ||
1698 | asmlinkage long sys_umask(int mask) | 1700 | SYSCALL_DEFINE1(umask, int, mask) |
1699 | { | 1701 | { |
1700 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); | 1702 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); |
1701 | return mask; | 1703 | return mask; |
1702 | } | 1704 | } |
1703 | 1705 | ||
1704 | asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | 1706 | SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, |
1705 | unsigned long arg4, unsigned long arg5) | 1707 | unsigned long, arg4, unsigned long, arg5) |
1706 | { | 1708 | { |
1707 | struct task_struct *me = current; | 1709 | struct task_struct *me = current; |
1708 | unsigned char comm[sizeof(me->comm)]; | 1710 | unsigned char comm[sizeof(me->comm)]; |
@@ -1815,8 +1817,8 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
1815 | return error; | 1817 | return error; |
1816 | } | 1818 | } |
1817 | 1819 | ||
1818 | asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep, | 1820 | SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep, |
1819 | struct getcpu_cache __user *unused) | 1821 | struct getcpu_cache __user *, unused) |
1820 | { | 1822 | { |
1821 | int err = 0; | 1823 | int err = 0; |
1822 | int cpu = raw_smp_processor_id(); | 1824 | int cpu = raw_smp_processor_id(); |
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index e14a23281707..27dad2967387 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -131,6 +131,7 @@ cond_syscall(sys_io_destroy); | |||
131 | cond_syscall(sys_io_submit); | 131 | cond_syscall(sys_io_submit); |
132 | cond_syscall(sys_io_cancel); | 132 | cond_syscall(sys_io_cancel); |
133 | cond_syscall(sys_io_getevents); | 133 | cond_syscall(sys_io_getevents); |
134 | cond_syscall(sys_syslog); | ||
134 | 135 | ||
135 | /* arch-specific weak syscall entries */ | 136 | /* arch-specific weak syscall entries */ |
136 | cond_syscall(sys_pciconfig_read); | 137 | cond_syscall(sys_pciconfig_read); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 89d74436318c..3e38b74b6124 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -1688,7 +1688,7 @@ int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *ol | |||
1688 | return error; | 1688 | return error; |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | asmlinkage long sys_sysctl(struct __sysctl_args __user *args) | 1691 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) |
1692 | { | 1692 | { |
1693 | struct __sysctl_args tmp; | 1693 | struct __sysctl_args tmp; |
1694 | int error; | 1694 | int error; |
@@ -2989,7 +2989,7 @@ int sysctl_ms_jiffies(struct ctl_table *table, | |||
2989 | #else /* CONFIG_SYSCTL_SYSCALL */ | 2989 | #else /* CONFIG_SYSCTL_SYSCALL */ |
2990 | 2990 | ||
2991 | 2991 | ||
2992 | asmlinkage long sys_sysctl(struct __sysctl_args __user *args) | 2992 | SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) |
2993 | { | 2993 | { |
2994 | struct __sysctl_args tmp; | 2994 | struct __sysctl_args tmp; |
2995 | int error; | 2995 | int error; |
diff --git a/kernel/time.c b/kernel/time.c index 4886e3ce83a4..29511943871a 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
@@ -60,7 +60,7 @@ EXPORT_SYMBOL(sys_tz); | |||
60 | * why not move it into the appropriate arch directory (for those | 60 | * why not move it into the appropriate arch directory (for those |
61 | * architectures that need it). | 61 | * architectures that need it). |
62 | */ | 62 | */ |
63 | asmlinkage long sys_time(time_t __user * tloc) | 63 | SYSCALL_DEFINE1(time, time_t __user *, tloc) |
64 | { | 64 | { |
65 | time_t i = get_seconds(); | 65 | time_t i = get_seconds(); |
66 | 66 | ||
@@ -79,7 +79,7 @@ asmlinkage long sys_time(time_t __user * tloc) | |||
79 | * architectures that need it). | 79 | * architectures that need it). |
80 | */ | 80 | */ |
81 | 81 | ||
82 | asmlinkage long sys_stime(time_t __user *tptr) | 82 | SYSCALL_DEFINE1(stime, time_t __user *, tptr) |
83 | { | 83 | { |
84 | struct timespec tv; | 84 | struct timespec tv; |
85 | int err; | 85 | int err; |
@@ -99,8 +99,8 @@ asmlinkage long sys_stime(time_t __user *tptr) | |||
99 | 99 | ||
100 | #endif /* __ARCH_WANT_SYS_TIME */ | 100 | #endif /* __ARCH_WANT_SYS_TIME */ |
101 | 101 | ||
102 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, | 102 | SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv, |
103 | struct timezone __user *tz) | 103 | struct timezone __user *, tz) |
104 | { | 104 | { |
105 | if (likely(tv != NULL)) { | 105 | if (likely(tv != NULL)) { |
106 | struct timeval ktv; | 106 | struct timeval ktv; |
@@ -184,8 +184,8 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) | |||
184 | return 0; | 184 | return 0; |
185 | } | 185 | } |
186 | 186 | ||
187 | asmlinkage long sys_settimeofday(struct timeval __user *tv, | 187 | SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv, |
188 | struct timezone __user *tz) | 188 | struct timezone __user *, tz) |
189 | { | 189 | { |
190 | struct timeval user_tv; | 190 | struct timeval user_tv; |
191 | struct timespec new_ts; | 191 | struct timespec new_ts; |
@@ -205,7 +205,7 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv, | |||
205 | return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL); | 205 | return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL); |
206 | } | 206 | } |
207 | 207 | ||
208 | asmlinkage long sys_adjtimex(struct timex __user *txc_p) | 208 | SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) |
209 | { | 209 | { |
210 | struct timex txc; /* Local copy of parameter */ | 210 | struct timex txc; /* Local copy of parameter */ |
211 | int ret; | 211 | int ret; |
diff --git a/kernel/timer.c b/kernel/timer.c index dee3f641a7a7..13dd64fe143d 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1129,7 +1129,7 @@ void do_timer(unsigned long ticks) | |||
1129 | * For backwards compatibility? This can be done in libc so Alpha | 1129 | * For backwards compatibility? This can be done in libc so Alpha |
1130 | * and all newer ports shouldn't need it. | 1130 | * and all newer ports shouldn't need it. |
1131 | */ | 1131 | */ |
1132 | asmlinkage unsigned long sys_alarm(unsigned int seconds) | 1132 | SYSCALL_DEFINE1(alarm, unsigned int, seconds) |
1133 | { | 1133 | { |
1134 | return alarm_setitimer(seconds); | 1134 | return alarm_setitimer(seconds); |
1135 | } | 1135 | } |
@@ -1152,7 +1152,7 @@ asmlinkage unsigned long sys_alarm(unsigned int seconds) | |||
1152 | * | 1152 | * |
1153 | * This is SMP safe as current->tgid does not change. | 1153 | * This is SMP safe as current->tgid does not change. |
1154 | */ | 1154 | */ |
1155 | asmlinkage long sys_getpid(void) | 1155 | SYSCALL_DEFINE0(getpid) |
1156 | { | 1156 | { |
1157 | return task_tgid_vnr(current); | 1157 | return task_tgid_vnr(current); |
1158 | } | 1158 | } |
@@ -1163,7 +1163,7 @@ asmlinkage long sys_getpid(void) | |||
1163 | * value of ->real_parent under rcu_read_lock(), see | 1163 | * value of ->real_parent under rcu_read_lock(), see |
1164 | * release_task()->call_rcu(delayed_put_task_struct). | 1164 | * release_task()->call_rcu(delayed_put_task_struct). |
1165 | */ | 1165 | */ |
1166 | asmlinkage long sys_getppid(void) | 1166 | SYSCALL_DEFINE0(getppid) |
1167 | { | 1167 | { |
1168 | int pid; | 1168 | int pid; |
1169 | 1169 | ||
@@ -1174,25 +1174,25 @@ asmlinkage long sys_getppid(void) | |||
1174 | return pid; | 1174 | return pid; |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | asmlinkage long sys_getuid(void) | 1177 | SYSCALL_DEFINE0(getuid) |
1178 | { | 1178 | { |
1179 | /* Only we change this so SMP safe */ | 1179 | /* Only we change this so SMP safe */ |
1180 | return current_uid(); | 1180 | return current_uid(); |
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | asmlinkage long sys_geteuid(void) | 1183 | SYSCALL_DEFINE0(geteuid) |
1184 | { | 1184 | { |
1185 | /* Only we change this so SMP safe */ | 1185 | /* Only we change this so SMP safe */ |
1186 | return current_euid(); | 1186 | return current_euid(); |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | asmlinkage long sys_getgid(void) | 1189 | SYSCALL_DEFINE0(getgid) |
1190 | { | 1190 | { |
1191 | /* Only we change this so SMP safe */ | 1191 | /* Only we change this so SMP safe */ |
1192 | return current_gid(); | 1192 | return current_gid(); |
1193 | } | 1193 | } |
1194 | 1194 | ||
1195 | asmlinkage long sys_getegid(void) | 1195 | SYSCALL_DEFINE0(getegid) |
1196 | { | 1196 | { |
1197 | /* Only we change this so SMP safe */ | 1197 | /* Only we change this so SMP safe */ |
1198 | return current_egid(); | 1198 | return current_egid(); |
@@ -1308,7 +1308,7 @@ signed long __sched schedule_timeout_uninterruptible(signed long timeout) | |||
1308 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); | 1308 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); |
1309 | 1309 | ||
1310 | /* Thread ID - the internal kernel "pid" */ | 1310 | /* Thread ID - the internal kernel "pid" */ |
1311 | asmlinkage long sys_gettid(void) | 1311 | SYSCALL_DEFINE0(gettid) |
1312 | { | 1312 | { |
1313 | return task_pid_vnr(current); | 1313 | return task_pid_vnr(current); |
1314 | } | 1314 | } |
@@ -1400,7 +1400,7 @@ out: | |||
1400 | return 0; | 1400 | return 0; |
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | asmlinkage long sys_sysinfo(struct sysinfo __user *info) | 1403 | SYSCALL_DEFINE1(sysinfo, struct sysinfo __user *, info) |
1404 | { | 1404 | { |
1405 | struct sysinfo val; | 1405 | struct sysinfo val; |
1406 | 1406 | ||
diff --git a/kernel/uid16.c b/kernel/uid16.c index 2460c3199b5a..0314501688b9 100644 --- a/kernel/uid16.c +++ b/kernel/uid16.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
19 | 19 | ||
20 | asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group) | 20 | SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) |
21 | { | 21 | { |
22 | long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); | 22 | long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); |
23 | /* avoid REGPARM breakage on x86: */ | 23 | /* avoid REGPARM breakage on x86: */ |
@@ -25,7 +25,7 @@ asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gi | |||
25 | return ret; | 25 | return ret; |
26 | } | 26 | } |
27 | 27 | ||
28 | asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group) | 28 | SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) |
29 | { | 29 | { |
30 | long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); | 30 | long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); |
31 | /* avoid REGPARM breakage on x86: */ | 31 | /* avoid REGPARM breakage on x86: */ |
@@ -33,7 +33,7 @@ asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_g | |||
33 | return ret; | 33 | return ret; |
34 | } | 34 | } |
35 | 35 | ||
36 | asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) | 36 | SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group) |
37 | { | 37 | { |
38 | long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); | 38 | long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); |
39 | /* avoid REGPARM breakage on x86: */ | 39 | /* avoid REGPARM breakage on x86: */ |
@@ -41,7 +41,7 @@ asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) | |||
41 | return ret; | 41 | return ret; |
42 | } | 42 | } |
43 | 43 | ||
44 | asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) | 44 | SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid) |
45 | { | 45 | { |
46 | long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); | 46 | long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); |
47 | /* avoid REGPARM breakage on x86: */ | 47 | /* avoid REGPARM breakage on x86: */ |
@@ -49,7 +49,7 @@ asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) | |||
49 | return ret; | 49 | return ret; |
50 | } | 50 | } |
51 | 51 | ||
52 | asmlinkage long sys_setgid16(old_gid_t gid) | 52 | SYSCALL_DEFINE1(setgid16, old_gid_t, gid) |
53 | { | 53 | { |
54 | long ret = sys_setgid(low2highgid(gid)); | 54 | long ret = sys_setgid(low2highgid(gid)); |
55 | /* avoid REGPARM breakage on x86: */ | 55 | /* avoid REGPARM breakage on x86: */ |
@@ -57,7 +57,7 @@ asmlinkage long sys_setgid16(old_gid_t gid) | |||
57 | return ret; | 57 | return ret; |
58 | } | 58 | } |
59 | 59 | ||
60 | asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) | 60 | SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid) |
61 | { | 61 | { |
62 | long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); | 62 | long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); |
63 | /* avoid REGPARM breakage on x86: */ | 63 | /* avoid REGPARM breakage on x86: */ |
@@ -65,7 +65,7 @@ asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) | |||
65 | return ret; | 65 | return ret; |
66 | } | 66 | } |
67 | 67 | ||
68 | asmlinkage long sys_setuid16(old_uid_t uid) | 68 | SYSCALL_DEFINE1(setuid16, old_uid_t, uid) |
69 | { | 69 | { |
70 | long ret = sys_setuid(low2highuid(uid)); | 70 | long ret = sys_setuid(low2highuid(uid)); |
71 | /* avoid REGPARM breakage on x86: */ | 71 | /* avoid REGPARM breakage on x86: */ |
@@ -73,7 +73,7 @@ asmlinkage long sys_setuid16(old_uid_t uid) | |||
73 | return ret; | 73 | return ret; |
74 | } | 74 | } |
75 | 75 | ||
76 | asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) | 76 | SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid) |
77 | { | 77 | { |
78 | long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), | 78 | long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), |
79 | low2highuid(suid)); | 79 | low2highuid(suid)); |
@@ -82,7 +82,7 @@ asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) | |||
82 | return ret; | 82 | return ret; |
83 | } | 83 | } |
84 | 84 | ||
85 | asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid) | 85 | SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruid, old_uid_t __user *, euid, old_uid_t __user *, suid) |
86 | { | 86 | { |
87 | const struct cred *cred = current_cred(); | 87 | const struct cred *cred = current_cred(); |
88 | int retval; | 88 | int retval; |
@@ -94,7 +94,7 @@ asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, | |||
94 | return retval; | 94 | return retval; |
95 | } | 95 | } |
96 | 96 | ||
97 | asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) | 97 | SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid) |
98 | { | 98 | { |
99 | long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), | 99 | long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), |
100 | low2highgid(sgid)); | 100 | low2highgid(sgid)); |
@@ -103,7 +103,8 @@ asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) | |||
103 | return ret; | 103 | return ret; |
104 | } | 104 | } |
105 | 105 | ||
106 | asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid) | 106 | |
107 | SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgid, old_gid_t __user *, egid, old_gid_t __user *, sgid) | ||
107 | { | 108 | { |
108 | const struct cred *cred = current_cred(); | 109 | const struct cred *cred = current_cred(); |
109 | int retval; | 110 | int retval; |
@@ -115,7 +116,7 @@ asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, | |||
115 | return retval; | 116 | return retval; |
116 | } | 117 | } |
117 | 118 | ||
118 | asmlinkage long sys_setfsuid16(old_uid_t uid) | 119 | SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid) |
119 | { | 120 | { |
120 | long ret = sys_setfsuid(low2highuid(uid)); | 121 | long ret = sys_setfsuid(low2highuid(uid)); |
121 | /* avoid REGPARM breakage on x86: */ | 122 | /* avoid REGPARM breakage on x86: */ |
@@ -123,7 +124,7 @@ asmlinkage long sys_setfsuid16(old_uid_t uid) | |||
123 | return ret; | 124 | return ret; |
124 | } | 125 | } |
125 | 126 | ||
126 | asmlinkage long sys_setfsgid16(old_gid_t gid) | 127 | SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid) |
127 | { | 128 | { |
128 | long ret = sys_setfsgid(low2highgid(gid)); | 129 | long ret = sys_setfsgid(low2highgid(gid)); |
129 | /* avoid REGPARM breakage on x86: */ | 130 | /* avoid REGPARM breakage on x86: */ |
@@ -161,7 +162,7 @@ static int groups16_from_user(struct group_info *group_info, | |||
161 | return 0; | 162 | return 0; |
162 | } | 163 | } |
163 | 164 | ||
164 | asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist) | 165 | SYSCALL_DEFINE2(getgroups16, int, gidsetsize, old_gid_t __user *, grouplist) |
165 | { | 166 | { |
166 | const struct cred *cred = current_cred(); | 167 | const struct cred *cred = current_cred(); |
167 | int i; | 168 | int i; |
@@ -184,7 +185,7 @@ out: | |||
184 | return i; | 185 | return i; |
185 | } | 186 | } |
186 | 187 | ||
187 | asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist) | 188 | SYSCALL_DEFINE2(setgroups16, int, gidsetsize, old_gid_t __user *, grouplist) |
188 | { | 189 | { |
189 | struct group_info *group_info; | 190 | struct group_info *group_info; |
190 | int retval; | 191 | int retval; |
@@ -209,22 +210,22 @@ asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist) | |||
209 | return retval; | 210 | return retval; |
210 | } | 211 | } |
211 | 212 | ||
212 | asmlinkage long sys_getuid16(void) | 213 | SYSCALL_DEFINE0(getuid16) |
213 | { | 214 | { |
214 | return high2lowuid(current_uid()); | 215 | return high2lowuid(current_uid()); |
215 | } | 216 | } |
216 | 217 | ||
217 | asmlinkage long sys_geteuid16(void) | 218 | SYSCALL_DEFINE0(geteuid16) |
218 | { | 219 | { |
219 | return high2lowuid(current_euid()); | 220 | return high2lowuid(current_euid()); |
220 | } | 221 | } |
221 | 222 | ||
222 | asmlinkage long sys_getgid16(void) | 223 | SYSCALL_DEFINE0(getgid16) |
223 | { | 224 | { |
224 | return high2lowgid(current_gid()); | 225 | return high2lowgid(current_gid()); |
225 | } | 226 | } |
226 | 227 | ||
227 | asmlinkage long sys_getegid16(void) | 228 | SYSCALL_DEFINE0(getegid16) |
228 | { | 229 | { |
229 | return high2lowgid(current_egid()); | 230 | return high2lowgid(current_egid()); |
230 | } | 231 | } |
diff --git a/kernel/up.c b/kernel/up.c index c04b9dcfcebe..1ff27a28bb7d 100644 --- a/kernel/up.c +++ b/kernel/up.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * Uniprocessor-only support functions. The counterpart to kernel/smp.c | 2 | * Uniprocessor-only support functions. The counterpart to kernel/smp.c |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/interrupt.h> | ||
5 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
6 | #include <linux/module.h> | 7 | #include <linux/module.h> |
7 | #include <linux/smp.h> | 8 | #include <linux/smp.h> |
diff --git a/mm/fadvise.c b/mm/fadvise.c index a1da969bd980..54a0f8040afa 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c | |||
@@ -24,7 +24,7 @@ | |||
24 | * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could | 24 | * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could |
25 | * deactivate the pages and clear PG_Referenced. | 25 | * deactivate the pages and clear PG_Referenced. |
26 | */ | 26 | */ |
27 | asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice) | 27 | SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) |
28 | { | 28 | { |
29 | struct file *file = fget(fd); | 29 | struct file *file = fget(fd); |
30 | struct address_space *mapping; | 30 | struct address_space *mapping; |
@@ -126,12 +126,26 @@ out: | |||
126 | fput(file); | 126 | fput(file); |
127 | return ret; | 127 | return ret; |
128 | } | 128 | } |
129 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
130 | asmlinkage long SyS_fadvise64_64(long fd, loff_t offset, loff_t len, long advice) | ||
131 | { | ||
132 | return SYSC_fadvise64_64((int) fd, offset, len, (int) advice); | ||
133 | } | ||
134 | SYSCALL_ALIAS(sys_fadvise64_64, SyS_fadvise64_64); | ||
135 | #endif | ||
129 | 136 | ||
130 | #ifdef __ARCH_WANT_SYS_FADVISE64 | 137 | #ifdef __ARCH_WANT_SYS_FADVISE64 |
131 | 138 | ||
132 | asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice) | 139 | SYSCALL_DEFINE(fadvise64)(int fd, loff_t offset, size_t len, int advice) |
133 | { | 140 | { |
134 | return sys_fadvise64_64(fd, offset, len, advice); | 141 | return sys_fadvise64_64(fd, offset, len, advice); |
135 | } | 142 | } |
143 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
144 | asmlinkage long SyS_fadvise64(long fd, loff_t offset, long len, long advice) | ||
145 | { | ||
146 | return SYSC_fadvise64((int) fd, offset, (size_t)len, (int)advice); | ||
147 | } | ||
148 | SYSCALL_ALIAS(sys_fadvise64, SyS_fadvise64); | ||
149 | #endif | ||
136 | 150 | ||
137 | #endif | 151 | #endif |
diff --git a/mm/filemap.c b/mm/filemap.c index ceba0bd03662..23acefe51808 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -1374,7 +1374,7 @@ do_readahead(struct address_space *mapping, struct file *filp, | |||
1374 | return 0; | 1374 | return 0; |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count) | 1377 | SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) |
1378 | { | 1378 | { |
1379 | ssize_t ret; | 1379 | ssize_t ret; |
1380 | struct file *file; | 1380 | struct file *file; |
@@ -1393,6 +1393,13 @@ asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count) | |||
1393 | } | 1393 | } |
1394 | return ret; | 1394 | return ret; |
1395 | } | 1395 | } |
1396 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
1397 | asmlinkage long SyS_readahead(long fd, loff_t offset, long count) | ||
1398 | { | ||
1399 | return SYSC_readahead((int) fd, offset, (size_t) count); | ||
1400 | } | ||
1401 | SYSCALL_ALIAS(sys_readahead, SyS_readahead); | ||
1402 | #endif | ||
1396 | 1403 | ||
1397 | #ifdef CONFIG_MMU | 1404 | #ifdef CONFIG_MMU |
1398 | /** | 1405 | /** |
diff --git a/mm/fremap.c b/mm/fremap.c index 62d5bbda921a..736ba7f3306a 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -120,8 +120,8 @@ static int populate_range(struct mm_struct *mm, struct vm_area_struct *vma, | |||
120 | * and the vma's default protection is used. Arbitrary protections | 120 | * and the vma's default protection is used. Arbitrary protections |
121 | * might be implemented in the future. | 121 | * might be implemented in the future. |
122 | */ | 122 | */ |
123 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, | 123 | SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, |
124 | unsigned long prot, unsigned long pgoff, unsigned long flags) | 124 | unsigned long, prot, unsigned long, pgoff, unsigned long, flags) |
125 | { | 125 | { |
126 | struct mm_struct *mm = current->mm; | 126 | struct mm_struct *mm = current->mm; |
127 | struct address_space *mapping; | 127 | struct address_space *mapping; |
diff --git a/mm/madvise.c b/mm/madvise.c index f9349c18a1b5..b9ce574827c8 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -281,7 +281,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev, | |||
281 | * -EBADF - map exists, but area maps something that isn't a file. | 281 | * -EBADF - map exists, but area maps something that isn't a file. |
282 | * -EAGAIN - a kernel resource was temporarily unavailable. | 282 | * -EAGAIN - a kernel resource was temporarily unavailable. |
283 | */ | 283 | */ |
284 | asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior) | 284 | SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) |
285 | { | 285 | { |
286 | unsigned long end, tmp; | 286 | unsigned long end, tmp; |
287 | struct vm_area_struct * vma, *prev; | 287 | struct vm_area_struct * vma, *prev; |
diff --git a/mm/memory.c b/mm/memory.c index e009ce870859..22bfa7a47a0b 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1511,6 +1511,7 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
1511 | unsigned long pfn) | 1511 | unsigned long pfn) |
1512 | { | 1512 | { |
1513 | int ret; | 1513 | int ret; |
1514 | pgprot_t pgprot = vma->vm_page_prot; | ||
1514 | /* | 1515 | /* |
1515 | * Technically, architectures with pte_special can avoid all these | 1516 | * Technically, architectures with pte_special can avoid all these |
1516 | * restrictions (same for remap_pfn_range). However we would like | 1517 | * restrictions (same for remap_pfn_range). However we would like |
@@ -1525,10 +1526,10 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
1525 | 1526 | ||
1526 | if (addr < vma->vm_start || addr >= vma->vm_end) | 1527 | if (addr < vma->vm_start || addr >= vma->vm_end) |
1527 | return -EFAULT; | 1528 | return -EFAULT; |
1528 | if (track_pfn_vma_new(vma, vma->vm_page_prot, pfn, PAGE_SIZE)) | 1529 | if (track_pfn_vma_new(vma, &pgprot, pfn, PAGE_SIZE)) |
1529 | return -EINVAL; | 1530 | return -EINVAL; |
1530 | 1531 | ||
1531 | ret = insert_pfn(vma, addr, pfn, vma->vm_page_prot); | 1532 | ret = insert_pfn(vma, addr, pfn, pgprot); |
1532 | 1533 | ||
1533 | if (ret) | 1534 | if (ret) |
1534 | untrack_pfn_vma(vma, pfn, PAGE_SIZE); | 1535 | untrack_pfn_vma(vma, pfn, PAGE_SIZE); |
@@ -1671,9 +1672,15 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, | |||
1671 | 1672 | ||
1672 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; | 1673 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; |
1673 | 1674 | ||
1674 | err = track_pfn_vma_new(vma, prot, pfn, PAGE_ALIGN(size)); | 1675 | err = track_pfn_vma_new(vma, &prot, pfn, PAGE_ALIGN(size)); |
1675 | if (err) | 1676 | if (err) { |
1677 | /* | ||
1678 | * To indicate that track_pfn related cleanup is not | ||
1679 | * needed from higher level routine calling unmap_vmas | ||
1680 | */ | ||
1681 | vma->vm_flags &= ~(VM_IO | VM_RESERVED | VM_PFNMAP); | ||
1676 | return -EINVAL; | 1682 | return -EINVAL; |
1683 | } | ||
1677 | 1684 | ||
1678 | BUG_ON(addr >= end); | 1685 | BUG_ON(addr >= end); |
1679 | pfn -= addr >> PAGE_SHIFT; | 1686 | pfn -= addr >> PAGE_SHIFT; |
@@ -3165,6 +3172,15 @@ void print_vma_addr(char *prefix, unsigned long ip) | |||
3165 | #ifdef CONFIG_PROVE_LOCKING | 3172 | #ifdef CONFIG_PROVE_LOCKING |
3166 | void might_fault(void) | 3173 | void might_fault(void) |
3167 | { | 3174 | { |
3175 | /* | ||
3176 | * Some code (nfs/sunrpc) uses socket ops on kernel memory while | ||
3177 | * holding the mmap_sem, this is safe because kernel memory doesn't | ||
3178 | * get paged out, therefore we'll never actually fault, and the | ||
3179 | * below annotations will generate false positives. | ||
3180 | */ | ||
3181 | if (segment_eq(get_fs(), KERNEL_DS)) | ||
3182 | return; | ||
3183 | |||
3168 | might_sleep(); | 3184 | might_sleep(); |
3169 | /* | 3185 | /* |
3170 | * it would be nicer only to annotate paths which are not under | 3186 | * it would be nicer only to annotate paths which are not under |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index e412ffa8e52e..3eb4a6fdc043 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1068,10 +1068,9 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode, | |||
1068 | return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0; | 1068 | return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0; |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, | 1071 | SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len, |
1072 | unsigned long mode, | 1072 | unsigned long, mode, unsigned long __user *, nmask, |
1073 | unsigned long __user *nmask, unsigned long maxnode, | 1073 | unsigned long, maxnode, unsigned, flags) |
1074 | unsigned flags) | ||
1075 | { | 1074 | { |
1076 | nodemask_t nodes; | 1075 | nodemask_t nodes; |
1077 | int err; | 1076 | int err; |
@@ -1091,8 +1090,8 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len, | |||
1091 | } | 1090 | } |
1092 | 1091 | ||
1093 | /* Set the process memory policy */ | 1092 | /* Set the process memory policy */ |
1094 | asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | 1093 | SYSCALL_DEFINE3(set_mempolicy, int, mode, unsigned long __user *, nmask, |
1095 | unsigned long maxnode) | 1094 | unsigned long, maxnode) |
1096 | { | 1095 | { |
1097 | int err; | 1096 | int err; |
1098 | nodemask_t nodes; | 1097 | nodemask_t nodes; |
@@ -1110,9 +1109,9 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | |||
1110 | return do_set_mempolicy(mode, flags, &nodes); | 1109 | return do_set_mempolicy(mode, flags, &nodes); |
1111 | } | 1110 | } |
1112 | 1111 | ||
1113 | asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, | 1112 | SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, |
1114 | const unsigned long __user *old_nodes, | 1113 | const unsigned long __user *, old_nodes, |
1115 | const unsigned long __user *new_nodes) | 1114 | const unsigned long __user *, new_nodes) |
1116 | { | 1115 | { |
1117 | const struct cred *cred = current_cred(), *tcred; | 1116 | const struct cred *cred = current_cred(), *tcred; |
1118 | struct mm_struct *mm; | 1117 | struct mm_struct *mm; |
@@ -1185,10 +1184,9 @@ out: | |||
1185 | 1184 | ||
1186 | 1185 | ||
1187 | /* Retrieve NUMA policy */ | 1186 | /* Retrieve NUMA policy */ |
1188 | asmlinkage long sys_get_mempolicy(int __user *policy, | 1187 | SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, |
1189 | unsigned long __user *nmask, | 1188 | unsigned long __user *, nmask, unsigned long, maxnode, |
1190 | unsigned long maxnode, | 1189 | unsigned long, addr, unsigned long, flags) |
1191 | unsigned long addr, unsigned long flags) | ||
1192 | { | 1190 | { |
1193 | int err; | 1191 | int err; |
1194 | int uninitialized_var(pval); | 1192 | int uninitialized_var(pval); |
diff --git a/mm/migrate.c b/mm/migrate.c index a30ea5fcf9f1..2bb4e1d63520 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -1055,10 +1055,10 @@ out: | |||
1055 | * Move a list of pages in the address space of the currently executing | 1055 | * Move a list of pages in the address space of the currently executing |
1056 | * process. | 1056 | * process. |
1057 | */ | 1057 | */ |
1058 | asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, | 1058 | SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, |
1059 | const void __user * __user *pages, | 1059 | const void __user * __user *, pages, |
1060 | const int __user *nodes, | 1060 | const int __user *, nodes, |
1061 | int __user *status, int flags) | 1061 | int __user *, status, int, flags) |
1062 | { | 1062 | { |
1063 | const struct cred *cred = current_cred(), *tcred; | 1063 | const struct cred *cred = current_cred(), *tcred; |
1064 | struct task_struct *task; | 1064 | struct task_struct *task; |
diff --git a/mm/mincore.c b/mm/mincore.c index 5178800bc129..8cb508f84ea4 100644 --- a/mm/mincore.c +++ b/mm/mincore.c | |||
@@ -177,8 +177,8 @@ none_mapped: | |||
177 | * mapped | 177 | * mapped |
178 | * -EAGAIN - A kernel resource was temporarily unavailable. | 178 | * -EAGAIN - A kernel resource was temporarily unavailable. |
179 | */ | 179 | */ |
180 | asmlinkage long sys_mincore(unsigned long start, size_t len, | 180 | SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len, |
181 | unsigned char __user * vec) | 181 | unsigned char __user *, vec) |
182 | { | 182 | { |
183 | long retval; | 183 | long retval; |
184 | unsigned long pages; | 184 | unsigned long pages; |
diff --git a/mm/mlock.c b/mm/mlock.c index e125156c664e..2904a347e476 100644 --- a/mm/mlock.c +++ b/mm/mlock.c | |||
@@ -530,7 +530,7 @@ static int do_mlock(unsigned long start, size_t len, int on) | |||
530 | return error; | 530 | return error; |
531 | } | 531 | } |
532 | 532 | ||
533 | asmlinkage long sys_mlock(unsigned long start, size_t len) | 533 | SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) |
534 | { | 534 | { |
535 | unsigned long locked; | 535 | unsigned long locked; |
536 | unsigned long lock_limit; | 536 | unsigned long lock_limit; |
@@ -558,7 +558,7 @@ asmlinkage long sys_mlock(unsigned long start, size_t len) | |||
558 | return error; | 558 | return error; |
559 | } | 559 | } |
560 | 560 | ||
561 | asmlinkage long sys_munlock(unsigned long start, size_t len) | 561 | SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) |
562 | { | 562 | { |
563 | int ret; | 563 | int ret; |
564 | 564 | ||
@@ -595,7 +595,7 @@ out: | |||
595 | return 0; | 595 | return 0; |
596 | } | 596 | } |
597 | 597 | ||
598 | asmlinkage long sys_mlockall(int flags) | 598 | SYSCALL_DEFINE1(mlockall, int, flags) |
599 | { | 599 | { |
600 | unsigned long lock_limit; | 600 | unsigned long lock_limit; |
601 | int ret = -EINVAL; | 601 | int ret = -EINVAL; |
@@ -623,7 +623,7 @@ out: | |||
623 | return ret; | 623 | return ret; |
624 | } | 624 | } |
625 | 625 | ||
626 | asmlinkage long sys_munlockall(void) | 626 | SYSCALL_DEFINE0(munlockall) |
627 | { | 627 | { |
628 | int ret; | 628 | int ret; |
629 | 629 | ||
@@ -245,7 +245,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) | |||
245 | return next; | 245 | return next; |
246 | } | 246 | } |
247 | 247 | ||
248 | asmlinkage unsigned long sys_brk(unsigned long brk) | 248 | SYSCALL_DEFINE1(brk, unsigned long, brk) |
249 | { | 249 | { |
250 | unsigned long rlim, retval; | 250 | unsigned long rlim, retval; |
251 | unsigned long newbrk, oldbrk; | 251 | unsigned long newbrk, oldbrk; |
@@ -1948,7 +1948,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) | |||
1948 | 1948 | ||
1949 | EXPORT_SYMBOL(do_munmap); | 1949 | EXPORT_SYMBOL(do_munmap); |
1950 | 1950 | ||
1951 | asmlinkage long sys_munmap(unsigned long addr, size_t len) | 1951 | SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) |
1952 | { | 1952 | { |
1953 | int ret; | 1953 | int ret; |
1954 | struct mm_struct *mm = current->mm; | 1954 | struct mm_struct *mm = current->mm; |
diff --git a/mm/mprotect.c b/mm/mprotect.c index d0f6e7ce09f1..abe2694e13f4 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
@@ -217,8 +217,8 @@ fail: | |||
217 | return error; | 217 | return error; |
218 | } | 218 | } |
219 | 219 | ||
220 | asmlinkage long | 220 | SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, |
221 | sys_mprotect(unsigned long start, size_t len, unsigned long prot) | 221 | unsigned long, prot) |
222 | { | 222 | { |
223 | unsigned long vm_flags, nstart, end, tmp, reqprot; | 223 | unsigned long vm_flags, nstart, end, tmp, reqprot; |
224 | struct vm_area_struct *vma, *prev; | 224 | struct vm_area_struct *vma, *prev; |
diff --git a/mm/mremap.c b/mm/mremap.c index 646de959aa58..a39b7b91be46 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -420,9 +420,9 @@ out_nc: | |||
420 | return ret; | 420 | return ret; |
421 | } | 421 | } |
422 | 422 | ||
423 | asmlinkage unsigned long sys_mremap(unsigned long addr, | 423 | SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, |
424 | unsigned long old_len, unsigned long new_len, | 424 | unsigned long, new_len, unsigned long, flags, |
425 | unsigned long flags, unsigned long new_addr) | 425 | unsigned long, new_addr) |
426 | { | 426 | { |
427 | unsigned long ret; | 427 | unsigned long ret; |
428 | 428 | ||
diff --git a/mm/msync.c b/mm/msync.c index 07dae08cf31c..4083209b7f02 100644 --- a/mm/msync.c +++ b/mm/msync.c | |||
@@ -28,7 +28,7 @@ | |||
28 | * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to | 28 | * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to |
29 | * applications. | 29 | * applications. |
30 | */ | 30 | */ |
31 | asmlinkage long sys_msync(unsigned long start, size_t len, int flags) | 31 | SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) |
32 | { | 32 | { |
33 | unsigned long end; | 33 | unsigned long end; |
34 | struct mm_struct *mm = current->mm; | 34 | struct mm_struct *mm = current->mm; |
diff --git a/mm/nommu.c b/mm/nommu.c index 60ed8375c986..8cee8c8ff0f2 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -416,7 +416,7 @@ EXPORT_SYMBOL(vm_insert_page); | |||
416 | * to a regular file. in this case, the unmapping will need | 416 | * to a regular file. in this case, the unmapping will need |
417 | * to invoke file system routines that need the global lock. | 417 | * to invoke file system routines that need the global lock. |
418 | */ | 418 | */ |
419 | asmlinkage unsigned long sys_brk(unsigned long brk) | 419 | SYSCALL_DEFINE1(brk, unsigned long, brk) |
420 | { | 420 | { |
421 | struct mm_struct *mm = current->mm; | 421 | struct mm_struct *mm = current->mm; |
422 | 422 | ||
@@ -1573,7 +1573,7 @@ erase_whole_vma: | |||
1573 | } | 1573 | } |
1574 | EXPORT_SYMBOL(do_munmap); | 1574 | EXPORT_SYMBOL(do_munmap); |
1575 | 1575 | ||
1576 | asmlinkage long sys_munmap(unsigned long addr, size_t len) | 1576 | SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) |
1577 | { | 1577 | { |
1578 | int ret; | 1578 | int ret; |
1579 | struct mm_struct *mm = current->mm; | 1579 | struct mm_struct *mm = current->mm; |
@@ -1657,10 +1657,9 @@ unsigned long do_mremap(unsigned long addr, | |||
1657 | } | 1657 | } |
1658 | EXPORT_SYMBOL(do_mremap); | 1658 | EXPORT_SYMBOL(do_mremap); |
1659 | 1659 | ||
1660 | asmlinkage | 1660 | SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, |
1661 | unsigned long sys_mremap(unsigned long addr, | 1661 | unsigned long, new_len, unsigned long, flags, |
1662 | unsigned long old_len, unsigned long new_len, | 1662 | unsigned long, new_addr) |
1663 | unsigned long flags, unsigned long new_addr) | ||
1664 | { | 1663 | { |
1665 | unsigned long ret; | 1664 | unsigned long ret; |
1666 | 1665 | ||
diff --git a/mm/swapfile.c b/mm/swapfile.c index da422c47e2ee..f48b831e5e5c 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1377,7 +1377,7 @@ out: | |||
1377 | return ret; | 1377 | return ret; |
1378 | } | 1378 | } |
1379 | 1379 | ||
1380 | asmlinkage long sys_swapoff(const char __user * specialfile) | 1380 | SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) |
1381 | { | 1381 | { |
1382 | struct swap_info_struct * p = NULL; | 1382 | struct swap_info_struct * p = NULL; |
1383 | unsigned short *swap_map; | 1383 | unsigned short *swap_map; |
@@ -1633,7 +1633,7 @@ late_initcall(max_swapfiles_check); | |||
1633 | * | 1633 | * |
1634 | * The swapon system call | 1634 | * The swapon system call |
1635 | */ | 1635 | */ |
1636 | asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) | 1636 | SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) |
1637 | { | 1637 | { |
1638 | struct swap_info_struct * p; | 1638 | struct swap_info_struct * p; |
1639 | char *name = NULL; | 1639 | char *name = NULL; |
diff --git a/net/socket.c b/net/socket.c index 06603d73c411..35dd7371752a 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1214,7 +1214,7 @@ int sock_create_kern(int family, int type, int protocol, struct socket **res) | |||
1214 | return __sock_create(&init_net, family, type, protocol, res, 1); | 1214 | return __sock_create(&init_net, family, type, protocol, res, 1); |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | asmlinkage long sys_socket(int family, int type, int protocol) | 1217 | SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) |
1218 | { | 1218 | { |
1219 | int retval; | 1219 | int retval; |
1220 | struct socket *sock; | 1220 | struct socket *sock; |
@@ -1255,8 +1255,8 @@ out_release: | |||
1255 | * Create a pair of connected sockets. | 1255 | * Create a pair of connected sockets. |
1256 | */ | 1256 | */ |
1257 | 1257 | ||
1258 | asmlinkage long sys_socketpair(int family, int type, int protocol, | 1258 | SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol, |
1259 | int __user *usockvec) | 1259 | int __user *, usockvec) |
1260 | { | 1260 | { |
1261 | struct socket *sock1, *sock2; | 1261 | struct socket *sock1, *sock2; |
1262 | int fd1, fd2, err; | 1262 | int fd1, fd2, err; |
@@ -1356,7 +1356,7 @@ out_fd1: | |||
1356 | * the protocol layer (having also checked the address is ok). | 1356 | * the protocol layer (having also checked the address is ok). |
1357 | */ | 1357 | */ |
1358 | 1358 | ||
1359 | asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) | 1359 | SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) |
1360 | { | 1360 | { |
1361 | struct socket *sock; | 1361 | struct socket *sock; |
1362 | struct sockaddr_storage address; | 1362 | struct sockaddr_storage address; |
@@ -1385,7 +1385,7 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) | |||
1385 | * ready for listening. | 1385 | * ready for listening. |
1386 | */ | 1386 | */ |
1387 | 1387 | ||
1388 | asmlinkage long sys_listen(int fd, int backlog) | 1388 | SYSCALL_DEFINE2(listen, int, fd, int, backlog) |
1389 | { | 1389 | { |
1390 | struct socket *sock; | 1390 | struct socket *sock; |
1391 | int err, fput_needed; | 1391 | int err, fput_needed; |
@@ -1418,8 +1418,8 @@ asmlinkage long sys_listen(int fd, int backlog) | |||
1418 | * clean when we restucture accept also. | 1418 | * clean when we restucture accept also. |
1419 | */ | 1419 | */ |
1420 | 1420 | ||
1421 | asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, | 1421 | SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, |
1422 | int __user *upeer_addrlen, int flags) | 1422 | int __user *, upeer_addrlen, int, flags) |
1423 | { | 1423 | { |
1424 | struct socket *sock, *newsock; | 1424 | struct socket *sock, *newsock; |
1425 | struct file *newfile; | 1425 | struct file *newfile; |
@@ -1502,8 +1502,8 @@ out_fd: | |||
1502 | goto out_put; | 1502 | goto out_put; |
1503 | } | 1503 | } |
1504 | 1504 | ||
1505 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1505 | SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr, |
1506 | int __user *upeer_addrlen) | 1506 | int __user *, upeer_addrlen) |
1507 | { | 1507 | { |
1508 | return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); | 1508 | return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); |
1509 | } | 1509 | } |
@@ -1520,8 +1520,8 @@ asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | |||
1520 | * include the -EINPROGRESS status for such sockets. | 1520 | * include the -EINPROGRESS status for such sockets. |
1521 | */ | 1521 | */ |
1522 | 1522 | ||
1523 | asmlinkage long sys_connect(int fd, struct sockaddr __user *uservaddr, | 1523 | SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, |
1524 | int addrlen) | 1524 | int, addrlen) |
1525 | { | 1525 | { |
1526 | struct socket *sock; | 1526 | struct socket *sock; |
1527 | struct sockaddr_storage address; | 1527 | struct sockaddr_storage address; |
@@ -1552,8 +1552,8 @@ out: | |||
1552 | * name to user space. | 1552 | * name to user space. |
1553 | */ | 1553 | */ |
1554 | 1554 | ||
1555 | asmlinkage long sys_getsockname(int fd, struct sockaddr __user *usockaddr, | 1555 | SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr, |
1556 | int __user *usockaddr_len) | 1556 | int __user *, usockaddr_len) |
1557 | { | 1557 | { |
1558 | struct socket *sock; | 1558 | struct socket *sock; |
1559 | struct sockaddr_storage address; | 1559 | struct sockaddr_storage address; |
@@ -1583,8 +1583,8 @@ out: | |||
1583 | * name to user space. | 1583 | * name to user space. |
1584 | */ | 1584 | */ |
1585 | 1585 | ||
1586 | asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr, | 1586 | SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr, |
1587 | int __user *usockaddr_len) | 1587 | int __user *, usockaddr_len) |
1588 | { | 1588 | { |
1589 | struct socket *sock; | 1589 | struct socket *sock; |
1590 | struct sockaddr_storage address; | 1590 | struct sockaddr_storage address; |
@@ -1615,9 +1615,9 @@ asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr, | |||
1615 | * the protocol. | 1615 | * the protocol. |
1616 | */ | 1616 | */ |
1617 | 1617 | ||
1618 | asmlinkage long sys_sendto(int fd, void __user *buff, size_t len, | 1618 | SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, |
1619 | unsigned flags, struct sockaddr __user *addr, | 1619 | unsigned, flags, struct sockaddr __user *, addr, |
1620 | int addr_len) | 1620 | int, addr_len) |
1621 | { | 1621 | { |
1622 | struct socket *sock; | 1622 | struct socket *sock; |
1623 | struct sockaddr_storage address; | 1623 | struct sockaddr_storage address; |
@@ -1660,7 +1660,8 @@ out: | |||
1660 | * Send a datagram down a socket. | 1660 | * Send a datagram down a socket. |
1661 | */ | 1661 | */ |
1662 | 1662 | ||
1663 | asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags) | 1663 | SYSCALL_DEFINE4(send, int, fd, void __user *, buff, size_t, len, |
1664 | unsigned, flags) | ||
1664 | { | 1665 | { |
1665 | return sys_sendto(fd, buff, len, flags, NULL, 0); | 1666 | return sys_sendto(fd, buff, len, flags, NULL, 0); |
1666 | } | 1667 | } |
@@ -1671,9 +1672,9 @@ asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags) | |||
1671 | * sender address from kernel to user space. | 1672 | * sender address from kernel to user space. |
1672 | */ | 1673 | */ |
1673 | 1674 | ||
1674 | asmlinkage long sys_recvfrom(int fd, void __user *ubuf, size_t size, | 1675 | SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, |
1675 | unsigned flags, struct sockaddr __user *addr, | 1676 | unsigned, flags, struct sockaddr __user *, addr, |
1676 | int __user *addr_len) | 1677 | int __user *, addr_len) |
1677 | { | 1678 | { |
1678 | struct socket *sock; | 1679 | struct socket *sock; |
1679 | struct iovec iov; | 1680 | struct iovec iov; |
@@ -1725,8 +1726,8 @@ asmlinkage long sys_recv(int fd, void __user *ubuf, size_t size, | |||
1725 | * to pass the user mode parameter for the protocols to sort out. | 1726 | * to pass the user mode parameter for the protocols to sort out. |
1726 | */ | 1727 | */ |
1727 | 1728 | ||
1728 | asmlinkage long sys_setsockopt(int fd, int level, int optname, | 1729 | SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname, |
1729 | char __user *optval, int optlen) | 1730 | char __user *, optval, int, optlen) |
1730 | { | 1731 | { |
1731 | int err, fput_needed; | 1732 | int err, fput_needed; |
1732 | struct socket *sock; | 1733 | struct socket *sock; |
@@ -1759,8 +1760,8 @@ out_put: | |||
1759 | * to pass a user mode parameter for the protocols to sort out. | 1760 | * to pass a user mode parameter for the protocols to sort out. |
1760 | */ | 1761 | */ |
1761 | 1762 | ||
1762 | asmlinkage long sys_getsockopt(int fd, int level, int optname, | 1763 | SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname, |
1763 | char __user *optval, int __user *optlen) | 1764 | char __user *, optval, int __user *, optlen) |
1764 | { | 1765 | { |
1765 | int err, fput_needed; | 1766 | int err, fput_needed; |
1766 | struct socket *sock; | 1767 | struct socket *sock; |
@@ -1789,7 +1790,7 @@ out_put: | |||
1789 | * Shutdown a socket. | 1790 | * Shutdown a socket. |
1790 | */ | 1791 | */ |
1791 | 1792 | ||
1792 | asmlinkage long sys_shutdown(int fd, int how) | 1793 | SYSCALL_DEFINE2(shutdown, int, fd, int, how) |
1793 | { | 1794 | { |
1794 | int err, fput_needed; | 1795 | int err, fput_needed; |
1795 | struct socket *sock; | 1796 | struct socket *sock; |
@@ -1815,7 +1816,7 @@ asmlinkage long sys_shutdown(int fd, int how) | |||
1815 | * BSD sendmsg interface | 1816 | * BSD sendmsg interface |
1816 | */ | 1817 | */ |
1817 | 1818 | ||
1818 | asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) | 1819 | SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags) |
1819 | { | 1820 | { |
1820 | struct compat_msghdr __user *msg_compat = | 1821 | struct compat_msghdr __user *msg_compat = |
1821 | (struct compat_msghdr __user *)msg; | 1822 | (struct compat_msghdr __user *)msg; |
@@ -1921,8 +1922,8 @@ out: | |||
1921 | * BSD recvmsg interface | 1922 | * BSD recvmsg interface |
1922 | */ | 1923 | */ |
1923 | 1924 | ||
1924 | asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, | 1925 | SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, |
1925 | unsigned int flags) | 1926 | unsigned int, flags) |
1926 | { | 1927 | { |
1927 | struct compat_msghdr __user *msg_compat = | 1928 | struct compat_msghdr __user *msg_compat = |
1928 | (struct compat_msghdr __user *)msg; | 1929 | (struct compat_msghdr __user *)msg; |
@@ -2045,7 +2046,7 @@ static const unsigned char nargs[19]={ | |||
2045 | * it is set by the callees. | 2046 | * it is set by the callees. |
2046 | */ | 2047 | */ |
2047 | 2048 | ||
2048 | asmlinkage long sys_socketcall(int call, unsigned long __user *args) | 2049 | SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args) |
2049 | { | 2050 | { |
2050 | unsigned long a[6]; | 2051 | unsigned long a[6]; |
2051 | unsigned long a0, a1; | 2052 | unsigned long a0, a1; |
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 09796797d122..e9335e1c6cf5 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c | |||
@@ -54,11 +54,11 @@ static int key_get_type_from_user(char *type, | |||
54 | * - returns the new key's serial number | 54 | * - returns the new key's serial number |
55 | * - implements add_key() | 55 | * - implements add_key() |
56 | */ | 56 | */ |
57 | asmlinkage long sys_add_key(const char __user *_type, | 57 | SYSCALL_DEFINE5(add_key, const char __user *, _type, |
58 | const char __user *_description, | 58 | const char __user *, _description, |
59 | const void __user *_payload, | 59 | const void __user *, _payload, |
60 | size_t plen, | 60 | size_t, plen, |
61 | key_serial_t ringid) | 61 | key_serial_t, ringid) |
62 | { | 62 | { |
63 | key_ref_t keyring_ref, key_ref; | 63 | key_ref_t keyring_ref, key_ref; |
64 | char type[32], *description; | 64 | char type[32], *description; |
@@ -146,10 +146,10 @@ asmlinkage long sys_add_key(const char __user *_type, | |||
146 | * - if the _callout_info string is empty, it will be rendered as "-" | 146 | * - if the _callout_info string is empty, it will be rendered as "-" |
147 | * - implements request_key() | 147 | * - implements request_key() |
148 | */ | 148 | */ |
149 | asmlinkage long sys_request_key(const char __user *_type, | 149 | SYSCALL_DEFINE4(request_key, const char __user *, _type, |
150 | const char __user *_description, | 150 | const char __user *, _description, |
151 | const char __user *_callout_info, | 151 | const char __user *, _callout_info, |
152 | key_serial_t destringid) | 152 | key_serial_t, destringid) |
153 | { | 153 | { |
154 | struct key_type *ktype; | 154 | struct key_type *ktype; |
155 | struct key *key; | 155 | struct key *key; |
@@ -1216,8 +1216,8 @@ long keyctl_get_security(key_serial_t keyid, | |||
1216 | /* | 1216 | /* |
1217 | * the key control system call | 1217 | * the key control system call |
1218 | */ | 1218 | */ |
1219 | asmlinkage long sys_keyctl(int option, unsigned long arg2, unsigned long arg3, | 1219 | SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, |
1220 | unsigned long arg4, unsigned long arg5) | 1220 | unsigned long, arg4, unsigned long, arg5) |
1221 | { | 1221 | { |
1222 | switch (option) { | 1222 | switch (option) { |
1223 | case KEYCTL_GET_KEYRING_ID: | 1223 | case KEYCTL_GET_KEYRING_ID: |