Lines Matching refs:flock

1003 	       __u8 type, struct file_lock *flock)  in cifs_lock_test()  argument
1014 flock->fl_flags, &conf_lock, in cifs_lock_test()
1017 flock->fl_start = conf_lock->offset; in cifs_lock_test()
1018 flock->fl_end = conf_lock->offset + conf_lock->length - 1; in cifs_lock_test()
1019 flock->fl_pid = conf_lock->pid; in cifs_lock_test()
1021 flock->fl_type = F_RDLCK; in cifs_lock_test()
1023 flock->fl_type = F_WRLCK; in cifs_lock_test()
1027 flock->fl_type = F_UNLCK; in cifs_lock_test()
1098 cifs_posix_lock_test(struct file *file, struct file_lock *flock) in cifs_posix_lock_test() argument
1102 unsigned char saved_type = flock->fl_type; in cifs_posix_lock_test()
1104 if ((flock->fl_flags & FL_POSIX) == 0) in cifs_posix_lock_test()
1108 posix_test_lock(file, flock); in cifs_posix_lock_test()
1110 if (flock->fl_type == F_UNLCK && !cinode->can_cache_brlcks) { in cifs_posix_lock_test()
1111 flock->fl_type = saved_type; in cifs_posix_lock_test()
1126 cifs_posix_lock_set(struct file *file, struct file_lock *flock) in cifs_posix_lock_set() argument
1131 if ((flock->fl_flags & FL_POSIX) == 0) in cifs_posix_lock_set()
1141 rc = posix_lock_file(file, flock, NULL); in cifs_posix_lock_set()
1144 rc = wait_event_interruptible(flock->fl_wait, !flock->fl_blocker); in cifs_posix_lock_set()
1147 locks_delete_block(flock); in cifs_posix_lock_set()
1249 struct file_lock *flock; in cifs_push_posix_locks() local
1286 list_for_each_entry(flock, &flctx->flc_posix, fl_list) { in cifs_push_posix_locks()
1295 length = 1 + flock->fl_end - flock->fl_start; in cifs_push_posix_locks()
1296 if (flock->fl_type == F_RDLCK || flock->fl_type == F_SHLCK) in cifs_push_posix_locks()
1301 lck->pid = hash_lockowner(flock->fl_owner); in cifs_push_posix_locks()
1305 lck->offset = flock->fl_start; in cifs_push_posix_locks()
1360 cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock, in cifs_read_flock() argument
1363 if (flock->fl_flags & FL_POSIX) in cifs_read_flock()
1365 if (flock->fl_flags & FL_FLOCK) in cifs_read_flock()
1367 if (flock->fl_flags & FL_SLEEP) { in cifs_read_flock()
1371 if (flock->fl_flags & FL_ACCESS) in cifs_read_flock()
1373 if (flock->fl_flags & FL_LEASE) in cifs_read_flock()
1375 if (flock->fl_flags & in cifs_read_flock()
1378 cifs_dbg(FYI, "Unknown lock flags 0x%x\n", flock->fl_flags); in cifs_read_flock()
1381 if (flock->fl_type == F_WRLCK) { in cifs_read_flock()
1385 } else if (flock->fl_type == F_UNLCK) { in cifs_read_flock()
1390 } else if (flock->fl_type == F_RDLCK) { in cifs_read_flock()
1394 } else if (flock->fl_type == F_EXLCK) { in cifs_read_flock()
1398 } else if (flock->fl_type == F_SHLCK) { in cifs_read_flock()
1407 cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, in cifs_getlk() argument
1411 __u64 length = 1 + flock->fl_end - flock->fl_start; in cifs_getlk()
1420 rc = cifs_posix_lock_test(file, flock); in cifs_getlk()
1429 hash_lockowner(flock->fl_owner), in cifs_getlk()
1430 flock->fl_start, length, flock, in cifs_getlk()
1435 rc = cifs_lock_test(cfile, flock->fl_start, length, type, flock); in cifs_getlk()
1440 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, type, in cifs_getlk()
1443 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1445 flock->fl_type = F_UNLCK; in cifs_getlk()
1453 flock->fl_type = F_WRLCK; in cifs_getlk()
1459 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1463 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1465 flock->fl_type = F_RDLCK; in cifs_getlk()
1470 flock->fl_type = F_WRLCK; in cifs_getlk()
1495 cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, in cifs_unlock_range() argument
1509 __u64 length = 1 + flock->fl_end - flock->fl_start; in cifs_unlock_range()
1537 if (flock->fl_start > li->offset || in cifs_unlock_range()
1538 (flock->fl_start + length) < in cifs_unlock_range()
1608 cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, in cifs_setlk() argument
1613 __u64 length = 1 + flock->fl_end - flock->fl_start; in cifs_setlk()
1622 rc = cifs_posix_lock_set(file, flock); in cifs_setlk()
1635 hash_lockowner(flock->fl_owner), in cifs_setlk()
1636 flock->fl_start, length, in cifs_setlk()
1644 lock = cifs_lock_init(flock->fl_start, length, type, in cifs_setlk()
1645 flock->fl_flags); in cifs_setlk()
1672 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_setlk()
1681 rc = server->ops->mand_unlock_range(cfile, flock, xid); in cifs_setlk()
1684 if (flock->fl_flags & FL_POSIX) { in cifs_setlk()
1693 if (!(flock->fl_flags & FL_CLOSE)) in cifs_setlk()
1696 rc = locks_lock_file_wait(file, flock); in cifs_setlk()
1701 int cifs_lock(struct file *file, int cmd, struct file_lock *flock) in cifs_lock() argument
1716 cmd, flock->fl_flags, flock->fl_type, in cifs_lock()
1717 flock->fl_start, flock->fl_end); in cifs_lock()
1722 cifs_read_flock(flock, &type, &lock, &unlock, &wait_flag, in cifs_lock()
1735 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); in cifs_lock()
1749 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, in cifs_lock()