X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_idmap.c;h=1d810982a6c14de3580c1d9b7dff5ba634ea9d18;hb=472fe13982952c9ccad969a996c054f9cf643847;hp=1d1005c0b8e58c0bd4f140a051ec13b25204ca97;hpb=82af026a4b6c22b680929ca7b6db45b0c6a55171;p=fs%2Flustre-release.git diff --git a/lustre/mdt/mdt_idmap.c b/lustre/mdt/mdt_idmap.c index 1d1005c..1d81098 100644 --- a/lustre/mdt/mdt_idmap.c +++ b/lustre/mdt/mdt_idmap.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,14 +37,8 @@ * Author: Fan Yong */ -#ifndef EXPORT_SYMTAB -#define EXPORT_SYMTAB -#endif #define DEBUG_SUBSYSTEM S_MDS -#ifndef AUTOCONF_INCLUDED -#include -#endif #include #include #include @@ -56,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -82,9 +73,6 @@ do { \ OBD_CONNECT_RMT_CLIENT_FORCE | \ OBD_CONNECT_MDS_CAPA | \ OBD_CONNECT_OSS_CAPA); \ - cfs_spin_lock(&exp->exp_lock); \ - exp->exp_connect_flags = reply->ocd_connect_flags; \ - cfs_spin_unlock(&exp->exp_lock); \ } while (0) int mdt_init_sec_level(struct mdt_thread_info *info) @@ -189,10 +177,6 @@ int mdt_init_sec_level(struct mdt_thread_info *info) reply->ocd_connect_flags &= ~OBD_CONNECT_MDS_CAPA; if (!mdt->mdt_opts.mo_oss_capa) reply->ocd_connect_flags &= ~OBD_CONNECT_OSS_CAPA; - - cfs_spin_lock(&exp->exp_lock); - exp->exp_connect_flags = reply->ocd_connect_flags; - cfs_spin_unlock(&exp->exp_lock); } break; default: @@ -213,10 +197,10 @@ int mdt_init_idmap(struct mdt_thread_info *info) ENTRY; if (exp_connect_rmtclient(exp)) { - cfs_down(&med->med_idmap_sem); + cfs_mutex_lock(&med->med_idmap_mutex); if (!med->med_idmap) med->med_idmap = lustre_idmap_init(); - cfs_up(&med->med_idmap_sem); + cfs_mutex_unlock(&med->med_idmap_mutex); if (IS_ERR(med->med_idmap)) { long err = PTR_ERR(med->med_idmap); @@ -243,12 +227,12 @@ int mdt_init_idmap(struct mdt_thread_info *info) void mdt_cleanup_idmap(struct mdt_export_data *med) { - cfs_down(&med->med_idmap_sem); + cfs_mutex_lock(&med->med_idmap_mutex); if (med->med_idmap != NULL) { lustre_idmap_fini(med->med_idmap); med->med_idmap = NULL; } - cfs_up(&med->med_idmap_sem); + cfs_mutex_unlock(&med->med_idmap_mutex); } static inline void mdt_revoke_export_locks(struct obd_export *exp)