Re: [question] why does pipefs bother to build unique filenames?

Alexander Viro (viro@math.psu.edu)
Thu, 29 Jun 2000 15:21:16 -0400 (EDT)


On Thu, 29 Jun 2000, Tigran Aivazian wrote:

> Hi guys,
>
> In fs/pipe.c:do_pipe() we see this code:
>
> sprintf(name, "%lu", inode->i_ino);
> this.name = name;
> this.len = strlen(name);
> /* We don't care for hash - it will never be looked up */
> dentry = d_alloc(pipe_mnt->mnt_sb->s_root, &this);
>
> why do we bother building unique dentry name if it is never going to be
> looked up anyway? Couldn't we just set this.len = 0 or is it invalid for
> dentry cache to have 0-length entries? If so, ok we can make it non-0
> length but does it have to be unique given that it is never looked
> up? Then we could at least get rid of sprintf() overhead.

Drat... Tigran, that's for procfs. No, still not there. And sprintf()
overhead is a non-issue here - it's a noise compared to any of memory
allocations going on.

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