Re: [patch 36/37] LTTng instrumentation mm

From: Masami Hiramatsu
Date: Sun Apr 27 2008 - 22:13:39 EST


Hi Mathieu,

Mathieu Desnoyers wrote:
> @@ -1844,3 +1848,22 @@ int valid_swaphandles(swp_entry_t entry,
> *offset = ++toff;
> return nr_pages? ++nr_pages: 0;
> }
> +
> +void ltt_dump_swap_files(void *call_data)
> +{
> + int type;
> + struct swap_info_struct *p = NULL;
> +
> + mutex_lock(&swapon_mutex);
> + for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
> + p = swap_info + type;
> + if ((p->flags & SWP_ACTIVE) != SWP_ACTIVE)
> + continue;
> + __trace_mark(0, statedump_swap_files, call_data,
> + "filp %p vfsmount %p dname %s",
> + p->swap_file, p->swap_file->f_vfsmnt,
> + p->swap_file->f_dentry->d_name.name);
> + }
> + mutex_unlock(&swapon_mutex);
> +}
> +EXPORT_SYMBOL_GPL(ltt_dump_swap_files);


I'm not sure this kind of functions can be acceptable.
IMHO, you'd better use more generic method (ex. a callback function),
or just export swap_list and swapon_mutex. Thus, other subsystems can
use that interface.

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@xxxxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/