The HyperNews Linux KHG Discussion Pages

## VFS inode locks/semaphores

  Forum: Filesystems
  Keywords: VFS inode lock semaphore
  Date: Tue, 02 Dec 1997 10:07:34 GMT
  From: <syer@mpa-garching.mpg.de>

The VFS inode structure seems to contain two mechanisms for `locking' an inode while it is being operated on: the i_lock member (and wait_on_inode()); and the i_sem member. I can find one example of use of the i_sem member (in ext2_rmdir(): source fs/ext2/namei.c), and a few examples of wait_on_inode() in fs/inode.c. (I'm looking at the 2.0.29 source, but I think it's pretty similar in 2.1.x.) Two questions: 1. why do there seem to be two mechanisms for doing similar things? 2. why aren't they used more often?