Lines Matching defs:flock

7  * see the flock(2) man page; for details about the other three, see
12 * If multiple threads attempt to lock the same byte (or flock the same file)
538 /* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX
542 struct flock *l)
2117 * sys_flock: - flock() system call.
2127 * - %LOCK_MAND -- a 'mandatory' flock. (DEPRECATED)
2131 SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
2146 pr_warn_once("%s(%d): Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n", current->comm, current->pid);
2172 if (f.file->f_op->flock)
2173 error = f.file->f_op->flock(f.file,
2224 * If the flock owner process is dead and its pid has been already
2226 * flock owner pid number in init pidns.
2238 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
2240 flock->l_pid = locks_translate_pid(&fl->c, task_active_pid_ns(current));
2244 * legacy 32bit flock.
2251 flock->l_start = fl->fl_start;
2252 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 :
2254 flock->l_whence = 0;
2255 flock->l_type = fl->c.flc_type;
2260 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl)
2262 flock->l_pid = locks_translate_pid(&fl->c, task_active_pid_ns(current));
2263 flock->l_start = fl->fl_start;
2264 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 :
2266 flock->l_whence = 0;
2267 flock->l_type = fl->c.flc_type;
2274 int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock)
2283 if (cmd != F_OFD_GETLK && flock->l_type != F_RDLCK
2284 && flock->l_type != F_WRLCK)
2287 error = flock_to_posix_lock(filp, fl, flock);
2293 if (flock->l_pid != 0)
2304 flock->l_type = fl->c.flc_type;
2306 error = posix_lock_to_flock(flock, fl);
2403 struct flock *flock)
2413 error = flock_to_posix_lock(filp, file_lock, flock);
2428 if (flock->l_pid != 0)
2437 if (flock->l_pid != 0)
2483 int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock)
2493 if (cmd != F_OFD_GETLK && flock->l_type != F_RDLCK
2494 && flock->l_type != F_WRLCK)
2497 error = flock64_to_posix_lock(filp, fl, flock);
2503 if (flock->l_pid != 0)
2514 flock->l_type = fl->c.flc_type;
2516 posix_lock_to_flock64(flock, fl);
2527 struct flock64 *flock)
2536 error = flock64_to_posix_lock(filp, file_lock, flock);
2551 if (flock->l_pid != 0)
2560 if (flock->l_pid != 0)
2655 if (filp->f_op->flock)
2656 filp->f_op->flock(filp, F_SETLKW, &fl);
2699 /* remove flock locks */