should some seq_file output operations be EXPORTed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  working on a column on how to use seq_files for debugging, and i ran
across the following oddity.  from include/linux/seq_file.h, here are
the various seq_file "output" operations -- the seq_file routines that
allow you to generate the output corresponding to your proc file (note
that this list as given in LDD3 is no longer correct or complete):

=====

int seq_escape(struct seq_file *, const char *, const char *);
int seq_putc(struct seq_file *m, char c);
int seq_puts(struct seq_file *m, const char *s);
int seq_write(struct seq_file *seq, const void *data, size_t len);

int seq_printf(struct seq_file *, const char *, ...)
        __attribute__ ((format (printf,2,3)));

int seq_path(struct seq_file *, struct path *, char *);
int seq_dentry(struct seq_file *, struct dentry *, char *);
int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
                  char *esc);

=====

  it all looks reasonable, including those last three that deal with
printing pathnames when unprintable characters might be involved.
however, if you check the corresponding source file fs/seq_file.c,
you'll notice that, while seq_path() is EXPORTed, seq_path_root() and
seq_dentry() are not.

  does that make sense?  i'm really not sure, and i'm willing to
listen to arguments either way.  is there any reason why those two
routines should be available to in-kernel routines but *not* loadable
modules?  feel free to search the source tree to see where they're
used, and maybe it's reasonable that they're not exported.  it just
strikes me as slightly inconsistent, but maybe there's a good reason
for it.

rday

p.s.  all three of those routines invoke the seq_file routine
mangle_path() to handle "escaping" characters and what's amusing is
that that underlying mangle_path() routine is *also* exported, which
seems to make the current situation even *more* inconsistent.  IMHO,
why not just EXPORT the two unexported routines so that both in-kernel
code and loadable modules have access to identical interfaces?

--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux