Lines Matching refs:flock

1028  * style). If such a lock exists, update the flock structure with its
1029 * properties. Otherwise, set the flock type to F_UNLCK if we can cache brlocks
1035 __u8 type, struct file_lock *flock)
1046 flock->fl_flags, &conf_lock,
1049 flock->fl_start = conf_lock->offset;
1050 flock->fl_end = conf_lock->offset + conf_lock->length - 1;
1051 flock->fl_pid = conf_lock->pid;
1053 flock->fl_type = F_RDLCK;
1055 flock->fl_type = F_WRLCK;
1059 flock->fl_type = F_UNLCK;
1124 * style). If such a lock exists, update the flock structure with its
1125 * properties. Otherwise, set the flock type to F_UNLCK if we can cache brlocks
1130 cifs_posix_lock_test(struct file *file, struct file_lock *flock)
1134 unsigned char saved_type = flock->fl_type;
1136 if ((flock->fl_flags & FL_POSIX) == 0)
1140 posix_test_lock(file, flock);
1142 if (flock->fl_type == F_UNLCK && !cinode->can_cache_brlcks) {
1143 flock->fl_type = saved_type;
1159 cifs_posix_lock_set(struct file *file, struct file_lock *flock)
1164 if ((flock->fl_flags & FL_POSIX) == 0)
1173 rc = posix_lock_file(file, flock, NULL);
1275 struct file_lock *flock;
1312 list_for_each_entry(flock, &flctx->flc_posix, fl_list) {
1321 length = 1 + flock->fl_end - flock->fl_start;
1322 if (flock->fl_type == F_RDLCK || flock->fl_type == F_SHLCK)
1327 lck->pid = hash_lockowner(flock->fl_owner);
1331 lck->offset = flock->fl_start;
1386 cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
1389 if (flock->fl_flags & FL_POSIX)
1391 if (flock->fl_flags & FL_FLOCK)
1393 if (flock->fl_flags & FL_SLEEP) {
1397 if (flock->fl_flags & FL_ACCESS)
1399 if (flock->fl_flags & FL_LEASE)
1401 if (flock->fl_flags &
1404 cifs_dbg(FYI, "Unknown lock flags 0x%x\n", flock->fl_flags);
1407 if (flock->fl_type == F_WRLCK) {
1411 } else if (flock->fl_type == F_UNLCK) {
1416 } else if (flock->fl_type == F_RDLCK) {
1420 } else if (flock->fl_type == F_EXLCK) {
1424 } else if (flock->fl_type == F_SHLCK) {
1433 cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
1437 __u64 length = 1 + flock->fl_end - flock->fl_start;
1446 rc = cifs_posix_lock_test(file, flock);
1455 hash_lockowner(flock->fl_owner),
1456 flock->fl_start, length, flock,
1461 rc = cifs_lock_test(cfile, flock->fl_start, length, type, flock);
1466 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, type,
1469 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length,
1471 flock->fl_type = F_UNLCK;
1479 flock->fl_type = F_WRLCK;
1485 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length,
1489 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length,
1491 flock->fl_type = F_RDLCK;
1496 flock->fl_type = F_WRLCK;
1521 cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
1535 __u64 length = 1 + flock->fl_end - flock->fl_start;
1563 if (flock->fl_start > li->offset ||
1564 (flock->fl_start + length) <
1634 cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1639 __u64 length = 1 + flock->fl_end - flock->fl_start;
1648 rc = cifs_posix_lock_set(file, flock);
1661 hash_lockowner(flock->fl_owner),
1662 flock->fl_start, length,
1670 lock = cifs_lock_init(flock->fl_start, length, type,
1671 flock->fl_flags);
1698 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length,
1707 rc = server->ops->mand_unlock_range(cfile, flock, xid);
1710 if ((flock->fl_flags & FL_POSIX) || (flock->fl_flags & FL_FLOCK)) {
1719 if (!(flock->fl_flags & FL_CLOSE))
1722 rc = locks_lock_file_wait(file, flock);
1776 int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1791 cmd, flock->fl_flags, flock->fl_type,
1792 flock->fl_start, flock->fl_end);
1797 cifs_read_flock(flock, &type, &lock, &unlock, &wait_flag,
1810 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid);
1824 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock,