User: Password:
Subscribe / Log in / New account

"one file per block would be silly"

"one file per block would be silly"

Posted Mar 18, 2010 20:10 UTC (Thu) by smurf (subscriber, #17840)
In reply to: "one file per block would be silly" by HelloWorld
Parent article: A critical look at sysfs attribute values

So if you have 1000 bad blocks, you need 3000+ system calls to read the list.

Sorry, but I don't think that this makes much sense.

Where does that silly 4k limit come from, anyway? debugfs does much better. So provide a symlink to the "real" list which lives somewhere else?

(Log in to post comments)

"one file per block would be silly"

Posted Mar 19, 2010 14:00 UTC (Fri) by nix (subscriber, #2304) [Link]

Uh, the syscall underlying readdir() (getdents()) reads a whole bunch of entries at once, so you don't need 3000 syscalls to readdir() through 3000 names. If you want to stat() them, then you're right: but all you need to do in this case is get their names, which is much faster.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds