[lkml]   [2001]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
On Mon, Jan 08, 2001 at 12:58:20PM -0500, Alexander Viro wrote:
> It's a hell of a pain wrt locking. You need to lock the parent, but it can

This is a no-brainer and bad implementation, but shows it's obviously right
wrt locking. (pseudocode, I ignored the uaccess details and all the other not
relevant things)

char buf[PAGE_SIZE]

err = sys_getcwd(buf, PAGE_SIZE)
if (err)
goto out

if (!memcmp(path, ".", 2))
path = buf
err = 2_4_0_sys_rmdir(path)

return err

Optimizing things just a little more as _worse_ the overhead of supporting
`rmdir .` can be reduced to a memcmp(name, ".") plus and out of line jump and I
don't see a performance problem with that.

Could you enlight me on where's the locking pain?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:52    [W:0.146 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site