On Tue, Mar 04, 2008 at 04:49:53PM -0800, Sunil Mushran wrote:
> This patch dumps the dlm state (dlm_ctxt) into a debugfs file.

> Useful for debugging.
> +/* files in subroot */
> +int dlm_debug_init(struct dlm_ctxt *dlm)
> +{
> +#ifdef CONFIG_DEBUG_FS
> +     struct dlm_debug_ctxt *dc = dlm->dlm_debug_ctxt;
> +
> +     /* for dumping dlm_ctxt */
> +     dc->debug_state_dentry = debugfs_create_file(DLM_DEBUGFS_DLM_STATE,
> +                                                  S_IFREG|S_IRUSR,
> +                                                  dlm->dlm_debugfs_subroot,
> +                                                  dlm, &debug_state_fops);
> +     if (!dc->debug_state_dentry) {
> +             mlog_errno(-ENOMEM);
> +             goto bail;
> +     }
> +
> +     dlm_debug_get(dc);
> +     return 0;
> +
> +bail:
> +     dlm_debug_shutdown(dlm);
> +     return -ENOMEM;
> +#endif
> +     return 0;
> +}

        Here again you could move the no-debugfs case to an inline in
dlmdebug.h.

Joel

-- 

"Time is an illusion, lunchtime doubly so."
        -Douglas Adams

Joel Becker
Principal Software Developer
Oracle
E-mail: [EMAIL PROTECTED]
Phone: (650) 506-8127

_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

Reply via email to