Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 May 2016 17:08:45 +0000 (10:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 May 2016 17:08:45 +0000 (10:08 -0700)
Pull remaining vfs xattr work from Al Viro:
 "The rest of work.xattr (non-cifs conversions)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  btrfs: Switch to generic xattr handlers
  ubifs: Switch to generic xattr handlers
  jfs: Switch to generic xattr handlers
  jfs: Clean up xattr name mapping
  gfs2: Switch to generic xattr handlers
  ceph: kill __ceph_removexattr()
  ceph: Switch to generic xattr handlers
  ceph: Get rid of d_find_alias in ceph_set_acl

1  2 
fs/btrfs/inode.c
fs/ceph/dir.c
fs/ceph/inode.c
fs/jfs/namei.c
fs/ubifs/dir.c
fs/ubifs/file.c
fs/ubifs/super.c
fs/ubifs/ubifs.h

diff --combined fs/btrfs/inode.c
@@@ -194,7 -194,7 +194,7 @@@ static int insert_inline_extent(struct 
                while (compressed_size > 0) {
                        cpage = compressed_pages[i];
                        cur_size = min_t(unsigned long, compressed_size,
 -                                     PAGE_CACHE_SIZE);
 +                                     PAGE_SIZE);
  
                        kaddr = kmap_atomic(cpage);
                        write_extent_buffer(leaf, kaddr, ptr, cur_size);
                                                  compress_type);
        } else {
                page = find_get_page(inode->i_mapping,
 -                                   start >> PAGE_CACHE_SHIFT);
 +                                   start >> PAGE_SHIFT);
                btrfs_set_file_extent_compression(leaf, ei, 0);
                kaddr = kmap_atomic(page);
 -              offset = start & (PAGE_CACHE_SIZE - 1);
 +              offset = start & (PAGE_SIZE - 1);
                write_extent_buffer(leaf, kaddr + offset, ptr, size);
                kunmap_atomic(kaddr);
 -              page_cache_release(page);
 +              put_page(page);
        }
        btrfs_mark_buffer_dirty(leaf);
        btrfs_release_path(path);
@@@ -322,7 -322,7 +322,7 @@@ out
         * And at reserve time, it's always aligned to page size, so
         * just free one page here.
         */
 -      btrfs_qgroup_free_data(inode, 0, PAGE_CACHE_SIZE);
 +      btrfs_qgroup_free_data(inode, 0, PAGE_SIZE);
        btrfs_free_path(path);
        btrfs_end_transaction(trans, root);
        return ret;
@@@ -435,8 -435,8 +435,8 @@@ static noinline void compress_file_rang
        actual_end = min_t(u64, isize, end + 1);
  again:
        will_compress = 0;
 -      nr_pages = (end >> PAGE_CACHE_SHIFT) - (start >> PAGE_CACHE_SHIFT) + 1;
 -      nr_pages = min_t(unsigned long, nr_pages, SZ_128K / PAGE_CACHE_SIZE);
 +      nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1;
 +      nr_pages = min_t(unsigned long, nr_pages, SZ_128K / PAGE_SIZE);
  
        /*
         * we don't want to send crud past the end of i_size through
  
                if (!ret) {
                        unsigned long offset = total_compressed &
 -                              (PAGE_CACHE_SIZE - 1);
 +                              (PAGE_SIZE - 1);
                        struct page *page = pages[nr_pages_ret - 1];
                        char *kaddr;
  
                        if (offset) {
                                kaddr = kmap_atomic(page);
                                memset(kaddr + offset, 0,
 -                                     PAGE_CACHE_SIZE - offset);
 +                                     PAGE_SIZE - offset);
                                kunmap_atomic(kaddr);
                        }
                        will_compress = 1;
@@@ -580,7 -580,7 +580,7 @@@ cont
                 * one last check to make sure the compression is really a
                 * win, compare the page count read with the blocks on disk
                 */
 -              total_in = ALIGN(total_in, PAGE_CACHE_SIZE);
 +              total_in = ALIGN(total_in, PAGE_SIZE);
                if (total_compressed >= total_in) {
                        will_compress = 0;
                } else {
                 */
                for (i = 0; i < nr_pages_ret; i++) {
                        WARN_ON(pages[i]->mapping);
 -                      page_cache_release(pages[i]);
 +                      put_page(pages[i]);
                }
                kfree(pages);
                pages = NULL;
@@@ -650,7 -650,7 +650,7 @@@ cleanup_and_bail_uncompressed
  free_pages_out:
        for (i = 0; i < nr_pages_ret; i++) {
                WARN_ON(pages[i]->mapping);
 -              page_cache_release(pages[i]);
 +              put_page(pages[i]);
        }
        kfree(pages);
  }
@@@ -664,7 -664,7 +664,7 @@@ static void free_async_extent_pages(str
  
        for (i = 0; i < async_extent->nr_pages; i++) {
                WARN_ON(async_extent->pages[i]->mapping);
 -              page_cache_release(async_extent->pages[i]);
 +              put_page(async_extent->pages[i]);
        }
        kfree(async_extent->pages);
        async_extent->nr_pages = 0;
@@@ -966,7 -966,7 +966,7 @@@ static noinline int cow_file_range(stru
                                     PAGE_END_WRITEBACK);
  
                        *nr_written = *nr_written +
 -                           (end - start + PAGE_CACHE_SIZE) / PAGE_CACHE_SIZE;
 +                           (end - start + PAGE_SIZE) / PAGE_SIZE;
                        *page_started = 1;
                        goto out;
                } else if (ret < 0) {
@@@ -1106,8 -1106,8 +1106,8 @@@ static noinline void async_cow_submit(s
        async_cow = container_of(work, struct async_cow, work);
  
        root = async_cow->root;
 -      nr_pages = (async_cow->end - async_cow->start + PAGE_CACHE_SIZE) >>
 -              PAGE_CACHE_SHIFT;
 +      nr_pages = (async_cow->end - async_cow->start + PAGE_SIZE) >>
 +              PAGE_SHIFT;
  
        /*
         * atomic_sub_return implies a barrier for waitqueue_active
@@@ -1164,8 -1164,8 +1164,8 @@@ static int cow_file_range_async(struct 
                                async_cow_start, async_cow_submit,
                                async_cow_free);
  
 -              nr_pages = (cur_end - start + PAGE_CACHE_SIZE) >>
 -                      PAGE_CACHE_SHIFT;
 +              nr_pages = (cur_end - start + PAGE_SIZE) >>
 +                      PAGE_SHIFT;
                atomic_add(nr_pages, &root->fs_info->async_delalloc_pages);
  
                btrfs_queue_work(root->fs_info->delalloc_workers,
@@@ -1960,7 -1960,7 +1960,7 @@@ static noinline int add_pending_csums(s
  int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
                              struct extent_state **cached_state)
  {
 -      WARN_ON((end & (PAGE_CACHE_SIZE - 1)) == 0);
 +      WARN_ON((end & (PAGE_SIZE - 1)) == 0);
        return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end,
                                   cached_state, GFP_NOFS);
  }
@@@ -1993,7 -1993,7 +1993,7 @@@ again
  
        inode = page->mapping->host;
        page_start = page_offset(page);
 -      page_end = page_offset(page) + PAGE_CACHE_SIZE - 1;
 +      page_end = page_offset(page) + PAGE_SIZE - 1;
  
        lock_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end,
                         &cached_state);
                goto out;
  
        ordered = btrfs_lookup_ordered_range(inode, page_start,
 -                                      PAGE_CACHE_SIZE);
 +                                      PAGE_SIZE);
        if (ordered) {
                unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start,
                                     page_end, &cached_state, GFP_NOFS);
        }
  
        ret = btrfs_delalloc_reserve_space(inode, page_start,
 -                                         PAGE_CACHE_SIZE);
 +                                         PAGE_SIZE);
        if (ret) {
                mapping_set_error(page->mapping, ret);
                end_extent_writepage(page, ret, page_start, page_end);
@@@ -2030,7 -2030,7 +2030,7 @@@ out
                             &cached_state, GFP_NOFS);
  out_page:
        unlock_page(page);
 -      page_cache_release(page);
 +      put_page(page);
        kfree(fixup);
  }
  
@@@ -2063,7 -2063,7 +2063,7 @@@ static int btrfs_writepage_start_hook(s
                return -EAGAIN;
  
        SetPageChecked(page);
 -      page_cache_get(page);
 +      get_page(page);
        btrfs_init_work(&fixup->work, btrfs_fixup_helper,
                        btrfs_writepage_fixup_worker, NULL, NULL);
        fixup->page = page;
@@@ -4247,7 -4247,7 +4247,7 @@@ static int truncate_inline_extent(struc
  
        if (btrfs_file_extent_compression(leaf, fi) != BTRFS_COMPRESS_NONE) {
                loff_t offset = new_size;
 -              loff_t page_end = ALIGN(offset, PAGE_CACHE_SIZE);
 +              loff_t page_end = ALIGN(offset, PAGE_SIZE);
  
                /*
                 * Zero out the remaining of the last page of our inline extent,
@@@ -4633,7 -4633,7 +4633,7 @@@ int btrfs_truncate_block(struct inode *
        struct extent_state *cached_state = NULL;
        char *kaddr;
        u32 blocksize = root->sectorsize;
 -      pgoff_t index = from >> PAGE_CACHE_SHIFT;
 +      pgoff_t index = from >> PAGE_SHIFT;
        unsigned offset = from & (blocksize - 1);
        struct page *page;
        gfp_t mask = btrfs_alloc_write_mask(mapping);
@@@ -4668,7 -4668,7 +4668,7 @@@ again
                lock_page(page);
                if (page->mapping != mapping) {
                        unlock_page(page);
 -                      page_cache_release(page);
 +                      put_page(page);
                        goto again;
                }
                if (!PageUptodate(page)) {
                unlock_extent_cached(io_tree, block_start, block_end,
                                     &cached_state, GFP_NOFS);
                unlock_page(page);
 -              page_cache_release(page);
 +              put_page(page);
                btrfs_start_ordered_extent(inode, ordered, 1);
                btrfs_put_ordered_extent(ordered);
                goto again;
@@@ -4728,7 -4728,7 +4728,7 @@@ out_unlock
                btrfs_delalloc_release_space(inode, block_start,
                                             blocksize);
        unlock_page(page);
 -      page_cache_release(page);
 +      put_page(page);
  out:
        return ret;
  }
@@@ -6717,7 -6717,7 +6717,7 @@@ static noinline int uncompress_inline(s
  
        read_extent_buffer(leaf, tmp, ptr, inline_size);
  
 -      max_size = min_t(unsigned long, PAGE_CACHE_SIZE, max_size);
 +      max_size = min_t(unsigned long, PAGE_SIZE, max_size);
        ret = btrfs_decompress(compress_type, tmp, page,
                               extent_offset, inline_size, max_size);
        kfree(tmp);
@@@ -6879,8 -6879,8 +6879,8 @@@ next
  
                size = btrfs_file_extent_inline_len(leaf, path->slots[0], item);
                extent_offset = page_offset(page) + pg_offset - extent_start;
 -              copy_size = min_t(u64, PAGE_CACHE_SIZE - pg_offset,
 -                              size - extent_offset);
 +              copy_size = min_t(u64, PAGE_SIZE - pg_offset,
 +                                size - extent_offset);
                em->start = extent_start + extent_offset;
                em->len = ALIGN(copy_size, root->sectorsize);
                em->orig_block_len = em->len;
                                map = kmap(page);
                                read_extent_buffer(leaf, map + pg_offset, ptr,
                                                   copy_size);
 -                              if (pg_offset + copy_size < PAGE_CACHE_SIZE) {
 +                              if (pg_offset + copy_size < PAGE_SIZE) {
                                        memset(map + pg_offset + copy_size, 0,
 -                                             PAGE_CACHE_SIZE - pg_offset -
 +                                             PAGE_SIZE - pg_offset -
                                               copy_size);
                                }
                                kunmap(page);
@@@ -7336,12 -7336,12 +7336,12 @@@ bool btrfs_page_exists_in_range(struct 
        int start_idx;
        int end_idx;
  
 -      start_idx = start >> PAGE_CACHE_SHIFT;
 +      start_idx = start >> PAGE_SHIFT;
  
        /*
         * end is the last byte in the last page.  end == start is legal
         */
 -      end_idx = end >> PAGE_CACHE_SHIFT;
 +      end_idx = end >> PAGE_SHIFT;
  
        rcu_read_lock();
  
                 * include/linux/pagemap.h for details.
                 */
                if (unlikely(page != *pagep)) {
 -                      page_cache_release(page);
 +                      put_page(page);
                        page = NULL;
                }
        }
        if (page) {
                if (page->index <= end_idx)
                        found = true;
 -              page_cache_release(page);
 +              put_page(page);
        }
  
        rcu_read_unlock();
        return retval;
  }
  
 -static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
 -                             loff_t offset)
 +static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
  {
        struct file *file = iocb->ki_filp;
        struct inode *inode = file->f_mapping->host;
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_dio_data dio_data = { 0 };
 +      loff_t offset = iocb->ki_pos;
        size_t count = 0;
        int flags = 0;
        bool wakeup = true;
  
        ret = __blockdev_direct_IO(iocb, inode,
                                   BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev,
 -                                 iter, offset, btrfs_get_blocks_direct, NULL,
 +                                 iter, btrfs_get_blocks_direct, NULL,
                                   btrfs_submit_direct, flags);
        if (iov_iter_rw(iter) == WRITE) {
                current->journal_info = NULL;
@@@ -8719,7 -8719,7 +8719,7 @@@ static int __btrfs_releasepage(struct p
        if (ret == 1) {
                ClearPagePrivate(page);
                set_page_private(page, 0);
 -              page_cache_release(page);
 +              put_page(page);
        }
        return ret;
  }
@@@ -8739,7 -8739,7 +8739,7 @@@ static void btrfs_invalidatepage(struc
        struct btrfs_ordered_extent *ordered;
        struct extent_state *cached_state = NULL;
        u64 page_start = page_offset(page);
 -      u64 page_end = page_start + PAGE_CACHE_SIZE - 1;
 +      u64 page_end = page_start + PAGE_SIZE - 1;
        u64 start;
        u64 end;
        int inode_evicting = inode->i_state & I_FREEING;
@@@ -8822,7 -8822,7 +8822,7 @@@ again
         * 2) Not written to disk
         *    This means the reserved space should be freed here.
         */
 -      btrfs_qgroup_free_data(inode, page_start, PAGE_CACHE_SIZE);
 +      btrfs_qgroup_free_data(inode, page_start, PAGE_SIZE);
        if (!inode_evicting) {
                clear_extent_bit(tree, page_start, page_end,
                                 EXTENT_LOCKED | EXTENT_DIRTY |
        if (PagePrivate(page)) {
                ClearPagePrivate(page);
                set_page_private(page, 0);
 -              page_cache_release(page);
 +              put_page(page);
        }
  }
  
@@@ -8874,11 -8874,11 +8874,11 @@@ int btrfs_page_mkwrite(struct vm_area_s
        u64 page_end;
        u64 end;
  
 -      reserved_space = PAGE_CACHE_SIZE;
 +      reserved_space = PAGE_SIZE;
  
        sb_start_pagefault(inode->i_sb);
        page_start = page_offset(page);
 -      page_end = page_start + PAGE_CACHE_SIZE - 1;
 +      page_end = page_start + PAGE_SIZE - 1;
        end = page_end;
  
        /*
@@@ -8934,15 -8934,15 +8934,15 @@@ again
                goto again;
        }
  
 -      if (page->index == ((size - 1) >> PAGE_CACHE_SHIFT)) {
 +      if (page->index == ((size - 1) >> PAGE_SHIFT)) {
                reserved_space = round_up(size - page_start, root->sectorsize);
 -              if (reserved_space < PAGE_CACHE_SIZE) {
 +              if (reserved_space < PAGE_SIZE) {
                        end = page_start + reserved_space - 1;
                        spin_lock(&BTRFS_I(inode)->lock);
                        BTRFS_I(inode)->outstanding_extents++;
                        spin_unlock(&BTRFS_I(inode)->lock);
                        btrfs_delalloc_release_space(inode, page_start,
 -                                              PAGE_CACHE_SIZE - reserved_space);
 +                                              PAGE_SIZE - reserved_space);
                }
        }
  
        ret = 0;
  
        /* page is wholly or partially inside EOF */
 -      if (page_start + PAGE_CACHE_SIZE > size)
 -              zero_start = size & ~PAGE_CACHE_MASK;
 +      if (page_start + PAGE_SIZE > size)
 +              zero_start = size & ~PAGE_MASK;
        else
 -              zero_start = PAGE_CACHE_SIZE;
 +              zero_start = PAGE_SIZE;
  
 -      if (zero_start != PAGE_CACHE_SIZE) {
 +      if (zero_start != PAGE_SIZE) {
                kaddr = kmap(page);
 -              memset(kaddr + zero_start, 0, PAGE_CACHE_SIZE - zero_start);
 +              memset(kaddr + zero_start, 0, PAGE_SIZE - zero_start);
                flush_dcache_page(page);
                kunmap(page);
        }
@@@ -10160,10 -10160,10 +10160,10 @@@ static const struct inode_operations bt
        .symlink        = btrfs_symlink,
        .setattr        = btrfs_setattr,
        .mknod          = btrfs_mknod,
-       .setxattr       = btrfs_setxattr,
+       .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = btrfs_listxattr,
-       .removexattr    = btrfs_removexattr,
+       .removexattr    = generic_removexattr,
        .permission     = btrfs_permission,
        .get_acl        = btrfs_get_acl,
        .set_acl        = btrfs_set_acl,
@@@ -10181,7 -10181,7 +10181,7 @@@ static const struct inode_operations bt
  static const struct file_operations btrfs_dir_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
 -      .iterate        = btrfs_real_readdir,
 +      .iterate_shared = btrfs_real_readdir,
        .unlocked_ioctl = btrfs_ioctl,
  #ifdef CONFIG_COMPAT
        .compat_ioctl   = btrfs_ioctl,
@@@ -10237,10 -10237,10 +10237,10 @@@ static const struct address_space_opera
  static const struct inode_operations btrfs_file_inode_operations = {
        .getattr        = btrfs_getattr,
        .setattr        = btrfs_setattr,
-       .setxattr       = btrfs_setxattr,
+       .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = btrfs_listxattr,
-       .removexattr    = btrfs_removexattr,
+       .removexattr    = generic_removexattr,
        .permission     = btrfs_permission,
        .fiemap         = btrfs_fiemap,
        .get_acl        = btrfs_get_acl,
@@@ -10251,10 -10251,10 +10251,10 @@@ static const struct inode_operations bt
        .getattr        = btrfs_getattr,
        .setattr        = btrfs_setattr,
        .permission     = btrfs_permission,
-       .setxattr       = btrfs_setxattr,
+       .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = btrfs_listxattr,
-       .removexattr    = btrfs_removexattr,
+       .removexattr    = generic_removexattr,
        .get_acl        = btrfs_get_acl,
        .set_acl        = btrfs_set_acl,
        .update_time    = btrfs_update_time,
@@@ -10265,10 -10265,10 +10265,10 @@@ static const struct inode_operations bt
        .getattr        = btrfs_getattr,
        .setattr        = btrfs_setattr,
        .permission     = btrfs_permission,
-       .setxattr       = btrfs_setxattr,
+       .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = btrfs_listxattr,
-       .removexattr    = btrfs_removexattr,
+       .removexattr    = generic_removexattr,
        .update_time    = btrfs_update_time,
  };
  
diff --combined fs/ceph/dir.c
@@@ -5,6 -5,7 +5,7 @@@
  #include <linux/namei.h>
  #include <linux/slab.h>
  #include <linux/sched.h>
+ #include <linux/xattr.h>
  
  #include "super.h"
  #include "mds_client.h"
@@@ -129,7 -130,7 +130,7 @@@ static int __dcache_readdir(struct fil
        struct inode *dir = d_inode(parent);
        struct dentry *dentry, *last = NULL;
        struct ceph_dentry_info *di;
 -      unsigned nsize = PAGE_CACHE_SIZE / sizeof(struct dentry *);
 +      unsigned nsize = PAGE_SIZE / sizeof(struct dentry *);
        int err = 0;
        loff_t ptr_pos = 0;
        struct ceph_readdir_cache_control cache_ctl = {};
                }
  
                err = -EAGAIN;
 -              pgoff = ptr_pos >> PAGE_CACHE_SHIFT;
 +              pgoff = ptr_pos >> PAGE_SHIFT;
                if (!cache_ctl.page || pgoff != page_index(cache_ctl.page)) {
                        ceph_readdir_cache_release(&cache_ctl);
                        cache_ctl.page = find_lock_page(&dir->i_data, pgoff);
@@@ -1342,10 -1343,10 +1343,10 @@@ const struct inode_operations ceph_dir_
        .permission = ceph_permission,
        .getattr = ceph_getattr,
        .setattr = ceph_setattr,
-       .setxattr = ceph_setxattr,
-       .getxattr = ceph_getxattr,
+       .setxattr = generic_setxattr,
+       .getxattr = generic_getxattr,
        .listxattr = ceph_listxattr,
-       .removexattr = ceph_removexattr,
+       .removexattr = generic_removexattr,
        .get_acl = ceph_get_acl,
        .set_acl = ceph_set_acl,
        .mknod = ceph_mknod,
diff --combined fs/ceph/inode.c
@@@ -8,6 -8,7 +8,7 @@@
  #include <linux/kernel.h>
  #include <linux/writeback.h>
  #include <linux/vmalloc.h>
+ #include <linux/xattr.h>
  #include <linux/posix_acl.h>
  #include <linux/random.h>
  
@@@ -92,10 -93,10 +93,10 @@@ const struct inode_operations ceph_file
        .permission = ceph_permission,
        .setattr = ceph_setattr,
        .getattr = ceph_getattr,
-       .setxattr = ceph_setxattr,
-       .getxattr = ceph_getxattr,
+       .setxattr = generic_setxattr,
+       .getxattr = generic_getxattr,
        .listxattr = ceph_listxattr,
-       .removexattr = ceph_removexattr,
+       .removexattr = generic_removexattr,
        .get_acl = ceph_get_acl,
        .set_acl = ceph_set_acl,
  };
@@@ -1338,7 -1339,7 +1339,7 @@@ void ceph_readdir_cache_release(struct 
  {
        if (ctl->page) {
                kunmap(ctl->page);
 -              page_cache_release(ctl->page);
 +              put_page(ctl->page);
                ctl->page = NULL;
        }
  }
@@@ -1348,7 -1349,7 +1349,7 @@@ static int fill_readdir_cache(struct in
                              struct ceph_mds_request *req)
  {
        struct ceph_inode_info *ci = ceph_inode(dir);
 -      unsigned nsize = PAGE_CACHE_SIZE / sizeof(struct dentry*);
 +      unsigned nsize = PAGE_SIZE / sizeof(struct dentry*);
        unsigned idx = ctl->index % nsize;
        pgoff_t pgoff = ctl->index / nsize;
  
                unlock_page(ctl->page);
                ctl->dentries = kmap(ctl->page);
                if (idx == 0)
 -                      memset(ctl->dentries, 0, PAGE_CACHE_SIZE);
 +                      memset(ctl->dentries, 0, PAGE_SIZE);
        }
  
        if (req->r_dir_release_cnt == atomic64_read(&ci->i_release_count) &&
@@@ -1770,22 -1771,18 +1771,18 @@@ static const struct inode_operations ce
        .get_link = simple_get_link,
        .setattr = ceph_setattr,
        .getattr = ceph_getattr,
-       .setxattr = ceph_setxattr,
-       .getxattr = ceph_getxattr,
+       .setxattr = generic_setxattr,
+       .getxattr = generic_getxattr,
        .listxattr = ceph_listxattr,
-       .removexattr = ceph_removexattr,
+       .removexattr = generic_removexattr,
  };
  
- /*
-  * setattr
-  */
- int ceph_setattr(struct dentry *dentry, struct iattr *attr)
+ int __ceph_setattr(struct inode *inode, struct iattr *attr)
  {
-       struct inode *inode = d_inode(dentry);
        struct ceph_inode_info *ci = ceph_inode(inode);
        const unsigned int ia_valid = attr->ia_valid;
        struct ceph_mds_request *req;
-       struct ceph_mds_client *mdsc = ceph_sb_to_client(dentry->d_sb)->mdsc;
+       struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
        struct ceph_cap_flush *prealloc_cf;
        int issued;
        int release = 0, dirtied = 0;
@@@ -2009,6 -2006,14 +2006,14 @@@ out_put
        return err;
  }
  
+ /*
+  * setattr
+  */
+ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
+ {
+       return __ceph_setattr(d_inode(dentry), attr);
+ }
  /*
   * Verify that we have a lease on the given mask.  If not,
   * do a getattr against an mds.
diff --combined fs/jfs/namei.c
@@@ -1225,8 -1225,8 +1225,8 @@@ static int jfs_rename(struct inode *old
                rc = dtSearch(new_dir, &new_dname, &ino, &btstack,
                              JFS_CREATE);
                if (rc) {
 -                      jfs_err("jfs_rename didn't expect dtSearch to fail "
 -                              "w/rc = %d", rc);
 +                      jfs_err("jfs_rename didn't expect dtSearch to fail w/rc = %d",
 +                              rc);
                        goto out_tx;
                }
  
@@@ -1537,10 -1537,10 +1537,10 @@@ const struct inode_operations jfs_dir_i
        .rmdir          = jfs_rmdir,
        .mknod          = jfs_mknod,
        .rename         = jfs_rename,
-       .setxattr       = jfs_setxattr,
-       .getxattr       = jfs_getxattr,
+       .setxattr       = generic_setxattr,
+       .getxattr       = generic_getxattr,
        .listxattr      = jfs_listxattr,
-       .removexattr    = jfs_removexattr,
+       .removexattr    = generic_removexattr,
        .setattr        = jfs_setattr,
  #ifdef CONFIG_JFS_POSIX_ACL
        .get_acl        = jfs_get_acl,
diff --combined fs/ubifs/dir.c
@@@ -1182,10 -1182,10 +1182,10 @@@ const struct inode_operations ubifs_dir
        .rename      = ubifs_rename,
        .setattr     = ubifs_setattr,
        .getattr     = ubifs_getattr,
-       .setxattr    = ubifs_setxattr,
-       .getxattr    = ubifs_getxattr,
+       .setxattr    = generic_setxattr,
+       .getxattr    = generic_getxattr,
        .listxattr   = ubifs_listxattr,
-       .removexattr = ubifs_removexattr,
+       .removexattr = generic_removexattr,
  #ifdef CONFIG_UBIFS_ATIME_SUPPORT
        .update_time = ubifs_update_time,
  #endif
@@@ -1195,7 -1195,7 +1195,7 @@@ const struct file_operations ubifs_dir_
        .llseek         = generic_file_llseek,
        .release        = ubifs_dir_release,
        .read           = generic_read_dir,
 -      .iterate        = ubifs_readdir,
 +      .iterate_shared = ubifs_readdir,
        .fsync          = ubifs_fsync,
        .unlocked_ioctl = ubifs_ioctl,
  #ifdef CONFIG_COMPAT
diff --combined fs/ubifs/file.c
@@@ -121,7 -121,7 +121,7 @@@ static int do_readpage(struct page *pag
        if (block >= beyond) {
                /* Reading beyond inode */
                SetPageChecked(page);
 -              memset(addr, 0, PAGE_CACHE_SIZE);
 +              memset(addr, 0, PAGE_SIZE);
                goto out;
        }
  
@@@ -223,7 -223,7 +223,7 @@@ static int write_begin_slow(struct addr
  {
        struct inode *inode = mapping->host;
        struct ubifs_info *c = inode->i_sb->s_fs_info;
 -      pgoff_t index = pos >> PAGE_CACHE_SHIFT;
 +      pgoff_t index = pos >> PAGE_SHIFT;
        struct ubifs_budget_req req = { .new_page = 1 };
        int uninitialized_var(err), appending = !!(pos + len > inode->i_size);
        struct page *page;
        }
  
        if (!PageUptodate(page)) {
 -              if (!(pos & ~PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE)
 +              if (!(pos & ~PAGE_MASK) && len == PAGE_SIZE)
                        SetPageChecked(page);
                else {
                        err = do_readpage(page);
                        if (err) {
                                unlock_page(page);
 -                              page_cache_release(page);
 +                              put_page(page);
                                ubifs_release_budget(c, &req);
                                return err;
                        }
@@@ -428,7 -428,7 +428,7 @@@ static int ubifs_write_begin(struct fil
        struct inode *inode = mapping->host;
        struct ubifs_info *c = inode->i_sb->s_fs_info;
        struct ubifs_inode *ui = ubifs_inode(inode);
 -      pgoff_t index = pos >> PAGE_CACHE_SHIFT;
 +      pgoff_t index = pos >> PAGE_SHIFT;
        int uninitialized_var(err), appending = !!(pos + len > inode->i_size);
        int skipped_read = 0;
        struct page *page;
  
        if (!PageUptodate(page)) {
                /* The page is not loaded from the flash */
 -              if (!(pos & ~PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE) {
 +              if (!(pos & ~PAGE_MASK) && len == PAGE_SIZE) {
                        /*
                         * We change whole page so no need to load it. But we
                         * do not know whether this page exists on the media or
                        err = do_readpage(page);
                        if (err) {
                                unlock_page(page);
 -                              page_cache_release(page);
 +                              put_page(page);
                                return err;
                        }
                }
                        mutex_unlock(&ui->ui_mutex);
                }
                unlock_page(page);
 -              page_cache_release(page);
 +              put_page(page);
  
                return write_begin_slow(mapping, pos, len, pagep, flags);
        }
@@@ -549,12 -549,12 +549,12 @@@ static int ubifs_write_end(struct file 
        dbg_gen("ino %lu, pos %llu, pg %lu, len %u, copied %d, i_size %lld",
                inode->i_ino, pos, page->index, len, copied, inode->i_size);
  
 -      if (unlikely(copied < len && len == PAGE_CACHE_SIZE)) {
 +      if (unlikely(copied < len && len == PAGE_SIZE)) {
                /*
                 * VFS copied less data to the page that it intended and
                 * declared in its '->write_begin()' call via the @len
                 * argument. If the page was not up-to-date, and @len was
 -               * @PAGE_CACHE_SIZE, the 'ubifs_write_begin()' function did
 +               * @PAGE_SIZE, the 'ubifs_write_begin()' function did
                 * not load it from the media (for optimization reasons). This
                 * means that part of the page contains garbage. So read the
                 * page now.
  
  out:
        unlock_page(page);
 -      page_cache_release(page);
 +      put_page(page);
        return copied;
  }
  
@@@ -621,10 -621,10 +621,10 @@@ static int populate_page(struct ubifs_i
  
        addr = zaddr = kmap(page);
  
 -      end_index = (i_size - 1) >> PAGE_CACHE_SHIFT;
 +      end_index = (i_size - 1) >> PAGE_SHIFT;
        if (!i_size || page->index > end_index) {
                hole = 1;
 -              memset(addr, 0, PAGE_CACHE_SIZE);
 +              memset(addr, 0, PAGE_SIZE);
                goto out_hole;
        }
  
        }
  
        if (end_index == page->index) {
 -              int len = i_size & (PAGE_CACHE_SIZE - 1);
 +              int len = i_size & (PAGE_SIZE - 1);
  
                if (len && len < read)
                        memset(zaddr + len, 0, read - len);
@@@ -773,7 -773,7 +773,7 @@@ static int ubifs_do_bulk_read(struct ub
        isize = i_size_read(inode);
        if (isize == 0)
                goto out_free;
 -      end_index = ((isize - 1) >> PAGE_CACHE_SHIFT);
 +      end_index = ((isize - 1) >> PAGE_SHIFT);
  
        for (page_idx = 1; page_idx < page_cnt; page_idx++) {
                pgoff_t page_offset = offset + page_idx;
                if (!PageUptodate(page))
                        err = populate_page(c, page, bu, &n);
                unlock_page(page);
 -              page_cache_release(page);
 +              put_page(page);
                if (err)
                        break;
        }
@@@ -905,7 -905,7 +905,7 @@@ static int do_writepage(struct page *pa
  #ifdef UBIFS_DEBUG
        struct ubifs_inode *ui = ubifs_inode(inode);
        spin_lock(&ui->ui_lock);
 -      ubifs_assert(page->index <= ui->synced_i_size >> PAGE_CACHE_SHIFT);
 +      ubifs_assert(page->index <= ui->synced_i_size >> PAGE_SHIFT);
        spin_unlock(&ui->ui_lock);
  #endif
  
@@@ -1001,8 -1001,8 +1001,8 @@@ static int ubifs_writepage(struct page 
        struct inode *inode = page->mapping->host;
        struct ubifs_inode *ui = ubifs_inode(inode);
        loff_t i_size =  i_size_read(inode), synced_i_size;
 -      pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT;
 -      int err, len = i_size & (PAGE_CACHE_SIZE - 1);
 +      pgoff_t end_index = i_size >> PAGE_SHIFT;
 +      int err, len = i_size & (PAGE_SIZE - 1);
        void *kaddr;
  
        dbg_gen("ino %lu, pg %lu, pg flags %#lx",
  
        /* Is the page fully inside @i_size? */
        if (page->index < end_index) {
 -              if (page->index >= synced_i_size >> PAGE_CACHE_SHIFT) {
 +              if (page->index >= synced_i_size >> PAGE_SHIFT) {
                        err = inode->i_sb->s_op->write_inode(inode, NULL);
                        if (err)
                                goto out_unlock;
                         * with this.
                         */
                }
 -              return do_writepage(page, PAGE_CACHE_SIZE);
 +              return do_writepage(page, PAGE_SIZE);
        }
  
        /*
         * writes to that region are not written out to the file."
         */
        kaddr = kmap_atomic(page);
 -      memset(kaddr + len, 0, PAGE_CACHE_SIZE - len);
 +      memset(kaddr + len, 0, PAGE_SIZE - len);
        flush_dcache_page(page);
        kunmap_atomic(kaddr);
  
@@@ -1138,7 -1138,7 +1138,7 @@@ static int do_truncation(struct ubifs_i
        truncate_setsize(inode, new_size);
  
        if (offset) {
 -              pgoff_t index = new_size >> PAGE_CACHE_SHIFT;
 +              pgoff_t index = new_size >> PAGE_SHIFT;
                struct page *page;
  
                page = find_lock_page(inode->i_mapping, index);
                                clear_page_dirty_for_io(page);
                                if (UBIFS_BLOCKS_PER_PAGE_SHIFT)
                                        offset = new_size &
 -                                               (PAGE_CACHE_SIZE - 1);
 +                                               (PAGE_SIZE - 1);
                                err = do_writepage(page, offset);
 -                              page_cache_release(page);
 +                              put_page(page);
                                if (err)
                                        goto out_budg;
                                /*
                                 * having to read it.
                                 */
                                unlock_page(page);
 -                              page_cache_release(page);
 +                              put_page(page);
                        }
                }
        }
@@@ -1285,7 -1285,7 +1285,7 @@@ static void ubifs_invalidatepage(struc
        struct ubifs_info *c = inode->i_sb->s_fs_info;
  
        ubifs_assert(PagePrivate(page));
 -      if (offset || length < PAGE_CACHE_SIZE)
 +      if (offset || length < PAGE_SIZE)
                /* Partial page remains dirty */
                return;
  
@@@ -1597,10 -1597,10 +1597,10 @@@ const struct address_space_operations u
  const struct inode_operations ubifs_file_inode_operations = {
        .setattr     = ubifs_setattr,
        .getattr     = ubifs_getattr,
-       .setxattr    = ubifs_setxattr,
-       .getxattr    = ubifs_getxattr,
+       .setxattr    = generic_setxattr,
+       .getxattr    = generic_getxattr,
        .listxattr   = ubifs_listxattr,
-       .removexattr = ubifs_removexattr,
+       .removexattr = generic_removexattr,
  #ifdef CONFIG_UBIFS_ATIME_SUPPORT
        .update_time = ubifs_update_time,
  #endif
@@@ -1611,10 -1611,10 +1611,10 @@@ const struct inode_operations ubifs_sym
        .get_link    = simple_get_link,
        .setattr     = ubifs_setattr,
        .getattr     = ubifs_getattr,
-       .setxattr    = ubifs_setxattr,
-       .getxattr    = ubifs_getxattr,
+       .setxattr    = generic_setxattr,
+       .getxattr    = generic_getxattr,
        .listxattr   = ubifs_listxattr,
-       .removexattr = ubifs_removexattr,
+       .removexattr = generic_removexattr,
  #ifdef CONFIG_UBIFS_ATIME_SUPPORT
        .update_time = ubifs_update_time,
  #endif
diff --combined fs/ubifs/super.c
@@@ -2040,6 -2040,7 +2040,7 @@@ static int ubifs_fill_super(struct supe
        if (c->max_inode_sz > MAX_LFS_FILESIZE)
                sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE;
        sb->s_op = &ubifs_super_operations;
+       sb->s_xattr = ubifs_xattr_handlers;
  
        mutex_lock(&c->umount_mutex);
        err = mount_ubifs(c);
@@@ -2237,12 -2238,12 +2238,12 @@@ static int __init ubifs_init(void
        BUILD_BUG_ON(UBIFS_COMPR_TYPES_CNT > 4);
  
        /*
 -       * We require that PAGE_CACHE_SIZE is greater-than-or-equal-to
 +       * We require that PAGE_SIZE is greater-than-or-equal-to
         * UBIFS_BLOCK_SIZE. It is assumed that both are powers of 2.
         */
 -      if (PAGE_CACHE_SIZE < UBIFS_BLOCK_SIZE) {
 +      if (PAGE_SIZE < UBIFS_BLOCK_SIZE) {
                pr_err("UBIFS error (pid %d): VFS page cache size is %u bytes, but UBIFS requires at least 4096 bytes",
 -                     current->pid, (unsigned int)PAGE_CACHE_SIZE);
 +                     current->pid, (unsigned int)PAGE_SIZE);
                return -EINVAL;
        }
  
diff --combined fs/ubifs/ubifs.h
@@@ -37,6 -37,7 +37,7 @@@
  #include <linux/pagemap.h>
  #include <linux/backing-dev.h>
  #include <linux/security.h>
+ #include <linux/xattr.h>
  #include "ubifs-media.h"
  
  /* Version of this UBIFS implementation */
@@@ -46,8 -47,8 +47,8 @@@
  #define UBIFS_SUPER_MAGIC 0x24051905
  
  /* Number of UBIFS blocks per VFS page */
 -#define UBIFS_BLOCKS_PER_PAGE (PAGE_CACHE_SIZE / UBIFS_BLOCK_SIZE)
 -#define UBIFS_BLOCKS_PER_PAGE_SHIFT (PAGE_CACHE_SHIFT - UBIFS_BLOCK_SHIFT)
 +#define UBIFS_BLOCKS_PER_PAGE (PAGE_SIZE / UBIFS_BLOCK_SIZE)
 +#define UBIFS_BLOCKS_PER_PAGE_SHIFT (PAGE_SHIFT - UBIFS_BLOCK_SHIFT)
  
  /* "File system end of life" sequence number watermark */
  #define SQNUM_WARN_WATERMARK 0xFFFFFFFF00000000ULL
@@@ -1732,12 -1733,8 +1733,8 @@@ int ubifs_getattr(struct vfsmount *mnt
                  struct kstat *stat);
  
  /* xattr.c */
- int ubifs_setxattr(struct dentry *dentry, const char *name,
-                  const void *value, size_t size, int flags);
- ssize_t ubifs_getxattr(struct dentry *dentry, struct inode *host,
-                      const char *name, void *buf, size_t size);
+ extern const struct xattr_handler *ubifs_xattr_handlers[];
  ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size);
- int ubifs_removexattr(struct dentry *dentry, const char *name);
  int ubifs_init_security(struct inode *dentry, struct inode *inode,
                        const struct qstr *qstr);