Re: [PATCH 4/3] Avoid using 'lstat()' to figure out directories
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jul 9, 2009, 23:52 UTC
- Message-ID
- <alpine.LFD.2.01.0907091647400.3352@localhost.localdomain>
- In-Reply-To
- <alpine.LFD.2.01.0907091626080.3352@localhost.localdomain>
On Thu, 9 Jul 2009, Linus Torvalds wrote:
Show 6 quoted lines
> > Of course, since 'path' is a 'const char *', we'd need to either do a > silly copy, or we'd need to change a whole lot of the code to make it > clear that we can actually add a slash to the end (which we can: I think > it's already always going to be an array that we _will_ add a slash to in > case it turns out to be a directory).
No, I was wrong. We really do give it an array that we can't change through the 'excluded()' function.
So we'd need to do the whole "copy name and add '/' at the end" thing. But the upside would then be that after that, we'd not need any looping to find the right ce. So it might be the right thing to do despite the extra copy.
Linus