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

Commit ba25f9dc authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Linus Torvalds
Browse files

Use helpers to obtain task pid in printks



The task_struct->pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.

The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.

[akpm@linux-foundation.org: git-drm went and changed lots of stuff]
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9a2e7057
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3367,7 +3367,7 @@ void submit_bio(int rw, struct bio *bio)
		if (unlikely(block_dump)) {
			char b[BDEVNAME_SIZE];
			printk(KERN_DEBUG "%s(%d): %s block %Lu on %s\n",
				current->comm, current->pid,
			current->comm, task_pid_nr(current),
				(rw & WRITE) ? "WRITE" : "READ",
				(unsigned long long)bio->bi_sector,
				bdevname(bio->bi_bdev,b));
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ static int sock_xmit(struct nbd_device *lo, int send, void *buf, int size,
		if (signal_pending(current)) {
			siginfo_t info;
			printk(KERN_WARNING "nbd (pid %d: %s) got signal %d\n",
				current->pid, current->comm,
				task_pid_nr(current), current->comm,
				dequeue_signal_lock(current, &current->blocked, &info));
			result = -EINTR;
			sock_shutdown(lo, !send);
+1 −1
Original line number Diff line number Diff line
@@ -1107,7 +1107,7 @@ int open_for_data(struct cdrom_device_info * cdi)
		       is the default case! */
		    cdinfo(CD_OPEN, "bummer. wrong media type.\n"); 
		    cdinfo(CD_WARNING, "pid %d must open device O_NONBLOCK!\n",
					(unsigned int)current->pid); 
					(unsigned int)task_pid_nr(current));
		    ret=-EMEDIUMTYPE;
		    goto clean_up_and_return;
		}
+1 −1
Original line number Diff line number Diff line
@@ -1456,7 +1456,7 @@ int drm_freebufs(struct drm_device *dev, void *data,
		buf = dma->buflist[idx];
		if (buf->file_priv != file_priv) {
			DRM_ERROR("Process %d freeing buffer not owned\n",
				  current->pid);
				  task_pid_nr(current));
			return -EINVAL;
		}
		drm_free_buffer(dev, buf);
+1 −1
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ int drm_ioctl(struct inode *inode, struct file *filp,
	++file_priv->ioctl_count;

	DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
		  current->pid, cmd, nr,
		  task_pid_nr(current), cmd, nr,
		  (long)old_encode_dev(file_priv->head->device),
		  file_priv->authenticated);

Loading