Whamcloud - gitweb
LU-3319 procfs: move llite proc handling over to seq_file
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index cd6e832..df421d6 100644 (file)
@@ -492,7 +492,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
 
        /* make root inode
         * XXX: move this to after cbd setup? */
-       valid = OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS | OBD_MD_FLMDSCAPA;
+       valid = OBD_MD_FLGETATTR | OBD_MD_FLBLOCKS | OBD_MD_FLMDSCAPA |
+               OBD_MD_FLMODEASIZE;
        if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
                valid |= OBD_MD_FLRMTPERM;
        else if (sbi->ll_flags & LL_SBI_ACL)
@@ -819,22 +820,22 @@ static int ll_options(char *options, int *flags)
                         *flags &= ~tmp;
                         goto next;
                 }
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 5, 53, 0)
-                tmp = ll_set_opt("acl", s1, LL_SBI_ACL);
-                if (tmp) {
-                        /* Ignore deprecated mount option.  The client will
-                         * always try to mount with ACL support, whether this
-                         * is used depends on whether server supports it. */
-                        LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated "
-                                                  "mount option 'acl'.\n");
-                        goto next;
-                }
-                tmp = ll_set_opt("noacl", s1, LL_SBI_ACL);
-                if (tmp) {
-                        LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated "
-                                                  "mount option 'noacl'.\n");
-                        goto next;
-                }
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 51, 0)
+               tmp = ll_set_opt("acl", s1, LL_SBI_ACL);
+               if (tmp) {
+                       /* Ignore deprecated mount option.  The client will
+                        * always try to mount with ACL support, whether this
+                        * is used depends on whether server supports it. */
+                       LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated "
+                                                 "mount option 'acl'.\n");
+                       goto next;
+               }
+               tmp = ll_set_opt("noacl", s1, LL_SBI_ACL);
+               if (tmp) {
+                       LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated "
+                                                 "mount option 'noacl'.\n");
+                       goto next;
+               }
 #else
 #warning "{no}acl options have been deprecated since 1.8, please remove them"
 #endif
@@ -1040,10 +1041,8 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
        cfg->cfg_callback = class_config_llog_handler;
         /* set up client obds */
         err = lustre_process_log(sb, profilenm, cfg);
-        if (err < 0) {
-                CERROR("Unable to process log: %d\n", err);
-                GOTO(out_free, err);
-        }
+       if (err < 0)
+               GOTO(out_free, err);
 
         /* Profile set with LCFG_MOUNTOPT so we can find our mdc and osc obds */
         lprof = class_get_profile(profilenm);
@@ -2275,31 +2274,28 @@ out_statfs:
 
 int ll_process_config(struct lustre_cfg *lcfg)
 {
-        char *ptr;
-        void *sb;
-        struct lprocfs_static_vars lvars;
-        unsigned long x;
-        int rc = 0;
+       struct super_block *sb;
+       unsigned long x;
+       int rc = 0;
+       char *ptr;
 
-        lprocfs_llite_init_vars(&lvars);
-
-        /* The instance name contains the sb: lustre-client-aacfe000 */
-        ptr = strrchr(lustre_cfg_string(lcfg, 0), '-');
-        if (!ptr || !*(++ptr))
-                return -EINVAL;
-        if (sscanf(ptr, "%lx", &x) != 1)
-                return -EINVAL;
-        sb = (void *)x;
-        /* This better be a real Lustre superblock! */
-        LASSERT(s2lsi((struct super_block *)sb)->lsi_lmd->lmd_magic == LMD_MAGIC);
-
-        /* Note we have not called client_common_fill_super yet, so
-           proc fns must be able to handle that! */
-        rc = class_process_proc_param(PARAM_LLITE, lvars.obd_vars,
-                                      lcfg, sb);
-        if (rc > 0)
-                rc = 0;
-        return(rc);
+       /* The instance name contains the sb: lustre-client-aacfe000 */
+       ptr = strrchr(lustre_cfg_string(lcfg, 0), '-');
+       if (!ptr || !*(++ptr))
+               return -EINVAL;
+       if (sscanf(ptr, "%lx", &x) != 1)
+               return -EINVAL;
+       sb = (struct super_block *)x;
+       /* This better be a real Lustre superblock! */
+       LASSERT(s2lsi(sb)->lsi_lmd->lmd_magic == LMD_MAGIC);
+
+       /* Note we have not called client_common_fill_super yet, so
+          proc fns must be able to handle that! */
+       rc = class_process_proc_seq_param(PARAM_LLITE, lprocfs_llite_obd_vars,
+                                         lcfg, sb);
+       if (rc > 0)
+               rc = 0;
+       return rc;
 }
 
 /* this function prepares md_op_data hint for passing ot down to MD stack. */
@@ -2319,17 +2315,27 @@ struct md_op_data * ll_prep_md_op_data(struct md_op_data *op_data,
         if (op_data == NULL)
                 return ERR_PTR(-ENOMEM);
 
-        ll_i2gids(op_data->op_suppgids, i1, i2);
-        op_data->op_fid1 = *ll_inode2fid(i1);
-        op_data->op_capa1 = ll_mdscapa_get(i1);
+       ll_i2gids(op_data->op_suppgids, i1, i2);
+       op_data->op_fid1 = *ll_inode2fid(i1);
+       op_data->op_capa1 = ll_mdscapa_get(i1);
+       if (S_ISDIR(i1->i_mode))
+               op_data->op_mea1 = ll_i2info(i1)->lli_lmv_md;
+
+       if (i2) {
+               op_data->op_fid2 = *ll_inode2fid(i2);
+               op_data->op_capa2 = ll_mdscapa_get(i2);
+               if (S_ISDIR(i2->i_mode))
+                       op_data->op_mea2 = ll_i2info(i2)->lli_lmv_md;
+       } else {
+               fid_zero(&op_data->op_fid2);
+               op_data->op_capa2 = NULL;
+       }
 
-        if (i2) {
-                op_data->op_fid2 = *ll_inode2fid(i2);
-                op_data->op_capa2 = ll_mdscapa_get(i2);
-        } else {
-                fid_zero(&op_data->op_fid2);
-                op_data->op_capa2 = NULL;
-        }
+       if (ll_i2sbi(i1)->ll_flags & LL_SBI_64BIT_HASH)
+               op_data->op_cli_flags |= CLI_HASH64;
+
+       if (ll_need_32bit_api(ll_i2sbi(i1)))
+               op_data->op_cli_flags |= CLI_API32;
 
        op_data->op_name = name;
        op_data->op_namelen = namelen;