* [Qemu-devel] [5267] Swap only altered elements of the grouplist in getgroups() ( Kirill Shutemov).
@ 2008-09-20 2:12 Andrzej Zaborowski
0 siblings, 0 replies; only message in thread
From: Andrzej Zaborowski @ 2008-09-20 2:12 UTC (permalink / raw)
To: qemu-devel
Revision: 5267
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5267
Author: balrog
Date: 2008-09-20 02:12:08 +0000 (Sat, 20 Sep 2008)
Log Message:
-----------
Swap only altered elements of the grouplist in getgroups() (Kirill Shutemov).
getgroups() returns the number of supplementary group IDs, so it's
unnessary to swap the entire array. It can dramatically speed up
the syscall: on recent Linux kernels NGROUPS_MAX=65536.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Modified Paths:
--------------
trunk/linux-user/syscall.c
Modified: trunk/linux-user/syscall.c
===================================================================
--- trunk/linux-user/syscall.c 2008-09-20 02:08:13 UTC (rev 5266)
+++ trunk/linux-user/syscall.c 2008-09-20 02:12:08 UTC (rev 5267)
@@ -5253,7 +5253,7 @@
target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 2, 0);
if (!target_grouplist)
goto efault;
- for(i = 0;i < gidsetsize; i++)
+ for(i = 0;i < ret; i++)
target_grouplist[i] = tswap16(grouplist[i]);
unlock_user(target_grouplist, arg2, gidsetsize * 2);
}
@@ -5407,7 +5407,7 @@
ret = -TARGET_EFAULT;
goto fail;
}
- for(i = 0;i < gidsetsize; i++)
+ for(i = 0;i < ret; i++)
target_grouplist[i] = tswap32(grouplist[i]);
unlock_user(target_grouplist, arg2, gidsetsize * 4);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-09-20 2:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-20 2:12 [Qemu-devel] [5267] Swap only altered elements of the grouplist in getgroups() ( Kirill Shutemov) Andrzej Zaborowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).