[05/28] shmem: Remove pid argument of shmem_wait_and_open()

Submitted by Kirill Tkhai on June 5, 2017, 5:24 p.m.

Details

Message ID 149668344988.25229.6341023577422574021.stgit@localhost.localdomain
State New
Series "Support sockets leaked to child user_ns task"
Headers show

Commit Message

Kirill Tkhai June 5, 2017, 5:24 p.m.
It's unused and it's rewritten in shmem_wait_and_open(),
and it just confuses a reader. So, kill it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/shmem.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/shmem.c b/criu/shmem.c
index a55f34675..fbfba0060 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -439,10 +439,10 @@  int collect_shmem(int pid, struct vma_area *vma)
 	return 0;
 }
 
-static int shmem_wait_and_open(int pid, struct shmem_info *si, VmaEntry *vi)
+static int shmem_wait_and_open(struct shmem_info *si, VmaEntry *vi)
 {
 	char path[128];
-	int ret;
+	int pid, ret;
 
 	pr_info("Waiting for the %lx shmem to appear\n", si->shmid);
 	futex_wait_while(&si->lock, 0);
@@ -519,7 +519,7 @@  static int open_shmem(int pid, struct vma_area *vma)
 	BUG_ON(si->pid == SYSVIPC_SHMEM_PID);
 
 	if (si->pid != pid)
-		return shmem_wait_and_open(pid, si, vi);
+		return shmem_wait_and_open(si, vi);
 
 	if (si->fd != -1) {
 		f = dup(si->fd);

Comments

Andrei Vagin June 6, 2017, 5:56 p.m.
Applied

On Mon, Jun 05, 2017 at 08:24:09PM +0300, Kirill Tkhai wrote:
> It's unused and it's rewritten in shmem_wait_and_open(),
> and it just confuses a reader. So, kill it.
> 
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> ---
>  criu/shmem.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/criu/shmem.c b/criu/shmem.c
> index a55f34675..fbfba0060 100644
> --- a/criu/shmem.c
> +++ b/criu/shmem.c
> @@ -439,10 +439,10 @@ int collect_shmem(int pid, struct vma_area *vma)
>  	return 0;
>  }
>  
> -static int shmem_wait_and_open(int pid, struct shmem_info *si, VmaEntry *vi)
> +static int shmem_wait_and_open(struct shmem_info *si, VmaEntry *vi)
>  {
>  	char path[128];
> -	int ret;
> +	int pid, ret;
>  
>  	pr_info("Waiting for the %lx shmem to appear\n", si->shmid);
>  	futex_wait_while(&si->lock, 0);
> @@ -519,7 +519,7 @@ static int open_shmem(int pid, struct vma_area *vma)
>  	BUG_ON(si->pid == SYSVIPC_SHMEM_PID);
>  
>  	if (si->pid != pid)
> -		return shmem_wait_and_open(pid, si, vi);
> +		return shmem_wait_and_open(si, vi);
>  
>  	if (si->fd != -1) {
>  		f = dup(si->fd);
>