Merge tag 'for-linus-5.2-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubca...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 May 2019 16:37:25 +0000 (09:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 May 2019 16:37:25 +0000 (09:37 -0700)
Pull orangefs updates from Mike Marshall:
 "This includes one fix and our "Orangefs through the pagecache" patch
  series which greatly improves our small IO performance and helps us
  pass more xfstests than before.

  Fix:
   - orangefs: truncate before updating size

  Pagecache series:
   - all the rest"

* tag 'for-linus-5.2-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: (23 commits)
  orangefs: truncate before updating size
  orangefs: copy Orangefs-sized blocks into the pagecache if possible.
  orangefs: pass slot index back to readpage.
  orangefs: remember count when reading.
  orangefs: add orangefs_revalidate_mapping
  orangefs: implement writepages
  orangefs: write range tracking
  orangefs: avoid fsync service operation on flush
  orangefs: skip inode writeout if nothing to write
  orangefs: move do_readv_writev to direct_IO
  orangefs: do not return successful read when the client-core disappeared
  orangefs: implement writepage
  orangefs: migrate to generic_file_read_iter
  orangefs: service ops done for writeback are not killable
  orangefs: remove orangefs_readpages
  orangefs: reorganize setattr functions to track attribute changes
  orangefs: let setattr write to cached inode
  orangefs: set up and use backing_dev_info
  orangefs: hold i_lock during inode_getattr
  orangefs: update attributes rather than relying on server
  ...

1  2 
fs/orangefs/super.c

diff --combined fs/orangefs/super.c
index 3784f7e8b603e8c587c26ae302c1999372e49790,8fa30c13b7ed2324a72bff4ef13ca6ea2cdd6cf7..ee5efdc35cc1e337ab8e849372a69167faa8f07a
@@@ -10,6 -10,7 +10,7 @@@
  #include "orangefs-bufmap.h"
  
  #include <linux/parser.h>
+ #include <linux/hashtable.h>
  
  /* a cache for orangefs-inode objects (i.e. orangefs inode private data) */
  static struct kmem_cache *orangefs_inode_cache;
@@@ -124,9 -125,20 +125,19 @@@ static struct inode *orangefs_alloc_ino
        return &orangefs_inode->vfs_inode;
  }
  
 -static void orangefs_i_callback(struct rcu_head *head)
 +static void orangefs_free_inode(struct inode *inode)
  {
-       kmem_cache_free(orangefs_inode_cache, ORANGEFS_I(inode));
 -      struct inode *inode = container_of(head, struct inode, i_rcu);
+       struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
+       struct orangefs_cached_xattr *cx;
+       struct hlist_node *tmp;
+       int i;
+       hash_for_each_safe(orangefs_inode->xattr_cache, i, tmp, cx, node) {
+               hlist_del(&cx->node);
+               kfree(cx);
+       }
+       kmem_cache_free(orangefs_inode_cache, orangefs_inode);
  }
  
  static void orangefs_destroy_inode(struct inode *inode)
        gossip_debug(GOSSIP_SUPER_DEBUG,
                        "%s: deallocated %p destroying inode %pU\n",
                        __func__, orangefs_inode, get_khandle_from_ino(inode));
 -
 -      call_rcu(&inode->i_rcu, orangefs_i_callback);
  }
  
+ static int orangefs_write_inode(struct inode *inode,
+                               struct writeback_control *wbc)
+ {
+       gossip_debug(GOSSIP_SUPER_DEBUG, "orangefs_write_inode\n");
+       return orangefs_inode_setattr(inode);
+ }
  /*
   * NOTE: information filled in here is typically reflected in the
   * output of the system command 'df'
@@@ -295,8 -316,8 +313,9 @@@ void fsid_key_table_finalize(void
  
  static const struct super_operations orangefs_s_ops = {
        .alloc_inode = orangefs_alloc_inode,
 +      .free_inode = orangefs_free_inode,
        .destroy_inode = orangefs_destroy_inode,
+       .write_inode = orangefs_write_inode,
        .drop_inode = generic_delete_inode,
        .statfs = orangefs_statfs,
        .remount_fs = orangefs_remount_fs,
@@@ -394,15 -415,11 +413,11 @@@ static int orangefs_fill_sb(struct supe
                struct orangefs_fs_mount_response *fs_mount,
                void *data, int silent)
  {
-       int ret = -EINVAL;
-       struct inode *root = NULL;
-       struct dentry *root_dentry = NULL;
+       int ret;
+       struct inode *root;
+       struct dentry *root_dentry;
        struct orangefs_object_kref root_object;
  
-       /* alloc and init our private orangefs sb info */
-       sb->s_fs_info = kzalloc(sizeof(struct orangefs_sb_info_s), GFP_KERNEL);
-       if (!ORANGEFS_SB(sb))
-               return -ENOMEM;
        ORANGEFS_SB(sb)->sb = sb;
  
        ORANGEFS_SB(sb)->root_khandle = fs_mount->root_khandle;
        sb->s_blocksize_bits = PAGE_SHIFT;
        sb->s_maxbytes = MAX_LFS_FILESIZE;
  
+       ret = super_setup_bdi(sb);
+       if (ret)
+               return ret;
        root_object.khandle = ORANGEFS_SB(sb)->root_khandle;
        root_object.fs_id = ORANGEFS_SB(sb)->fs_id;
        gossip_debug(GOSSIP_SUPER_DEBUG,
@@@ -503,6 -524,13 +522,13 @@@ struct dentry *orangefs_mount(struct fi
                goto free_op;
        }
  
+       /* alloc and init our private orangefs sb info */
+       sb->s_fs_info = kzalloc(sizeof(struct orangefs_sb_info_s), GFP_KERNEL);
+       if (!ORANGEFS_SB(sb)) {
+               d = ERR_PTR(-ENOMEM);
+               goto free_op;
+       }
        ret = orangefs_fill_sb(sb,
              &new_op->downcall.resp.fs_mount, data,
              flags & SB_SILENT ? 1 : 0);