[DCCP]: fix memory leak and clean up style - dccp_feat_empty_confirm()
[cascardo/linux.git] / fs / splice.c
index 6ddd032..c010a72 100644 (file)
@@ -164,7 +164,7 @@ static const struct pipe_buf_operations user_page_pipe_buf_ops = {
  * @spd:       data to fill
  *
  * Description:
- *    @spd contains a map of pages and len/offset tupples, a long with
+ *    @spd contains a map of pages and len/offset tuples, along with
  *    the struct pipe_buf_operations associated with these pages. This
  *    function will link that data to the pipe.
  *
@@ -295,8 +295,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
         * readahead/allocate the rest and fill in the holes.
         */
        if (spd.nr_pages < nr_pages)
-               page_cache_readahead_ondemand(mapping, &in->f_ra, in,
-                               NULL, index, req_pages - spd.nr_pages);
+               page_cache_sync_readahead(mapping, &in->f_ra, in,
+                               index, req_pages - spd.nr_pages);
 
        error = 0;
        while (spd.nr_pages < nr_pages) {
@@ -352,7 +352,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
                page = pages[page_nr];
 
                if (PageReadahead(page))
-                       page_cache_readahead_ondemand(mapping, &in->f_ra, in,
+                       page_cache_async_readahead(mapping, &in->f_ra, in,
                                        page, index, req_pages - page_nr);
 
                /*
@@ -594,7 +594,7 @@ find_page:
                ret = add_to_page_cache_lru(page, mapping, index,
                                            GFP_KERNEL);
                if (unlikely(ret))
-                       goto out;
+                       goto out_release;
        }
 
        ret = mapping->a_ops->prepare_write(file, page, offset, offset+this_len);
@@ -650,8 +650,9 @@ find_page:
         */
        mark_page_accessed(page);
 out:
-       page_cache_release(page);
        unlock_page(page);
+out_release:
+       page_cache_release(page);
 out_ret:
        return ret;
 }
@@ -999,7 +1000,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
  * Description:
  *    This is a special case helper to splice directly between two
  *    points, without requiring an explicit pipe. Internally an allocated
- *    pipe is cached in the process, and reused during the life time of
+ *    pipe is cached in the process, and reused during the lifetime of
  *    that process.
  *
  */