]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - fs/pipe.c
fs/pipe: move check to pipe_has_watch_queue()
[thirdparty/linux.git] / fs / pipe.c
index 6c1a9b1db9076c8c1402b7368a25ca7d9a894c70..6ecaccb487388d2925884df9e248cc6989262d81 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -437,12 +437,10 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
                goto out;
        }
 
-#ifdef CONFIG_WATCH_QUEUE
-       if (pipe->watch_queue) {
+       if (pipe_has_watch_queue(pipe)) {
                ret = -EXDEV;
                goto out;
        }
-#endif
 
        /*
         * If it wasn't empty we try to merge new data into
@@ -1325,10 +1323,8 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned int arg)
        unsigned int nr_slots, size;
        long ret = 0;
 
-#ifdef CONFIG_WATCH_QUEUE
-       if (pipe->watch_queue)
+       if (pipe_has_watch_queue(pipe))
                return -EBUSY;
-#endif
 
        size = round_pipe_size(arg);
        nr_slots = size >> PAGE_SHIFT;
@@ -1380,10 +1376,8 @@ struct pipe_inode_info *get_pipe_info(struct file *file, bool for_splice)
 
        if (file->f_op != &pipefifo_fops || !pipe)
                return NULL;
-#ifdef CONFIG_WATCH_QUEUE
-       if (for_splice && pipe->watch_queue)
+       if (for_splice && pipe_has_watch_queue(pipe))
                return NULL;
-#endif
        return pipe;
 }