lkml.org 
[lkml]   [2002]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] tmpfs: incr. link-count on directory rename
From
Date
On Thu, 2002-02-14 at 07:19, Jan Harkes wrote:
>
> ps. shouldn't the linkcount of the old_dir get decremented too? Also you
> should only change the linkcounts when the operation completed
> successfully. i.e. something more like,
Oops, you're right, the linkcount of old_dir isn't decremented at the
moment, too. I will test your patch this evening, but I think it looks
better than mine... ;)

> --- /tmp/shmem.c.orig Thu Feb 14 01:17:23 2002
> +++ /tmp/shmem.c Thu Feb 14 01:18:25 2002
> @@ -1100,6 +1100,10 @@
> error = 0;
> old_dentry->d_inode->i_ctime = old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
> }
> + if (!error && S_ISDIR(old_dentry->d_inode->i_mode)) {
> + old_dir->i_nlink--;
> + new_dir->i_nlink++;
> + }
> return error;
> }

--
uli martens

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

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