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

Commit a9a08845 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

vfs: do bulk POLL* -> EPOLL* replacement



This is the mindless scripted replacement of kernel use of POLL*
variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
        L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
        for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
    done

with de-mangling cleanups yet to come.

NOTE! On almost all architectures, the EPOLL* constants have the same
values as the POLL* constants do.  But they keyword here is "almost".
For various bad reasons they aren't the same, and epoll() doesn't
actually work quite correctly in some cases due to this on Sparc et al.

The next patch from Al will sort out the final differences, and we
should be all done.

Scripted-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ee5daa13
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ static __poll_t gpio_poll(struct file *file, poll_table *wait)

	if ((data & priv->highalarm) ||
	    (~data & priv->lowalarm)) {
		mask = POLLIN|POLLRDNORM;
		mask = EPOLLIN|EPOLLRDNORM;
	}

out:
+4 −4
Original line number Diff line number Diff line
@@ -666,16 +666,16 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
	poll_wait(file, &port->in_wait_q, wait);
	/* Some room to write */
	if (port->out_count < OUT_BUFFER_SIZE)
		mask |=  POLLOUT | POLLWRNORM;
		mask |=  EPOLLOUT | EPOLLWRNORM;
	/* At least an inbufchunk of data */
	if (sync_data_avail(port) >= port->inbufchunk)
		mask |= POLLIN | POLLRDNORM;
		mask |= EPOLLIN | EPOLLRDNORM;

	DEBUGPOLL(if (mask != prev_mask)
		printk(KERN_DEBUG "sync_serial_poll: mask 0x%08X %s %s\n",
			mask,
			mask & POLLOUT ? "POLLOUT" : "",
			mask & POLLIN ? "POLLIN" : "");
			mask & EPOLLOUT ? "POLLOUT" : "",
			mask & EPOLLIN ? "POLLIN" : "");
		prev_mask = mask;
	);
	return mask;
+5 −5
Original line number Diff line number Diff line
@@ -574,24 +574,24 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)

	/* No active transfer, descriptors are available */
	if (port->output && !port->tr_running)
		mask |= POLLOUT | POLLWRNORM;
		mask |= EPOLLOUT | EPOLLWRNORM;

	/* Descriptor and buffer space available. */
	if (port->output &&
	    port->active_tr_descr != port->catch_tr_descr &&
	    port->out_buf_count < OUT_BUFFER_SIZE)
		mask |=  POLLOUT | POLLWRNORM;
		mask |=  EPOLLOUT | EPOLLWRNORM;

	/* At least an inbufchunk of data */
	if (port->input && sync_data_avail(port) >= port->inbufchunk)
		mask |= POLLIN | POLLRDNORM;
		mask |= EPOLLIN | EPOLLRDNORM;

	DEBUGPOLL(
	if (mask != prev_mask)
		pr_info("sync_serial_poll: mask 0x%08X %s %s\n",
			mask,
			mask & POLLOUT ? "POLLOUT" : "",
			mask & POLLIN ? "POLLIN" : "");
			mask & EPOLLOUT ? "POLLOUT" : "",
			mask & EPOLLIN ? "POLLIN" : "");
		prev_mask = mask;
	);
	return mask;
+1 −1
Original line number Diff line number Diff line
@@ -1670,7 +1670,7 @@ pfm_poll(struct file *filp, poll_table * wait)
	PROTECT_CTX(ctx, flags);

	if (PFM_CTXQ_EMPTY(ctx) == 0)
		mask =  POLLIN | POLLRDNORM;
		mask =  EPOLLIN | EPOLLRDNORM;

	UNPROTECT_CTX(ctx, flags);

+2 −2
Original line number Diff line number Diff line
@@ -349,11 +349,11 @@ static __poll_t file_poll(struct file *file, poll_table *wait)

	/* data available to read? */
	if (rtlx_read_poll(minor, 0))
		mask |= POLLIN | POLLRDNORM;
		mask |= EPOLLIN | EPOLLRDNORM;

	/* space to write */
	if (rtlx_write_poll(minor))
		mask |= POLLOUT | POLLWRNORM;
		mask |= EPOLLOUT | EPOLLWRNORM;

	return mask;
}
Loading