Home
last modified time | relevance | path

Searched refs:flock (Results 1 – 25 of 78) sorted by relevance

1234

/linux-6.15/fs/
H A Dfcntl.c451 struct flock flock; in do_fcntl() local
485 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl()
488 if (!err && copy_to_user(argp, &flock, sizeof(flock))) in do_fcntl()
499 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl()
602 struct flock64 flock; in SYSCALL_DEFINE3() local
621 if (copy_from_user(&flock, argp, sizeof(flock))) in SYSCALL_DEFINE3()
624 if (!err && copy_to_user(argp, &flock, sizeof(flock))) in SYSCALL_DEFINE3()
632 if (copy_from_user(&flock, argp, sizeof(flock))) in SYSCALL_DEFINE3()
723 static int fixup_compat_flock(struct flock *flock) in fixup_compat_flock() argument
728 flock->l_len = COMPAT_OFF_T_MAX; in fixup_compat_flock()
[all …]
H A Dlocks.c2237 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) in posix_lock_to_flock() argument
2253 flock->l_whence = 0; in posix_lock_to_flock()
2265 flock->l_whence = 0; in posix_lock_to_flock64()
2273 int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock) in fcntl_getlk() argument
2292 if (flock->l_pid != 0) in fcntl_getlk()
2402 struct flock *flock) in fcntl_setlk() argument
2427 if (flock->l_pid != 0) in fcntl_setlk()
2436 if (flock->l_pid != 0) in fcntl_setlk()
2501 if (flock->l_pid != 0) in fcntl_getlk64()
2525 struct flock64 *flock) in fcntl_setlk64() argument
[all …]
/linux-6.15/fs/9p/
H A Dvfs_file.c120 struct p9_flock flock; in v9fs_file_do_lock() local
136 memset(&flock, 0, sizeof(flock)); in v9fs_file_do_lock()
140 flock.type = P9_LOCK_TYPE_RDLCK; in v9fs_file_do_lock()
143 flock.type = P9_LOCK_TYPE_WRLCK; in v9fs_file_do_lock()
146 flock.type = P9_LOCK_TYPE_UNLCK; in v9fs_file_do_lock()
149 flock.start = fl->fl_start; in v9fs_file_do_lock()
151 flock.length = 0; in v9fs_file_do_lock()
154 flock.proc_id = fl->c.flc_pid; in v9fs_file_do_lock()
182 kfree(flock.client_id); in v9fs_file_do_lock()
218 kfree(flock.client_id); in v9fs_file_do_lock()
[all …]
/linux-6.15/Documentation/filesystems/
H A Dlocks.rst18 The old flock(2) emulation in the kernel was swapped for proper BSD
19 compatible flock(2) support in the 1.3.x series of kernels. With the
33 Because sendmail was unable to use the old flock() emulation, many sendmail
34 installations use fcntl() instead of flock(). This is true of Slackware 3.0
38 file with flock(). With pre 1.3.96 kernels this could result in deadlocks that,
46 is to make flock() and fcntl() locks oblivious to each other. Both can
53 cooperative flock()/fcntl() are those that emulate flock() using
/linux-6.15/fs/smb/client/
H A Dfile.c1616 flock->c.flc_type = F_UNLCK; in cifs_lock_test()
1698 posix_test_lock(file, flock); in cifs_posix_lock_test()
1835 struct file_lock *flock; in cifs_push_posix_locks() local
1968 if (flock->c.flc_flags & in cifs_read_flock()
1975 if (lock_is_write(flock)) { in cifs_read_flock()
2025 flock->fl_start, length, flock, in cifs_getlk()
2031 rc = cifs_lock_test(cfile, flock->fl_start, length, type, flock); in cifs_getlk()
2041 flock->c.flc_type = F_UNLCK; in cifs_getlk()
2304 if ((flock->c.flc_flags & FL_POSIX) || (flock->c.flc_flags & FL_FLOCK)) { in cifs_setlk()
2385 flock->c.flc_flags, flock->c.flc_type, in cifs_lock()
[all …]
H A Dsmb2file.c257 smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, in smb2_unlock_range() argument
266 __u64 length = 1 + flock->fl_end - flock->fl_start; in smb2_unlock_range()
288 if (flock->fl_start > li->offset || in smb2_unlock_range()
289 (flock->fl_start + length) < in smb2_unlock_range()
297 if (!(flock->c.flc_flags & (FL_FLOCK | FL_OFDLCK))) in smb2_unlock_range()
/linux-6.15/tools/testing/selftests/filelock/
H A Dofdlocks.c11 static int lock_set(int fd, struct flock *fl) in lock_set()
23 static int lock_get(int fd, struct flock *fl) in lock_get()
38 struct flock fl, fl2; in main()
/linux-6.15/tools/testing/selftests/powerpc/nx-gzip/include/
H A Dnx_dbg.h34 flock(nx_gzip_log->_fileno, LOCK_EX); \
42 flock(nx_gzip_log->_fileno, LOCK_UN); \
/linux-6.15/arch/arm/kernel/
H A Dsys_oabi-compat.c239 struct flock64 flock; in sys_oabi_fcntl64() local
251 err = get_oabi_flock(&flock, argp); in sys_oabi_fcntl64()
254 err = fcntl_getlk64(fd_file(f), cmd, &flock); in sys_oabi_fcntl64()
256 err = put_oabi_flock(&flock, argp); in sys_oabi_fcntl64()
265 err = get_oabi_flock(&flock, argp); in sys_oabi_fcntl64()
268 err = fcntl_setlk64(fd, fd_file(f), cmd, &flock); in sys_oabi_fcntl64()
/linux-6.15/tools/testing/selftests/wireguard/qemu/
H A DMakefile37flock -x [email protected] -c '[ -f $$@ ] && exit 0; wget -O [email protected] $(MIRROR)$(1) || wget -O [email protected] $(2)$…
354 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
364 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
377 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
391 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
401 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
411 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
426 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
437 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
/linux-6.15/include/linux/
H A Dfilelock.h150 int fcntl_getlk(struct file *, unsigned int, struct flock *);
152 struct flock *);
235 struct flock __user *user) in fcntl_getlk()
241 unsigned int cmd, struct flock __user *user) in fcntl_setlk()
/linux-6.15/drivers/nvme/target/
H A Dfc.c85 spinlock_t flock; member
636 spin_lock_init(&fod->flock); in nvmet_fc_prep_fcp_iodlist()
883 spin_lock(&fod->flock); in nvmet_fc_delete_target_queue()
892 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue()
896 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue()
2285 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_transfer_fcp_data()
2328 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_fod_op_done()
2340 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_fod_op_done()
2431 spin_lock_irqsave(&fod->flock, flags); in __nvmet_fc_fcp_nvme_cmd_done()
2758 spin_lock(&fod->flock); in nvmet_fc_rcv_fcp_abort()
[all …]
/linux-6.15/fs/smb/server/
H A Dvfs.h142 void ksmbd_vfs_posix_lock_wait(struct file_lock *flock);
143 void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock);
H A Dvfs.c315 struct file_lock *flock; in check_lock_range() local
323 for_each_file_lock(flock, &ctx->flc_posix) { in check_lock_range()
325 if (flock->fl_end >= start && end >= flock->fl_start) { in check_lock_range()
326 if (lock_is_read(flock)) { in check_lock_range()
332 } else if (lock_is_write(flock)) { in check_lock_range()
334 if (flock->c.flc_file != filp) { in check_lock_range()
1842 void ksmbd_vfs_posix_lock_wait(struct file_lock *flock) in ksmbd_vfs_posix_lock_wait() argument
1844 wait_event(flock->c.flc_wait, !flock->c.flc_blocker); in ksmbd_vfs_posix_lock_wait()
1847 void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock) in ksmbd_vfs_posix_lock_unblock() argument
1849 locks_delete_block(flock); in ksmbd_vfs_posix_lock_unblock()
H A Dsmb2pdu.c7254 lock->fl = flock; in smb2_lock_init()
7273 locks_wake_up(flock); in smb2_remove_blocked_lock()
7332 if (!flock) in smb2_lock()
7342 locks_free_lock(flock); in smb2_lock()
7355 flock->fl_end = flock->fl_start + lock_length; in smb2_lock()
7357 if (flock->fl_end < flock->fl_start) { in smb2_lock()
7360 flock->fl_end, flock->fl_start); in smb2_lock()
7362 locks_free_lock(flock); in smb2_lock()
7383 locks_free_lock(flock); in smb2_lock()
7490 flock = smb_lock->fl; in smb2_lock()
[all …]
/linux-6.15/fs/afs/
H A DMakefile18 flock.o \
/linux-6.15/net/9p/
H A Dclient.c2231 int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status) in p9_client_lock_dotl() argument
2240 fid->fid, flock->type, flock->flags, flock->start, in p9_client_lock_dotl()
2241 flock->length, flock->proc_id, flock->client_id); in p9_client_lock_dotl()
2243 req = p9_client_rpc(clnt, P9_TLOCK, "dbdqqds", fid->fid, flock->type, in p9_client_lock_dotl()
2244 flock->flags, flock->start, flock->length, in p9_client_lock_dotl()
2245 flock->proc_id, flock->client_id); in p9_client_lock_dotl()
/linux-6.15/include/uapi/asm-generic/
H A Dfcntl.h194 struct flock { struct
/linux-6.15/tools/perf/trace/beauty/
H A DBuild3 perf-y += flock.o
/linux-6.15/tools/power/x86/intel-speed-select/
H A Disst-daemon.c212 if (flock(pid_file_handle, LOCK_EX|LOCK_NB) < 0) {
/linux-6.15/arch/um/os-Linux/
H A Dfile.c592 struct flock lock = ((struct flock) { .l_type = type, in os_lock_file()
/linux-6.15/include/net/9p/
H A Dclient.h226 int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status);
/linux-6.15/tools/perf/util/
H A Dbpf_counter.c357 err = flock(map_fd, LOCK_EX); in bperf_lock_attr_map()
592 flock(attr_map_fd, LOCK_UN); in bperf__load()
/linux-6.15/Documentation/arch/x86/
H A Dresctrl.rst1210 Locking is based on flock, which is available in libc and also as a shell
1215 A) Take flock(LOCK_EX) on /sys/fs/resctrl
1221 A) Take flock(LOCK_SH) on /sys/fs/resctrl
1228 $ flock -s /sys/fs/resctrl/ find /sys/fs/resctrl
1238 $ flock /sys/fs/resctrl/ ./create-dir.sh
1254 ret = flock(fd, LOCK_SH);
1256 perror("flock");
1266 ret = flock(fd, LOCK_EX);
1268 perror("flock");
1278 ret = flock(fd, LOCK_UN);
[all …]
/linux-6.15/kernel/
H A Dsys_ni.c66 COND_SYSCALL(flock);

1234