Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb0942b8 authored by Al Viro's avatar Al Viro
Browse files

make get_file() return its argument



simplifies a bunch of callers...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent cecb46f1
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2306,7 +2306,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
	 * partially initialize the vma for the sampling buffer
	 */
	vma->vm_mm	     = mm;
	vma->vm_file	     = filp;
	vma->vm_file	     = get_file(filp);
	vma->vm_flags	     = VM_READ| VM_MAYREAD |VM_RESERVED;
	vma->vm_page_prot    = PAGE_READONLY; /* XXX may need to change */

@@ -2345,8 +2345,6 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
		goto error;
	}

	get_file(filp);

	/*
	 * now insert the vma in the vm list for the process, must be
	 * done with mmap lock held
+1 −2
Original line number Diff line number Diff line
@@ -460,8 +460,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,
	if (vma->vm_file)
		fput(vma->vm_file);

	vma->vm_file = dmabuf->file;
	get_file(vma->vm_file);
	vma->vm_file = get_file(dmabuf->file);

	vma->vm_pgoff = pgoff;

+1 −2
Original line number Diff line number Diff line
@@ -566,9 +566,8 @@ int omap_gem_mmap_obj(struct drm_gem_object *obj,
		 * in particular in the case of mmap'd dmabufs)
		 */
		fput(vma->vm_file);
		get_file(obj->filp);
		vma->vm_pgoff = 0;
		vma->vm_file  = obj->filp;
		vma->vm_file  = get_file(obj->filp);

		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
	}
+3 −6
Original line number Diff line number Diff line
@@ -1163,10 +1163,8 @@ ssize_t redirected_tty_write(struct file *file, const char __user *buf,
	struct file *p = NULL;

	spin_lock(&redirect_lock);
	if (redirect) {
		get_file(redirect);
		p = redirect;
	}
	if (redirect)
		p = get_file(redirect);
	spin_unlock(&redirect_lock);

	if (p) {
@@ -2246,8 +2244,7 @@ static int tioccons(struct file *file)
		spin_unlock(&redirect_lock);
		return -EBUSY;
	}
	get_file(file);
	redirect = file;
	redirect = get_file(file);
	spin_unlock(&redirect_lock);
	return 0;
}
+1 −2
Original line number Diff line number Diff line
@@ -175,8 +175,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
		return;
	}

	pipe = sbi->pipe;
	get_file(pipe);
	pipe = get_file(sbi->pipe);

	mutex_unlock(&sbi->wq_mutex);

Loading