Is dir->i_version = ++event SMP-unsafe? [was Re: i_version and f_version]

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Fri, 13 Feb 1998 00:41:03 +0000


I was just looking at all those lines in fs/*/*.c that say
dir->i_version = ++event;
and
inode->i_version = ++event;

These numbers are checked to spot changes to a directory while the
directory is scanned.

event is declared in <linux/sched.h> and defined in kernel/sched.c.
It is only ever used by filesystem code.

Should these values be generated by some SMP-safe atomic
increment-and-read operation? I couldn't find anything suitable in
<asm/atomic.h>.

Or is the surrounding code always called in an atomic context anyway?

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu