VFS: Put a small type field into struct dentry::d_flags
[firefly-linux-kernel-4.4.55.git] / fs / eventpoll.c
index 293f86741ddb08a0bc625c3a7fdccbbe96ad7486..31fd77cd81eb6b9df7ee1f480886afd090cf51c4 100644 (file)
@@ -740,6 +740,7 @@ static void ep_free(struct eventpoll *ep)
                epi = rb_entry(rbp, struct epitem, rbn);
 
                ep_unregister_pollwait(ep, epi);
+               cond_resched();
        }
 
        /*
@@ -754,6 +755,7 @@ static void ep_free(struct eventpoll *ep)
        while ((rbp = rb_first(&ep->rbr)) != NULL) {
                epi = rb_entry(rbp, struct epitem, rbn);
                ep_remove(ep, epi);
+               cond_resched();
        }
        mutex_unlock(&ep->mtx);
 
@@ -1814,7 +1816,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
 
        /* The target file descriptor must support poll */
        error = -EPERM;
-       if (!tf.file->f_op || !tf.file->f_op->poll)
+       if (!tf.file->f_op->poll)
                goto error_tgt_fput;
 
        /* Check if EPOLLWAKEUP is allowed */