--- zzzz-none-000/linux-2.6.19.2/fs/splice.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/fs/splice.c 2007-01-11 07:38:19.000000000 +0000 @@ -74,7 +74,7 @@ wait_on_page_writeback(page); if (PagePrivate(page)) - try_to_release_page(page, GFP_KERNEL); + try_to_release_page(page, mapping_gfp_mask(mapping)); /* * If we succeeded in removing the mapping, set LRU flag @@ -333,7 +333,7 @@ break; error = add_to_page_cache_lru(page, mapping, index, - GFP_KERNEL); + mapping_gfp_mask(mapping)); if (unlikely(error)) { page_cache_release(page); if (error == -EEXIST) @@ -557,6 +557,7 @@ { struct file *file = sd->file; struct address_space *mapping = file->f_mapping; + gfp_t gfp_mask = mapping_gfp_mask(mapping); unsigned int offset, this_len; struct page *page; pgoff_t index; @@ -590,7 +591,7 @@ goto find_page; page = buf->page; - if (add_to_page_cache(page, mapping, index, GFP_KERNEL)) { + if (add_to_page_cache(page, mapping, index, gfp_mask)) { unlock_page(page); goto find_page; } @@ -612,7 +613,7 @@ * This will also lock the page */ ret = add_to_page_cache_lru(page, mapping, index, - GFP_KERNEL); + gfp_mask); if (unlikely(ret)) goto out; } @@ -1109,19 +1110,6 @@ EXPORT_SYMBOL(do_splice_direct); /* - * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same - * location, so checking ->i_pipe is not enough to verify that this is a - * pipe. - */ -static inline struct pipe_inode_info *pipe_info(struct inode *inode) -{ - if (S_ISFIFO(inode->i_mode)) - return inode->i_pipe; - - return NULL; -} - -/* * Determine where to splice to/from. */ static long do_splice(struct file *in, loff_t __user *off_in, @@ -1132,7 +1120,7 @@ loff_t offset, *off; long ret; - pipe = pipe_info(in->f_dentry->d_inode); + pipe = in->f_dentry->d_inode->i_pipe; if (pipe) { if (off_in) return -ESPIPE; @@ -1153,7 +1141,7 @@ return ret; } - pipe = pipe_info(out->f_dentry->d_inode); + pipe = out->f_dentry->d_inode->i_pipe; if (pipe) { if (off_out) return -ESPIPE; @@ -1311,7 +1299,7 @@ static long do_vmsplice(struct file *file, const struct iovec __user *iov, unsigned long nr_segs, unsigned int flags) { - struct pipe_inode_info *pipe; + struct pipe_inode_info *pipe = file->f_dentry->d_inode->i_pipe; struct page *pages[PIPE_BUFFERS]; struct partial_page partial[PIPE_BUFFERS]; struct splice_pipe_desc spd = { @@ -1321,8 +1309,7 @@ .ops = &user_page_pipe_buf_ops, }; - pipe = pipe_info(file->f_dentry->d_inode); - if (!pipe) + if (unlikely(!pipe)) return -EBADF; if (unlikely(nr_segs > UIO_MAXIOV)) return -EINVAL; @@ -1549,8 +1536,8 @@ static long do_tee(struct file *in, struct file *out, size_t len, unsigned int flags) { - struct pipe_inode_info *ipipe = pipe_info(in->f_dentry->d_inode); - struct pipe_inode_info *opipe = pipe_info(out->f_dentry->d_inode); + struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe; + struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe; int ret = -EINVAL; /*