Whamcloud - gitweb
file export-do_kern_mount.patch was initially added on branch b1_5.
[fs/lustre-release.git] / lustre / obdclass / capa.c
index 0502287..3a5d75f 100644 (file)
@@ -132,9 +132,9 @@ filter_find_capa(struct hlist_head *head, struct lustre_capa *capa)
         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))) {
-
                         DEBUG_CAPA(D_INODE, &ocapa->c_capa, "found %s",
                                    capa_type_name[ocapa->c_type]);
                         return ocapa;
@@ -326,7 +326,7 @@ capa_get(uid_t uid, int capa_op,__u64 mdsid, unsigned long ino,
         
         if (type == CLIENT_CAPA && !ocapa && atomic_read(&ll_capa_stat)) {
                 CDEBUG(D_ERROR, "can't find capa for (uid %u, op %d, mdsid "
-                       LPU64", ino %lu igen %u, type %d) failed.\n",
+                       LPU64", ino %lu igen %u, type %d)\n",
                        (unsigned) uid, capa_op, mdsid, ino, igen, type);
                 atomic_set(&ll_capa_stat, 0);
         }
@@ -348,14 +348,11 @@ struct obd_capa * filter_capa_get(struct lustre_capa *capa)
         return ocapa;
 }
 
-void capa_put(struct obd_capa *ocapa)
+void capa_put_nolock(struct obd_capa *ocapa)
 {
-        if (!ocapa)
-                return;
-
         DEBUG_CAPA(D_INODE, &ocapa->c_capa, "put %s",
                    capa_type_name[ocapa->c_type]);
-        spin_lock(&capa_lock);
+
         if (ocapa->c_type == CLIENT_CAPA) {
                 list_del_init(&ocapa->c_lli_list);
                 __capa_put(ocapa);
@@ -363,6 +360,15 @@ void capa_put(struct obd_capa *ocapa)
         } else {
                 atomic_dec(&ocapa->c_refc);
         }
+}
+
+void capa_put(struct obd_capa *ocapa)
+{
+        if (!ocapa)
+                return;
+
+        spin_lock(&capa_lock);
+        capa_put_nolock(ocapa);
         spin_unlock(&capa_lock);
 }
 
@@ -471,10 +477,11 @@ void dump_capa_hmac(char *buf, char *key)
 
 EXPORT_SYMBOL(capa_op);
 EXPORT_SYMBOL(capa_get);
+EXPORT_SYMBOL(__capa_get);
 EXPORT_SYMBOL(filter_capa_get);
 EXPORT_SYMBOL(capa_put);
+EXPORT_SYMBOL(capa_put_nolock);
 EXPORT_SYMBOL(capa_renew);
-EXPORT_SYMBOL(__capa_get);
 EXPORT_SYMBOL(capa_hmac);
 EXPORT_SYMBOL(capa_dup);
 EXPORT_SYMBOL(capa_dup2);