Some questions on a piece of code

zhangyfh at legend.com.cn zhangyfh at legend.com.cn
Thu Jul 25 21:25:01 GMT 2002


In open.c (Samba 2.2.5), There's a piece of codes.

/****************************************************************************
set a kernel flock on a file for NFS interoperability
this requires a patch to Linux
****************************************************************************/
static void kernel_flock(files_struct *fsp, int deny_mode)
{
#if HAVE_KERNEL_SHARE_MODES
     int kernel_mode = 0;
     if (deny_mode == DENY_READ) kernel_mode = LOCK_MAND|LOCK_WRITE;
     else if (deny_mode == DENY_WRITE) kernel_mode = LOCK_MAND|LOCK_READ;
     else if (deny_mode == DENY_ALL) kernel_mode = LOCK_MAND;
     if (kernel_mode) flock(fsp->fd, kernel_mode);
#endif
     ;;
}


What does LOCK_MAND mean? A mandatory flock? If it is ,then in which sys
call check this flag?


Where is HAVE_KERNEL_SHARE_MODES defined in?
What patch should I use?

**************************
TEL:  086-01082899999-2328
E-mail:zhangyfh at legend.com
**************************





More information about the samba-technical mailing list