CFS_DECLARE_RWSEM(_lprocfs_lock);
EXPORT_SYMBOL(_lprocfs_lock);
+int lprocfs_single_release(struct inode *inode, struct file *file)
+{
+ LPROCFS_EXIT();
+ return single_release(inode, file);
+}
+EXPORT_SYMBOL(lprocfs_single_release);
+
int lprocfs_seq_release(struct inode *inode, struct file *file)
{
LPROCFS_EXIT();
}
EXPORT_SYMBOL(lprocfs_add_vars);
-void lprocfs_remove(struct proc_dir_entry **rooth)
+void lprocfs_remove_nolock(struct proc_dir_entry **rooth)
{
struct proc_dir_entry *root = *rooth;
struct proc_dir_entry *temp = root;
parent = root->parent;
LASSERT(parent != NULL);
- LPROCFS_WRITE_ENTRY(); /* search vs remove race */
while (1) {
while (temp->subdir != NULL)
if (temp == parent)
break;
}
- LPROCFS_WRITE_EXIT();
+}
+
+void lprocfs_remove(struct proc_dir_entry **rooth)
+{
+ LPROCFS_WRITE_ENTRY(); /* search vs remove race */
+ lprocfs_remove_nolock(rooth);
+ LPROCFS_WRITE_EXIT();
}
EXPORT_SYMBOL(lprocfs_remove);
}
EXPORT_SYMBOL(lprocfs_remove_proc_entry);
+void lprocfs_try_remove_proc_entry(const char *name,
+ struct proc_dir_entry *parent)
+{
+ struct proc_dir_entry *t = NULL;
+ struct proc_dir_entry **p;
+ int len, busy = 0;
+
+ LASSERT(parent != NULL);
+ len = strlen(name);
+
+ LPROCFS_WRITE_ENTRY();
+
+ /* lookup target name */
+ for (p = &parent->subdir; *p; p = &(*p)->next) {
+ if ((*p)->namelen != len)
+ continue;
+ if (memcmp(name, (*p)->name, len))
+ continue;
+ t = *p;
+ break;
+ }
+
+ if (t) {
+ /* verify it's empty: do not count "num_refs" */
+ for (p = &t->subdir; *p; p = &(*p)->next) {
+ if ((*p)->namelen != strlen("num_refs")) {
+ busy = 1;
+ break;
+ }
+ if (memcmp("num_refs", (*p)->name,
+ strlen("num_refs"))) {
+ busy = 1;
+ break;
+ }
+ }
+ }
+
+ if (busy == 0)
+ lprocfs_remove_nolock(&t);
+
+ LPROCFS_WRITE_EXIT();
+
+ return;
+}
+EXPORT_SYMBOL(lprocfs_try_remove_proc_entry);
+
struct proc_dir_entry *lprocfs_register(const char *name,
struct proc_dir_entry *parent,
struct lprocfs_vars *list, void *data)
"umask",
"einprogress",
"grant_param",
+ "nanoseconds_times",
+ "lvb_type",
+ "unknown",
+ "lightweight_conn",
+ "short_io",
NULL
};
LPROCFS_OBD_OP_INIT(num_private_stats, stats, get_uuid);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, quotacheck);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, quotactl);
- LPROCFS_OBD_OP_INIT(num_private_stats, stats, quota_adjust_qunit);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, ping);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, pool_new);
LPROCFS_OBD_OP_INIT(num_private_stats, stats, pool_rem);
c += cfs_hash_debug_str(obd->obd_uuid_hash, page + c, count - c);
c += cfs_hash_debug_str(obd->obd_nid_hash, page + c, count - c);
c += cfs_hash_debug_str(obd->obd_nid_stats_hash, page+c, count-c);
-#ifdef HAVE_QUOTA_SUPPORT
- if (obd->u.obt.obt_qctxt.lqc_lqs_hash)
- c += cfs_hash_debug_str(obd->u.obt.obt_qctxt.lqc_lqs_hash,
- page + c, count - c);
-#endif
return c;
}
"last_transno: "LPD64"\n",
obd->obd_next_recovery_transno - 1)<=0)
goto out;
- if (lprocfs_obd_snprintf(&page, size, &len, "VBR: %s\n",
- obd->obd_version_recov ? "ON" : "OFF")<=0)
+ if (lprocfs_obd_snprintf(&page, size, &len, "VBR: %s\n",
+ obd->obd_version_recov ?
+ "ENABLED" : "DISABLED") <=0)
goto out;
- if (lprocfs_obd_snprintf(&page, size, &len, "IR: %s\n",
- obd->obd_no_ir ? "OFF" : "ON") <= 0)
+ if (lprocfs_obd_snprintf(&page, size, &len, "IR: %s\n",
+ obd->obd_no_ir ?
+ "DISABLED" : "ENABLED") <= 0)
goto out;
goto fclose;
}