- /* fields in lustre_capa_key are in cpu order */
- spin_lock(&filter->fo_capa_lock);
- tmp->k_key.lk_mdsid = le32_to_cpu(key->lk_mdsid);
- tmp->k_key.lk_keyid = le32_to_cpu(key->lk_keyid);
- tmp->k_key.lk_expiry = le64_to_cpu(key->lk_expiry);
- memcpy(&tmp->k_key.lk_key, key->lk_key, sizeof(key->lk_key));
-
- if (!bkey)
- list_add_tail(&tmp->k_list, &filter->fo_capa_keys);
- spin_unlock(&filter->fo_capa_lock);
-out:
- RETURN(rc);
-}
-
-int filter_verify_fid(struct obd_export *exp, struct inode *inode,
- struct lustre_capa *capa)
-{
- struct lustre_id fid;
- int rc;
-
- if (!capa)
- return 0;
-
- ENTRY;
- rc = fsfilt_get_md(exp->exp_obd, inode, &fid, sizeof(fid), EA_SID);
- if (rc < 0) {
- CERROR("get fid from object failed! rc:%d\n", rc);
- RETURN(rc);
- } else if (rc > 0) {
- if (capa->lc_mdsid != id_group(&fid) ||
- capa->lc_ino != id_ino(&fid))
- RETURN(-EINVAL);
- }
+ spin_lock(&capa_lock);
+ k->k_key = *new;
+ if (list_empty(&k->k_list))
+ list_add(&k->k_list, &filter->fo_capa_keys);
+ spin_unlock(&capa_lock);