Lines Matching refs:fl
731 do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) in do_getlk() argument
735 unsigned int saved_type = fl->fl_type; in do_getlk()
738 posix_test_lock(filp, fl); in do_getlk()
739 if (fl->fl_type != F_UNLCK) { in do_getlk()
743 fl->fl_type = saved_type; in do_getlk()
751 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_getlk()
755 fl->fl_type = F_UNLCK; in do_getlk()
759 static int do_vfs_lock(struct file *file, struct file_lock *fl) in do_vfs_lock() argument
762 switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) { in do_vfs_lock()
764 res = posix_lock_file_wait(file, fl); in do_vfs_lock()
767 res = flock_lock_file_wait(file, fl); in do_vfs_lock()
776 do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) in do_unlk() argument
805 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_unlk()
807 status = do_vfs_lock(filp, fl); in do_unlk()
817 do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) in do_setlk() argument
835 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_setlk()
837 status = do_vfs_lock(filp, fl); in do_setlk()
862 int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) in nfs_lock() argument
869 filp, fl->fl_type, fl->fl_flags, in nfs_lock()
870 (long long)fl->fl_start, (long long)fl->fl_end); in nfs_lock()
875 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) in nfs_lock()
882 ret = NFS_PROTO(inode)->lock_check_bounds(fl); in nfs_lock()
888 ret = do_getlk(filp, cmd, fl, is_local); in nfs_lock()
889 else if (fl->fl_type == F_UNLCK) in nfs_lock()
890 ret = do_unlk(filp, cmd, fl, is_local); in nfs_lock()
892 ret = do_setlk(filp, cmd, fl, is_local); in nfs_lock()
901 int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) in nfs_flock() argument
907 filp, fl->fl_type, fl->fl_flags); in nfs_flock()
909 if (!(fl->fl_flags & FL_FLOCK)) in nfs_flock()
918 if (fl->fl_type & LOCK_MAND) in nfs_flock()
925 if (fl->fl_type == F_UNLCK) in nfs_flock()
926 return do_unlk(filp, cmd, fl, is_local); in nfs_flock()
927 return do_setlk(filp, cmd, fl, is_local); in nfs_flock()