staging/lustre/llite: remove unused ll_max_rw_chunk
[firefly-linux-kernel-4.4.55.git] / drivers / staging / lustre / lustre / llite / llite_lib.c
index 61acc70aaae4f3b28e355a187487ef677063fbae..4c9fd4acedeaab563ee4560f04e3ea2795350131 100644 (file)
@@ -58,6 +58,7 @@
 
 struct kmem_cache *ll_file_data_slab;
 struct proc_dir_entry *proc_lustre_fs_root;
+struct kset *llite_kset;
 
 static LIST_HEAD(ll_super_blocks);
 static DEFINE_SPINLOCK(ll_sb_lock);
@@ -66,7 +67,7 @@ static DEFINE_SPINLOCK(ll_sb_lock);
 #define log2(n) ffz(~(n))
 #endif
 
-static struct ll_sb_info *ll_init_sbi(void)
+static struct ll_sb_info *ll_init_sbi(struct super_block *sb)
 {
        struct ll_sb_info *sbi = NULL;
        unsigned long pages;
@@ -134,6 +135,8 @@ static struct ll_sb_info *ll_init_sbi(void)
        atomic_set(&sbi->ll_agl_total, 0);
        sbi->ll_flags |= LL_SBI_AGL_ENABLED;
 
+       sbi->ll_sb = sb;
+
        return sbi;
 }
 
@@ -284,6 +287,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                char *buf;
 
                buf = kzalloc(PAGE_CACHE_SIZE, GFP_KERNEL);
+               if (!buf) {
+                       err = -ENOMEM;
+                       goto out_md_fid;
+               }
                obd_connect_flags2str(buf, PAGE_CACHE_SIZE,
                                      valid ^ CLIENT_CONNECT_MDT_REQD, ",");
                LCONSOLE_ERROR_MSG(0x170, "Server %s does not support feature(s) needed for correct operation of this client (%s). Please upgrade server or downgrade client.\n",
@@ -308,7 +315,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
        sb->s_magic = LL_SUPER_MAGIC;
        sb->s_maxbytes = MAX_LFS_FILESIZE;
        sbi->ll_namelen = osfs->os_namelen;
-       sbi->ll_max_rw_chunk = LL_DEFAULT_MAX_RW_CHUNK;
 
        if ((sbi->ll_flags & LL_SBI_USER_XATTR) &&
            !(data->ocd_connect_flags & OBD_CONNECT_XATTR)) {
@@ -400,7 +406,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
        if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
                /* OBD_CONNECT_CKSUM should always be set, even if checksums are
                 * disabled by default, because it can still be enabled on the
-                * fly via /proc. As a consequence, we still need to come to an
+                * fly via /sys. As a consequence, we still need to come to an
                 * agreement on the supported algorithms at connect time */
                data->ocd_connect_flags |= OBD_CONNECT_CKSUM;
 
@@ -915,7 +921,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
        try_module_get(THIS_MODULE);
 
        /* client additional sb info */
-       lsi->lsi_llsbi = sbi = ll_init_sbi();
+       lsi->lsi_llsbi = sbi = ll_init_sbi(sb);
        if (!sbi) {
                module_put(THIS_MODULE);
                kfree(cfg);