1. vfs_lock_file – file byte range lock
int vfs_lock_file(struct file * filp, unsigned int cmd, struct file_lock * fl, struct file_lock * conf);
The file to apply the lock to
type of locking operation (F_SETLK, F_GETLK, etc.)
The lock to be applied
Place to return a copy of the conflicting lock, if found.
Initialize the mutex to unlocked state.
The point of a mutex is to synchronize two threads. When
you have two threads attempting to access a single
resource, the general pattern is to have the first block
of code attempting access to set the mutex before
entering the code. When the second code block attempts
access, it sees the mutex is set and waits until the
first block of code is complete (and un-sets the mutex),
source : http://stackoverflow.com/questions/34524/what-is-a-mutex