Lines Matching refs:flock
252 struct flock *l) in flock_to_posix_lock()
1109 struct file_lock *new_fl, *flock; in __get_lease() local
1122 flock = inode->i_flock; in __get_lease()
1123 if ((flock == NULL) || (flock->fl_flags & FL_LEASE) == 0) in __get_lease()
1126 for (fl = flock; fl && (fl->fl_flags & FL_LEASE); fl = fl->fl_next) in __get_lease()
1133 } else if (flock->fl_type & F_INPROGRESS) { in __get_lease()
1135 future = flock->fl_type; in __get_lease()
1136 } else if (flock->fl_type & F_WRLCK) { in __get_lease()
1156 for (fl = flock; fl && (fl->fl_flags & FL_LEASE); fl = fl->fl_next) { in __get_lease()
1170 break_time = flock->fl_break_time; in __get_lease()
1176 error = locks_block_on_timeout(flock, new_fl, break_time); in __get_lease()
1181 for (flock = inode->i_flock; in __get_lease()
1182 flock && (flock->fl_flags & FL_LEASE); in __get_lease()
1183 flock = flock->fl_next) { in __get_lease()
1184 if (flock->fl_type & F_INPROGRESS) in __get_lease()
1207 struct file_lock *flock = inode->i_flock; in lease_get_mtime() local
1208 if (flock && (flock->fl_flags & FL_LEASE) && (flock->fl_type & F_WRLCK)) in lease_get_mtime()
1410 int fcntl_getlk(unsigned int fd, struct flock *l) in fcntl_getlk()
1414 struct flock flock; in fcntl_getlk() local
1418 if (copy_from_user(&flock, l, sizeof(flock))) in fcntl_getlk()
1421 if ((flock.l_type != F_RDLCK) && (flock.l_type != F_WRLCK)) in fcntl_getlk()
1429 error = flock_to_posix_lock(filp, &file_lock, &flock); in fcntl_getlk()
1446 flock.l_type = F_UNLCK; in fcntl_getlk()
1448 flock.l_pid = fl->fl_pid; in fcntl_getlk()
1461 flock.l_start = fl->fl_start; in fcntl_getlk()
1462 flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : in fcntl_getlk()
1464 flock.l_whence = 0; in fcntl_getlk()
1465 flock.l_type = fl->fl_type; in fcntl_getlk()
1468 if (!copy_to_user(l, &flock, sizeof(flock))) in fcntl_getlk()
1481 struct flock *l) in fcntl_setlk()
1485 struct flock flock; in fcntl_setlk() local
1496 if (copy_from_user(&flock, l, sizeof(flock))) in fcntl_setlk()
1518 error = flock_to_posix_lock(filp, file_lock, &flock); in fcntl_setlk()
1523 switch (flock.l_type) { in fcntl_setlk()
1567 if (!error && flock.l_type != F_UNLCK && filp != f) { in fcntl_setlk()
1584 struct flock64 flock; in fcntl_getlk64() local
1588 if (copy_from_user(&flock, l, sizeof(flock))) in fcntl_getlk64()
1591 if ((flock.l_type != F_RDLCK) && (flock.l_type != F_WRLCK)) in fcntl_getlk64()
1599 error = flock64_to_posix_lock(filp, &file_lock, &flock); in fcntl_getlk64()
1616 flock.l_type = F_UNLCK; in fcntl_getlk64()
1618 flock.l_pid = fl->fl_pid; in fcntl_getlk64()
1619 flock.l_start = fl->fl_start; in fcntl_getlk64()
1620 flock.l_len = fl->fl_end == OFFSET_MAX ? 0 : in fcntl_getlk64()
1622 flock.l_whence = 0; in fcntl_getlk64()
1623 flock.l_type = fl->fl_type; in fcntl_getlk64()
1626 if (!copy_to_user(l, &flock, sizeof(flock))) in fcntl_getlk64()
1643 struct flock64 flock; in fcntl_setlk64() local
1654 if (copy_from_user(&flock, l, sizeof(flock))) in fcntl_setlk64()
1676 error = flock64_to_posix_lock(filp, file_lock, &flock); in fcntl_setlk64()
1681 switch (flock.l_type) { in fcntl_setlk64()
1710 if (!error && flock.l_type != F_UNLCK && filp != f) { in fcntl_setlk64()