can we combine posix_test_lock and posix_lock_file ?

Trond Myklebust trond.myklebust at fys.uio.no
Mon Dec 18 09:12:55 EST 2006


On Mon, 2006-12-18 at 05:55 -0800, Dharmosoth Seetharam wrote:
> Hi All,
> 
> 
> I have small doubt regarding the NLM protocol.
> 
> I am using NLMv4 with NFSv3 and Kernel 2.6.7
> 
> my question is: 
> 
> fs/lockd/svclock.c : nlmsvc_lock()
> 
> if (!(conflock = posix_test_lock(&file->f_file,
> &lock->fl))) {
> /*              error = posix_lock_file(&file->f_file,
> &lock->fl);
> 
> 
> The above scenario is test and set lock.
> 
> Can we combine the two function to make a
> single function call?
> 
> like
> 
> posix_test_and_lock()?

Already done in more recent kernels. See posix_lock_file_conf()

Cheers,
  Trond



More information about the NFSv4 mailing list