Lines Matching refs: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)
502 /* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX
506 struct flock *l)
2055 * sys_flock: - flock() system call.
2065 * - %LOCK_MAND -- a 'mandatory' flock. (DEPRECATED)
2069 SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
2084 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);
2110 if (f.file->f_op->flock)
2111 error = f.file->f_op->flock(f.file,
2159 * If the flock owner process is dead and its pid has been already
2161 * flock owner pid number in init pidns.
2173 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
2175 flock->l_pid = locks_translate_pid(fl, task_active_pid_ns(current));
2179 * legacy 32bit flock.
2186 flock->l_start = fl->fl_start;
2187 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 :
2189 flock->l_whence = 0;
2190 flock->l_type = fl->fl_type;
2195 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl)
2197 flock->l_pid = locks_translate_pid(fl, task_active_pid_ns(current));
2198 flock->l_start = fl->fl_start;
2199 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 :
2201 flock->l_whence = 0;
2202 flock->l_type = fl->fl_type;
2209 int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock)
2218 if (cmd != F_OFD_GETLK && flock->l_type != F_RDLCK
2219 && flock->l_type != F_WRLCK)
2222 error = flock_to_posix_lock(filp, fl, flock);
2228 if (flock->l_pid != 0)
2239 flock->l_type = fl->fl_type;
2241 error = posix_lock_to_flock(flock, fl);
2336 struct flock *flock)
2346 error = flock_to_posix_lock(filp, file_lock, flock);
2361 if (flock->l_pid != 0)
2370 if (flock->l_pid != 0)
2416 int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock)
2426 if (cmd != F_OFD_GETLK && flock->l_type != F_RDLCK
2427 && flock->l_type != F_WRLCK)
2430 error = flock64_to_posix_lock(filp, fl, flock);
2436 if (flock->l_pid != 0)
2447 flock->l_type = fl->fl_type;
2449 posix_lock_to_flock64(flock, fl);
2460 struct flock64 *flock)
2469 error = flock64_to_posix_lock(filp, file_lock, flock);
2484 if (flock->l_pid != 0)
2493 if (flock->l_pid != 0)
2588 if (filp->f_op->flock)
2589 filp->f_op->flock(filp, F_SETLKW, &fl);
2632 /* remove flock locks */