void __capa_get(struct obd_capa *ocapa);
struct obd_capa *capa_get(uid_t uid, int capa_op, __u64 mdsid,
unsigned long ino, __u32 igen, int type);
+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);
return ocapa;
}
+struct obd_capa * filter_capa_get(struct lustre_capa *capa)
+{
+ struct hlist_head *head = capa_hash +
+ capa_hashfn(capa->lc_uid, capa->lc_mdsid, capa->lc_ino);
+ struct hlist_node *pos;
+ struct obd_capa *ocapa;
+
+ spin_lock(&capa_lock);
+
+ hlist_for_each_entry(ocapa, pos, head, c_hash) {
+ if (ocapa->c_type != FILTER_CAPA)
+ continue;
+ if (!memcmp(&ocapa->c_capa, capa,
+ sizeof(struct lustre_capa_data))) {
+ __capa_get(ocapa);
+
+ DEBUG_CAPA(D_INODE, &ocapa->c_capa, "found %s",
+ capa_type_name[ocapa->c_type]);
+ spin_unlock(&capa_lock);
+ return ocapa;
+ }
+ }
+
+ spin_unlock(&capa_lock);
+ return NULL;
+}
+
void capa_put(struct obd_capa *ocapa)
{
if (!ocapa)
EXPORT_SYMBOL(capa_op);
EXPORT_SYMBOL(capa_get);
+EXPORT_SYMBOL(filter_capa_get);
EXPORT_SYMBOL(capa_put);
EXPORT_SYMBOL(capa_renew);
EXPORT_SYMBOL(__capa_get);
RETURN(-ESTALE);
}
- ocapa = capa_get(capa->lc_uid, capa->lc_op, capa->lc_mdsid,
- capa->lc_ino, capa->lc_igen, FILTER_CAPA);
+ ocapa = filter_capa_get(capa);
verify:
if (ocapa) {
struct timeval tv;