• Home
  • Raw
  • Download

Lines Matching refs:flock

860 	       __u8 type, struct file_lock *flock)  in cifs_lock_test()  argument
873 flock->fl_start = conf_lock->offset; in cifs_lock_test()
874 flock->fl_end = conf_lock->offset + conf_lock->length - 1; in cifs_lock_test()
875 flock->fl_pid = conf_lock->pid; in cifs_lock_test()
877 flock->fl_type = F_RDLCK; in cifs_lock_test()
879 flock->fl_type = F_WRLCK; in cifs_lock_test()
883 flock->fl_type = F_UNLCK; in cifs_lock_test()
953 cifs_posix_lock_test(struct file *file, struct file_lock *flock) in cifs_posix_lock_test() argument
957 unsigned char saved_type = flock->fl_type; in cifs_posix_lock_test()
959 if ((flock->fl_flags & FL_POSIX) == 0) in cifs_posix_lock_test()
963 posix_test_lock(file, flock); in cifs_posix_lock_test()
965 if (flock->fl_type == F_UNLCK && !cinode->can_cache_brlcks) { in cifs_posix_lock_test()
966 flock->fl_type = saved_type; in cifs_posix_lock_test()
981 cifs_posix_lock_set(struct file *file, struct file_lock *flock) in cifs_posix_lock_set() argument
986 if ((flock->fl_flags & FL_POSIX) == 0) in cifs_posix_lock_set()
996 rc = posix_lock_file(file, flock, NULL); in cifs_posix_lock_set()
999 rc = wait_event_interruptible(flock->fl_wait, !flock->fl_next); in cifs_posix_lock_set()
1002 locks_delete_block(flock); in cifs_posix_lock_set()
1096 struct file_lock *flock, **before; in cifs_push_posix_locks() local
1131 flock = *before; in cifs_push_posix_locks()
1132 if ((flock->fl_flags & FL_POSIX) == 0) in cifs_push_posix_locks()
1142 length = 1 + flock->fl_end - flock->fl_start; in cifs_push_posix_locks()
1143 if (flock->fl_type == F_RDLCK || flock->fl_type == F_SHLCK) in cifs_push_posix_locks()
1148 lck->pid = flock->fl_pid; in cifs_push_posix_locks()
1152 lck->offset = flock->fl_start; in cifs_push_posix_locks()
1208 cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock, in cifs_read_flock() argument
1211 if (flock->fl_flags & FL_POSIX) in cifs_read_flock()
1213 if (flock->fl_flags & FL_FLOCK) in cifs_read_flock()
1215 if (flock->fl_flags & FL_SLEEP) { in cifs_read_flock()
1219 if (flock->fl_flags & FL_ACCESS) in cifs_read_flock()
1221 if (flock->fl_flags & FL_LEASE) in cifs_read_flock()
1223 if (flock->fl_flags & in cifs_read_flock()
1226 cifs_dbg(FYI, "Unknown lock flags 0x%x\n", flock->fl_flags); in cifs_read_flock()
1229 if (flock->fl_type == F_WRLCK) { in cifs_read_flock()
1233 } else if (flock->fl_type == F_UNLCK) { in cifs_read_flock()
1238 } else if (flock->fl_type == F_RDLCK) { in cifs_read_flock()
1242 } else if (flock->fl_type == F_EXLCK) { in cifs_read_flock()
1246 } else if (flock->fl_type == F_SHLCK) { in cifs_read_flock()
1255 cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, in cifs_getlk() argument
1259 __u64 length = 1 + flock->fl_end - flock->fl_start; in cifs_getlk()
1268 rc = cifs_posix_lock_test(file, flock); in cifs_getlk()
1277 flock->fl_start, length, flock, in cifs_getlk()
1282 rc = cifs_lock_test(cfile, flock->fl_start, length, type, flock); in cifs_getlk()
1287 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, type, in cifs_getlk()
1290 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1292 flock->fl_type = F_UNLCK; in cifs_getlk()
1300 flock->fl_type = F_WRLCK; in cifs_getlk()
1306 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1310 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_getlk()
1312 flock->fl_type = F_RDLCK; in cifs_getlk()
1317 flock->fl_type = F_WRLCK; in cifs_getlk()
1342 cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, in cifs_unlock_range() argument
1354 __u64 length = 1 + flock->fl_end - flock->fl_start; in cifs_unlock_range()
1378 if (flock->fl_start > li->offset || in cifs_unlock_range()
1379 (flock->fl_start + length) < in cifs_unlock_range()
1449 cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, in cifs_setlk() argument
1454 __u64 length = 1 + flock->fl_end - flock->fl_start; in cifs_setlk()
1463 rc = cifs_posix_lock_set(file, flock); in cifs_setlk()
1476 current->tgid, flock->fl_start, length, in cifs_setlk()
1484 lock = cifs_lock_init(flock->fl_start, length, type); in cifs_setlk()
1511 rc = server->ops->mand_lock(xid, cfile, flock->fl_start, length, in cifs_setlk()
1520 rc = server->ops->mand_unlock_range(cfile, flock, xid); in cifs_setlk()
1523 if (flock->fl_flags & FL_POSIX) in cifs_setlk()
1524 posix_lock_file_wait(file, flock); in cifs_setlk()
1528 int cifs_lock(struct file *file, int cmd, struct file_lock *flock) in cifs_lock() argument
1545 cmd, flock->fl_flags, flock->fl_type, in cifs_lock()
1546 flock->fl_start, flock->fl_end); in cifs_lock()
1551 cifs_read_flock(flock, &type, &lock, &unlock, &wait_flag, in cifs_lock()
1567 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); in cifs_lock()
1581 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, in cifs_lock()