Whamcloud - gitweb
LU-2240 mds: Assign special fid sequence to root.
[fs/lustre-release.git] / lustre / fld / fld_handler.c
index 309be8a..7fe5d7e 100644 (file)
@@ -72,7 +72,7 @@
 LU_KEY_INIT_FINI(fld, struct fld_thread_info);
 
 /* context key: fld_thread_key */
-LU_CONTEXT_KEY_DEFINE(fld, LCT_MD_THREAD|LCT_DT_THREAD);
+LU_CONTEXT_KEY_DEFINE(fld, LCT_MD_THREAD | LCT_DT_THREAD | LCT_MG_THREAD);
 
 cfs_proc_dir_entry_t *fld_type_proc_dir = NULL;
 
@@ -145,8 +145,9 @@ int fld_server_lookup(const struct lu_env *env, struct lu_server_fld *fld,
         int rc;
         ENTRY;
 
-        info = lu_context_key_get(&env->le_ctx, &fld_thread_key);
-        erange = &info->fti_lrange;
+       info = lu_context_key_get(&env->le_ctx, &fld_thread_key);
+       LASSERT(info != NULL);
+       erange = &info->fti_lrange;
 
         /* Lookup it in the cache. */
         rc = fld_cache_lookup(fld->lsf_cache, seq, erange);
@@ -239,11 +240,10 @@ static int fld_req_handle(struct ptlrpc_request *req,
                 *out = *in;
 
                /* For old 2.0 client, the 'lsr_flags' is uninitialized.
-                * Set it as 'LU_SEQ_RANGE_MDT' by default.
-                * Old 2.0 liblustre client cannot talk with new 2.1 server. */
-               if (!(exp->exp_connect_flags & OBD_CONNECT_64BITHASH) &&
-                   !(exp->exp_connect_flags & OBD_CONNECT_MDS_MDS) &&
-                   !(exp->exp_connect_flags & OBD_CONNECT_LIGHTWEIGHT) &&
+                * Set it as 'LU_SEQ_RANGE_MDT' by default. */
+               if (!(exp_connect_flags(exp) & OBD_CONNECT_64BITHASH) &&
+                   !(exp_connect_flags(exp) & OBD_CONNECT_MDS_MDS) &&
+                   !(exp_connect_flags(exp) & OBD_CONNECT_LIGHTWEIGHT) &&
                    !exp->exp_libclient)
                        out->lsr_flags = LU_SEQ_RANGE_MDT;