Commit e4fa49bd authored by Robert Love's avatar Robert Love Committed by Linus Torvalds

[PATCH] comment cleanups for cpu affinity syscall

A few (anal) comment cleanups and additions in relationship to the new
task cpu affinity syscalls.  All no brainers.
parent ee62b709
...@@ -242,6 +242,7 @@ typedef __u32 kernel_cap_t; ...@@ -242,6 +242,7 @@ typedef __u32 kernel_cap_t;
/* Allow use of FIFO and round-robin (realtime) scheduling on own /* Allow use of FIFO and round-robin (realtime) scheduling on own
processes and setting the scheduling algorithm used by another processes and setting the scheduling algorithm used by another
process. */ process. */
/* Allow setting cpu affinity on other processes */
#define CAP_SYS_NICE 23 #define CAP_SYS_NICE 23
......
...@@ -1237,11 +1237,11 @@ asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param) ...@@ -1237,11 +1237,11 @@ asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param *param)
/** /**
* sys_sched_setaffinity - set the cpu affinity of a process * sys_sched_setaffinity - set the cpu affinity of a process
* @pid: pid of the process * @pid: pid of the process
* @len: length of new_mask * @len: length of the bitmask pointed to by user_mask_ptr
* @new_mask: user-space pointer to the new cpu mask * @user_mask_ptr: user-space pointer to the new cpu mask
*/ */
asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len, asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len,
unsigned long *new_mask_ptr) unsigned long *user_mask_ptr)
{ {
unsigned long new_mask; unsigned long new_mask;
task_t *p; task_t *p;
...@@ -1250,7 +1250,7 @@ asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len, ...@@ -1250,7 +1250,7 @@ asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len,
if (len < sizeof(new_mask)) if (len < sizeof(new_mask))
return -EINVAL; return -EINVAL;
if (copy_from_user(&new_mask, new_mask_ptr, sizeof(new_mask))) if (copy_from_user(&new_mask, user_mask_ptr, sizeof(new_mask)))
return -EFAULT; return -EFAULT;
new_mask &= cpu_online_map; new_mask &= cpu_online_map;
...@@ -1289,8 +1289,8 @@ asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len, ...@@ -1289,8 +1289,8 @@ asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len,
/** /**
* sys_sched_getaffinity - get the cpu affinity of a process * sys_sched_getaffinity - get the cpu affinity of a process
* @pid: pid of the process * @pid: pid of the process
* @len: length of the new mask * @len: length of the bitmask pointed to by user_mask_ptr
* @user_mask_ptr: userspace pointer to the mask * @user_mask_ptr: user-space pointer to hold the current cpu mask
*/ */
asmlinkage int sys_sched_getaffinity(pid_t pid, unsigned int len, asmlinkage int sys_sched_getaffinity(pid_t pid, unsigned int len,
unsigned long *user_mask_ptr) unsigned long *user_mask_ptr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment