diff options
author | akpm@osdl.org <akpm@osdl.org> | 2005-05-01 11:58:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:58:47 -0400 |
commit | d59dd4620fb8d6422555a9e2b82a707718e68327 (patch) | |
tree | 78205657d24efcaa3f8314064951ac3814ed95a7 /kernel/sys.c | |
parent | 0d8d4d42f2d00eb65262b49f4edd4cf7ef4eb6fc (diff) |
[PATCH] use smp_mb/wmb/rmb where possible
Replace a number of memory barriers with smp_ variants. This means we won't
take the unnecessary hit on UP machines.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 462d78d55895..df2ddcc6863b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -525,7 +525,7 @@ asmlinkage long sys_setregid(gid_t rgid, gid_t egid) | |||
525 | if (new_egid != old_egid) | 525 | if (new_egid != old_egid) |
526 | { | 526 | { |
527 | current->mm->dumpable = 0; | 527 | current->mm->dumpable = 0; |
528 | wmb(); | 528 | smp_wmb(); |
529 | } | 529 | } |
530 | if (rgid != (gid_t) -1 || | 530 | if (rgid != (gid_t) -1 || |
531 | (egid != (gid_t) -1 && egid != old_rgid)) | 531 | (egid != (gid_t) -1 && egid != old_rgid)) |
@@ -556,7 +556,7 @@ asmlinkage long sys_setgid(gid_t gid) | |||
556 | if(old_egid != gid) | 556 | if(old_egid != gid) |
557 | { | 557 | { |
558 | current->mm->dumpable=0; | 558 | current->mm->dumpable=0; |
559 | wmb(); | 559 | smp_wmb(); |
560 | } | 560 | } |
561 | current->gid = current->egid = current->sgid = current->fsgid = gid; | 561 | current->gid = current->egid = current->sgid = current->fsgid = gid; |
562 | } | 562 | } |
@@ -565,7 +565,7 @@ asmlinkage long sys_setgid(gid_t gid) | |||
565 | if(old_egid != gid) | 565 | if(old_egid != gid) |
566 | { | 566 | { |
567 | current->mm->dumpable=0; | 567 | current->mm->dumpable=0; |
568 | wmb(); | 568 | smp_wmb(); |
569 | } | 569 | } |
570 | current->egid = current->fsgid = gid; | 570 | current->egid = current->fsgid = gid; |
571 | } | 571 | } |
@@ -596,7 +596,7 @@ static int set_user(uid_t new_ruid, int dumpclear) | |||
596 | if(dumpclear) | 596 | if(dumpclear) |
597 | { | 597 | { |
598 | current->mm->dumpable = 0; | 598 | current->mm->dumpable = 0; |
599 | wmb(); | 599 | smp_wmb(); |
600 | } | 600 | } |
601 | current->uid = new_ruid; | 601 | current->uid = new_ruid; |
602 | return 0; | 602 | return 0; |
@@ -653,7 +653,7 @@ asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) | |||
653 | if (new_euid != old_euid) | 653 | if (new_euid != old_euid) |
654 | { | 654 | { |
655 | current->mm->dumpable=0; | 655 | current->mm->dumpable=0; |
656 | wmb(); | 656 | smp_wmb(); |
657 | } | 657 | } |
658 | current->fsuid = current->euid = new_euid; | 658 | current->fsuid = current->euid = new_euid; |
659 | if (ruid != (uid_t) -1 || | 659 | if (ruid != (uid_t) -1 || |
@@ -703,7 +703,7 @@ asmlinkage long sys_setuid(uid_t uid) | |||
703 | if (old_euid != uid) | 703 | if (old_euid != uid) |
704 | { | 704 | { |
705 | current->mm->dumpable = 0; | 705 | current->mm->dumpable = 0; |
706 | wmb(); | 706 | smp_wmb(); |
707 | } | 707 | } |
708 | current->fsuid = current->euid = uid; | 708 | current->fsuid = current->euid = uid; |
709 | current->suid = new_suid; | 709 | current->suid = new_suid; |
@@ -748,7 +748,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) | |||
748 | if (euid != current->euid) | 748 | if (euid != current->euid) |
749 | { | 749 | { |
750 | current->mm->dumpable = 0; | 750 | current->mm->dumpable = 0; |
751 | wmb(); | 751 | smp_wmb(); |
752 | } | 752 | } |
753 | current->euid = euid; | 753 | current->euid = euid; |
754 | } | 754 | } |
@@ -798,7 +798,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) | |||
798 | if (egid != current->egid) | 798 | if (egid != current->egid) |
799 | { | 799 | { |
800 | current->mm->dumpable = 0; | 800 | current->mm->dumpable = 0; |
801 | wmb(); | 801 | smp_wmb(); |
802 | } | 802 | } |
803 | current->egid = egid; | 803 | current->egid = egid; |
804 | } | 804 | } |
@@ -845,7 +845,7 @@ asmlinkage long sys_setfsuid(uid_t uid) | |||
845 | if (uid != old_fsuid) | 845 | if (uid != old_fsuid) |
846 | { | 846 | { |
847 | current->mm->dumpable = 0; | 847 | current->mm->dumpable = 0; |
848 | wmb(); | 848 | smp_wmb(); |
849 | } | 849 | } |
850 | current->fsuid = uid; | 850 | current->fsuid = uid; |
851 | } | 851 | } |
@@ -875,7 +875,7 @@ asmlinkage long sys_setfsgid(gid_t gid) | |||
875 | if (gid != old_fsgid) | 875 | if (gid != old_fsgid) |
876 | { | 876 | { |
877 | current->mm->dumpable = 0; | 877 | current->mm->dumpable = 0; |
878 | wmb(); | 878 | smp_wmb(); |
879 | } | 879 | } |
880 | current->fsgid = gid; | 880 | current->fsgid = gid; |
881 | key_fsgid_changed(current); | 881 | key_fsgid_changed(current); |