rxrpc: Static arrays of strings should be const char *const[]
[cascardo/linux.git] / fs / ntfs / file.c
index bed4d42..91117ad 100644 (file)
@@ -220,8 +220,8 @@ do_non_resident_extend:
                m = NULL;
        }
        mapping = vi->i_mapping;
-       index = old_init_size >> PAGE_CACHE_SHIFT;
-       end_index = (new_init_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+       index = old_init_size >> PAGE_SHIFT;
+       end_index = (new_init_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
        do {
                /*
                 * Read the page.  If the page is not present, this will zero
@@ -233,7 +233,7 @@ do_non_resident_extend:
                        goto init_err_out;
                }
                if (unlikely(PageError(page))) {
-                       page_cache_release(page);
+                       put_page(page);
                        err = -EIO;
                        goto init_err_out;
                }
@@ -242,13 +242,13 @@ do_non_resident_extend:
                 * enough to make ntfs_writepage() work.
                 */
                write_lock_irqsave(&ni->size_lock, flags);
-               ni->initialized_size = (s64)(index + 1) << PAGE_CACHE_SHIFT;
+               ni->initialized_size = (s64)(index + 1) << PAGE_SHIFT;
                if (ni->initialized_size > new_init_size)
                        ni->initialized_size = new_init_size;
                write_unlock_irqrestore(&ni->size_lock, flags);
                /* Set the page dirty so it gets written out. */
                set_page_dirty(page);
-               page_cache_release(page);
+               put_page(page);
                /*
                 * Play nice with the vm and the rest of the system.  This is
                 * very much needed as we can potentially be modifying the
@@ -543,7 +543,7 @@ out:
 err_out:
        while (nr > 0) {
                unlock_page(pages[--nr]);
-               page_cache_release(pages[nr]);
+               put_page(pages[nr]);
        }
        goto out;
 }
@@ -573,7 +573,7 @@ static inline int ntfs_submit_bh_for_read(struct buffer_head *bh)
  * only partially being written to.
  *
  * If @nr_pages is greater than one, we are guaranteed that the cluster size is
- * greater than PAGE_CACHE_SIZE, that all pages in @pages are entirely inside
+ * greater than PAGE_SIZE, that all pages in @pages are entirely inside
  * the same cluster and that they are the entirety of that cluster, and that
  * the cluster is sparse, i.e. we need to allocate a cluster to fill the hole.
  *
@@ -653,7 +653,7 @@ static int ntfs_prepare_pages_for_non_resident_write(struct page **pages,
        u = 0;
 do_next_page:
        page = pages[u];
-       bh_pos = (s64)page->index << PAGE_CACHE_SHIFT;
+       bh_pos = (s64)page->index << PAGE_SHIFT;
        bh = head = page_buffers(page);
        do {
                VCN cdelta;
@@ -810,11 +810,11 @@ map_buffer_cached:
                                        
                                kaddr = kmap_atomic(page);
                                if (bh_pos < pos) {
-                                       pofs = bh_pos & ~PAGE_CACHE_MASK;
+                                       pofs = bh_pos & ~PAGE_MASK;
                                        memset(kaddr + pofs, 0, pos - bh_pos);
                                }
                                if (bh_end > end) {
-                                       pofs = end & ~PAGE_CACHE_MASK;
+                                       pofs = end & ~PAGE_MASK;
                                        memset(kaddr + pofs, 0, bh_end - end);
                                }
                                kunmap_atomic(kaddr);
@@ -942,7 +942,7 @@ rl_not_mapped_enoent:
                 * unmapped.  This can only happen when the cluster size is
                 * less than the page cache size.
                 */
-               if (unlikely(vol->cluster_size < PAGE_CACHE_SIZE)) {
+               if (unlikely(vol->cluster_size < PAGE_SIZE)) {
                        bh_cend = (bh_end + vol->cluster_size - 1) >>
                                        vol->cluster_size_bits;
                        if ((bh_cend <= cpos || bh_cpos >= cend)) {
@@ -1208,7 +1208,7 @@ rl_not_mapped_enoent:
                wait_on_buffer(bh);
                if (likely(buffer_uptodate(bh))) {
                        page = bh->b_page;
-                       bh_pos = ((s64)page->index << PAGE_CACHE_SHIFT) +
+                       bh_pos = ((s64)page->index << PAGE_SHIFT) +
                                        bh_offset(bh);
                        /*
                         * If the buffer overflows the initialized size, need
@@ -1350,7 +1350,7 @@ rl_not_mapped_enoent:
                bh = head = page_buffers(page);
                do {
                        if (u == nr_pages &&
-                                       ((s64)page->index << PAGE_CACHE_SHIFT) +
+                                       ((s64)page->index << PAGE_SHIFT) +
                                        bh_offset(bh) >= end)
                                break;
                        if (!buffer_new(bh))
@@ -1422,7 +1422,7 @@ static inline int ntfs_commit_pages_after_non_resident_write(
                bool partial;
 
                page = pages[u];
-               bh_pos = (s64)page->index << PAGE_CACHE_SHIFT;
+               bh_pos = (s64)page->index << PAGE_SHIFT;
                bh = head = page_buffers(page);
                partial = false;
                do {
@@ -1639,7 +1639,7 @@ static int ntfs_commit_pages_after_write(struct page **pages,
                if (end < attr_len)
                        memcpy(kaddr + end, kattr + end, attr_len - end);
                /* Zero the region outside the end of the attribute value. */
-               memset(kaddr + attr_len, 0, PAGE_CACHE_SIZE - attr_len);
+               memset(kaddr + attr_len, 0, PAGE_SIZE - attr_len);
                flush_dcache_page(page);
                SetPageUptodate(page);
        }
@@ -1706,7 +1706,7 @@ static size_t ntfs_copy_from_user_iter(struct page **pages, unsigned nr_pages,
        unsigned len, copied;
 
        do {
-               len = PAGE_CACHE_SIZE - ofs;
+               len = PAGE_SIZE - ofs;
                if (len > bytes)
                        len = bytes;
                copied = iov_iter_copy_from_user_atomic(*pages, &data, ofs,
@@ -1724,14 +1724,14 @@ out:
        return total;
 err:
        /* Zero the rest of the target like __copy_from_user(). */
-       len = PAGE_CACHE_SIZE - copied;
+       len = PAGE_SIZE - copied;
        do {
                if (len > bytes)
                        len = bytes;
                zero_user(*pages, copied, len);
                bytes -= len;
                copied = 0;
-               len = PAGE_CACHE_SIZE;
+               len = PAGE_SIZE;
        } while (++pages < last_page);
        goto out;
 }
@@ -1787,8 +1787,8 @@ static ssize_t ntfs_perform_write(struct file *file, struct iov_iter *i,
         * attributes.
         */
        nr_pages = 1;
-       if (vol->cluster_size > PAGE_CACHE_SIZE && NInoNonResident(ni))
-               nr_pages = vol->cluster_size >> PAGE_CACHE_SHIFT;
+       if (vol->cluster_size > PAGE_SIZE && NInoNonResident(ni))
+               nr_pages = vol->cluster_size >> PAGE_SHIFT;
        last_vcn = -1;
        do {
                VCN vcn;
@@ -1796,9 +1796,9 @@ static ssize_t ntfs_perform_write(struct file *file, struct iov_iter *i,
                unsigned ofs, do_pages, u;
                size_t copied;
 
-               start_idx = idx = pos >> PAGE_CACHE_SHIFT;
-               ofs = pos & ~PAGE_CACHE_MASK;
-               bytes = PAGE_CACHE_SIZE - ofs;
+               start_idx = idx = pos >> PAGE_SHIFT;
+               ofs = pos & ~PAGE_MASK;
+               bytes = PAGE_SIZE - ofs;
                do_pages = 1;
                if (nr_pages > 1) {
                        vcn = pos >> vol->cluster_size_bits;
@@ -1832,7 +1832,7 @@ static ssize_t ntfs_perform_write(struct file *file, struct iov_iter *i,
                                if (lcn == LCN_HOLE) {
                                        start_idx = (pos & ~(s64)
                                                        vol->cluster_size_mask)
-                                                       >> PAGE_CACHE_SHIFT;
+                                                       >> PAGE_SHIFT;
                                        bytes = vol->cluster_size - (pos &
                                                        vol->cluster_size_mask);
                                        do_pages = nr_pages;
@@ -1871,12 +1871,12 @@ again:
                        if (unlikely(status)) {
                                do {
                                        unlock_page(pages[--do_pages]);
-                                       page_cache_release(pages[do_pages]);
+                                       put_page(pages[do_pages]);
                                } while (do_pages);
                                break;
                        }
                }
-               u = (pos >> PAGE_CACHE_SHIFT) - pages[0]->index;
+               u = (pos >> PAGE_SHIFT) - pages[0]->index;
                copied = ntfs_copy_from_user_iter(pages + u, do_pages - u, ofs,
                                        i, bytes);
                ntfs_flush_dcache_pages(pages + u, do_pages - u);
@@ -1889,7 +1889,7 @@ again:
                }
                do {
                        unlock_page(pages[--do_pages]);
-                       page_cache_release(pages[do_pages]);
+                       put_page(pages[do_pages]);
                } while (do_pages);
                if (unlikely(status < 0))
                        break;
@@ -1921,7 +1921,7 @@ again:
                }
        } while (iov_iter_count(i));
        if (cached_page)
-               page_cache_release(cached_page);
+               put_page(cached_page);
        ntfs_debug("Done.  Returning %s (written 0x%lx, status %li).",
                        written ? "written" : "status", (unsigned long)written,
                        (long)status);