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

Diogo Zulli (diogo@dglnet.com.br)
Thu, 29 Jun 2000 19:28:33 -0300 (BRT)


On [29 June 2000 15:21] (Alexander Viro), wrote:
} On Thu, 29 Jun 2000, Tigran Aivazian wrote:
} >
} > 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);
} >
} 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.

#define BAD_ENGLISH

I am not a kernel hacker but I think we can get rid of strlen(name).
Based on lib/vsprintf.c we can do:

this.len = sprintf(name, "%lu", inode->i_ino);
this.name = name;

I don't like noise while listening to my favorites songs :)

- Diogo Zulli

-- Phone: (19) 9717 2769 - ICQ 66904917 - diogo@dglnet.com.br -----
-- Fingerprint: 6B51 2DE1 419A DADD 8A5F 30D3 D337 DF37 2B95 43E3
-- http://sourceware.gsek.com.br/sphynx/ --------------------------

-
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/