Whamcloud - gitweb
remove stale capa structure from mds/filter obd.
authorericm <ericm>
Wed, 21 Sep 2005 01:19:14 +0000 (01:19 +0000)
committerericm <ericm>
Wed, 21 Sep 2005 01:19:14 +0000 (01:19 +0000)
lustre/include/linux/lustre_sec.h
lustre/include/linux/obd.h
lustre/mds/handler.c
lustre/mds/mds_capa.c
lustre/obdclass/capa.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_capa.c

index beb38b1..97396a4 100644 (file)
@@ -609,7 +609,7 @@ struct obd_capa *capa_get(uid_t uid, int capa_op, __u64 mdsid,
 struct obd_capa *filter_capa_get(struct lustre_capa *capa);
 void capa_put(struct obd_capa *ocapa);
 struct obd_capa *capa_renew(struct lustre_capa *capa, int type);
-void capa_hmac(struct crypto_tfm *tfm, __u8 *key, struct lustre_capa *capa);
+void capa_hmac(__u8 *key, struct lustre_capa *capa);
 void capa_dup(void *dst, struct obd_capa *ocapa);
 void capa_dup2(void *dst, struct lustre_capa *capa);
 int capa_expired(struct lustre_capa *capa);
index 4e49a07..a401829 100644 (file)
@@ -289,7 +289,6 @@ struct filter_obd {
 
         /* capability related */
         int                      fo_capa_stat;
-        struct crypto_tfm       *fo_capa_hmac;
         spinlock_t               fo_capa_lock;
 
         struct list_head         fo_capa_keys;
@@ -473,7 +472,6 @@ struct mds_obd {
 
         /* capability related */
         int                              mds_capa_stat;     /* 1: on, 0: off */
-        struct crypto_tfm               *mds_capa_hmac;
         unsigned long                    mds_capa_timeout;  /* sec */
 
         struct mds_capa_key              mds_capa_keys[2];  /* red & black key */
index 9353e7d..9740f9d 100644 (file)
@@ -3534,7 +3534,6 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
         struct vfsmount *mnt;
         char ns_name[48];
         unsigned long page;
-        struct crypto_tfm *tfm = NULL;
         int rc = 0;
         ENTRY;
 
@@ -3646,11 +3645,6 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
         }
         ldlm_register_intent(obd->obd_namespace, mds_intent_policy);
 
-        tfm = crypto_alloc_tfm(CAPA_HMAC_ALG, 0);
-        if (!tfm)
-                GOTO(err_ns, rc = -ENOSYS);
-
-        mds->mds_capa_hmac = tfm;
         mds->mds_capa_timeout = CAPA_TIMEOUT;
         mds->mds_capa_key_timeout = CAPA_KEY_TIMEOUT;
         
@@ -3658,7 +3652,7 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
         if (rc) {
                 CERROR("%s: MDS filesystem method init failed: rc = %d\n",
                        obd->obd_name, rc);
-                GOTO(err_capa, rc);
+                GOTO(err_ns, rc);
         }
 
         rc = llog_start_commit_thread();
@@ -3715,8 +3709,6 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
 err_fs:
         /* No extra cleanup needed for llog_init_commit_thread() */
         mds_fs_cleanup(obd, 0);
-err_capa:
-        crypto_free_tfm(mds->mds_capa_hmac);
 err_ns:
         ldlm_namespace_free(obd->obd_namespace, 0);
         obd->obd_namespace = NULL;
@@ -4004,8 +3996,6 @@ static int mds_cleanup(struct obd_device *obd, int flags)
 
         mds_capa_keys_cleanup(obd);
 
-        if (mds->mds_capa_hmac)
-                crypto_free_tfm(mds->mds_capa_hmac);
         RETURN(0);
 }
 
index 8b29840..de840a6 100644 (file)
@@ -555,7 +555,7 @@ int mds_pack_capa(struct obd_device *obd, struct mds_export_data *med,
         memcpy(key, CUR_CAPA_KEY(mds)->lk_key, sizeof(key));
         spin_unlock(&mds_capa_lock);
 
-        capa_hmac(mds->mds_capa_hmac, key, capa);
+        capa_hmac(key, capa);
 
         ocapa = capa_renew(capa, MDS_CAPA);
         if (!ocapa)
index c8385f5..d601968 100644 (file)
@@ -367,7 +367,7 @@ struct obd_capa *capa_renew(struct lustre_capa *capa, int type)
         return ocapa;
 }
 
-void capa_hmac(struct crypto_tfm *_tfm, __u8 *key, struct lustre_capa *capa)
+void capa_hmac(__u8 *key, struct lustre_capa *capa)
 {
         struct crypto_tfm *tfm;
         int keylen = CAPA_KEY_LEN;
index 492db29..c85ac42 100644 (file)
@@ -1428,7 +1428,6 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
         struct filter_obd *filter = &obd->u.filter;
         struct lvfs_obd_ctxt *lvfs_ctxt = NULL;
         struct vfsmount *mnt;
-        struct crypto_tfm *tfm;
         char *str;
         char ns_name[48];
         int rc = 0, i;
@@ -1490,17 +1489,12 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
         sema_init(&filter->fo_init_lock, 1);
         filter->fo_committed_group = 0;
 
-        tfm = crypto_alloc_tfm(CAPA_HMAC_ALG, 0);
-        if (!tfm)
-                GOTO(err_mntput, rc = -ENOSYS);
-
-        filter->fo_capa_hmac = tfm;
         INIT_LIST_HEAD(&filter->fo_capa_keys);
         spin_lock_init(&filter->fo_capa_lock);
 
         rc = filter_prep(obd);
         if (rc)
-                GOTO(err_capa, rc);
+                GOTO(err_mntput, rc);
 
         filter->fo_destroys_in_progress = 0;
         for (i = 0; i < 32; i++)
@@ -1546,8 +1540,6 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
 
 err_post:
         filter_post(obd);
-err_capa:
-        crypto_free_tfm(filter->fo_capa_hmac);
 err_mntput:
         unlock_kernel();
         lvfs_umount_fs(filter->fo_lvfs_ctxt);
index 9607b0e..8bd2584 100644 (file)
@@ -337,7 +337,7 @@ new_capa:
 
         tcapa = *capa;
         tcapa.lc_keyid = capa_keys[0].k_key.lk_keyid;
-        capa_hmac(filter->fo_capa_hmac, capa_keys[0].k_key.lk_key, &tcapa);
+        capa_hmac(capa_keys[0].k_key.lk_key, &tcapa);
 
         /* store in capa cache */
         ocapa = capa_renew(&tcapa, FILTER_CAPA);
@@ -346,8 +346,7 @@ new_capa:
 
         if (bkey) {
                 tcapa.lc_keyid = capa_keys[1].k_key.lk_keyid;
-                capa_hmac(filter->fo_capa_hmac, capa_keys[1].k_key.lk_key,
-                          &tcapa);
+                capa_hmac(capa_keys[1].k_key.lk_key, &tcapa);
 
                 spin_lock(&filter->fo_capa_lock);
                 memcpy(ocapa->c_bhmac, tcapa.lc_hmac, sizeof(ocapa->c_bhmac));