/kernel/linux/linux-5.10/fs/ |
H A D | fcntl.c | 334 struct flock flock; in do_fcntl() local 362 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl() 364 err = fcntl_getlk(filp, cmd, &flock); in do_fcntl() 365 if (!err && copy_to_user(argp, &flock, sizeof(flock))) in do_fcntl() 376 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl() 378 err = fcntl_setlk(fd, filp, cmd, &flock); in do_fcntl() 485 struct flock64 flock; SYSCALL_DEFINE3() local 609 fixup_compat_flock(struct flock *flock) fixup_compat_flock() argument 622 struct flock flock; do_compat_fcntl64() local [all...] |
H A D | locks.c | 37 * FL_FLOCK locks are created with calls to flock(), through the flock() 38 * system call, which is new. Old C libraries implement flock() via fcntl() 41 * FL_FLOCK locks follow the 4.4 BSD flock() semantics. They are associated 77 * flock() and fcntl(). 118 * If multiple threads attempt to lock the same byte (or flock the same file) 565 /* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX 569 struct flock *l) in flock_to_posix_lock() 2203 * sys_flock: - flock() system call. 2213 * - %LOCK_MAND -- a 'mandatory' flock 2315 posix_lock_to_flock(struct flock *flock, struct file_lock *fl) posix_lock_to_flock() argument 2337 posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) posix_lock_to_flock64() argument 2351 fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock) fcntl_getlk() argument 2476 fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, struct flock *flock) fcntl_setlk() argument 2564 fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock) fcntl_getlk64() argument 2607 fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, struct flock64 *flock) fcntl_setlk64() argument [all...] |
/kernel/linux/linux-6.6/fs/ |
H A D | fcntl.c | 319 struct flock flock; in do_fcntl() local 347 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl() 349 err = fcntl_getlk(filp, cmd, &flock); in do_fcntl() 350 if (!err && copy_to_user(argp, &flock, sizeof(flock))) in do_fcntl() 361 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl() 363 err = fcntl_setlk(fd, filp, cmd, &flock); in do_fcntl() 468 struct flock64 flock; SYSCALL_DEFINE3() local 592 fixup_compat_flock(struct flock *flock) fixup_compat_flock() argument 605 struct flock flock; do_compat_fcntl64() local [all...] |
H A D | locks.c | 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) in flock_to_posix_lock() 2055 * sys_flock: - flock() system call. 2065 * - %LOCK_MAND -- a 'mandatory' flock. (DEPRECATED) 2069 SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) in SYSCALL_DEFINE2() 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); in SYSCALL_DEFINE2() 2110 if (f.file->f_op->flock) in SYSCALL_DEFINE2() 2111 error = f.file->f_op->flock( in SYSCALL_DEFINE2() 2173 posix_lock_to_flock(struct flock *flock, struct file_lock *fl) posix_lock_to_flock() argument 2195 posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) posix_lock_to_flock64() argument 2209 fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock) fcntl_getlk() argument 2335 fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, struct flock *flock) fcntl_setlk() argument 2416 fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock) fcntl_getlk64() argument 2459 fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, struct flock64 *flock) fcntl_setlk64() argument [all...] |
/kernel/linux/linux-6.6/fs/9p/ |
H A D | vfs_file.c | 120 struct p9_flock flock; in v9fs_file_do_lock() local 137 memset(&flock, 0, sizeof(flock)); in v9fs_file_do_lock() 141 flock.type = P9_LOCK_TYPE_RDLCK; in v9fs_file_do_lock() 144 flock.type = P9_LOCK_TYPE_WRLCK; in v9fs_file_do_lock() 147 flock.type = P9_LOCK_TYPE_UNLCK; in v9fs_file_do_lock() 150 flock.start = fl->fl_start; in v9fs_file_do_lock() 152 flock.length = 0; in v9fs_file_do_lock() 154 flock.length = fl->fl_end - fl->fl_start + 1; in v9fs_file_do_lock() 155 flock in v9fs_file_do_lock() [all...] |
/kernel/linux/linux-5.10/fs/9p/ |
H A D | vfs_file.c | 137 struct p9_flock flock; in v9fs_file_do_lock() local 155 memset(&flock, 0, sizeof(flock)); in v9fs_file_do_lock() 159 flock.type = P9_LOCK_TYPE_RDLCK; in v9fs_file_do_lock() 162 flock.type = P9_LOCK_TYPE_WRLCK; in v9fs_file_do_lock() 165 flock.type = P9_LOCK_TYPE_UNLCK; in v9fs_file_do_lock() 168 flock.start = fl->fl_start; in v9fs_file_do_lock() 170 flock.length = 0; in v9fs_file_do_lock() 172 flock.length = fl->fl_end - fl->fl_start + 1; in v9fs_file_do_lock() 173 flock in v9fs_file_do_lock() [all...] |
/kernel/linux/linux-5.10/fs/cifs/ |
H A D | file.c | 1028 * style). If such a lock exists, update the flock structure with its 1029 * properties. Otherwise, set the flock type to F_UNLCK if we can cache brlocks 1035 __u8 type, struct file_lock *flock) in cifs_lock_test() 1046 flock->fl_flags, &conf_lock, in cifs_lock_test() 1049 flock->fl_start = conf_lock->offset; in cifs_lock_test() 1050 flock->fl_end = conf_lock->offset + conf_lock->length - 1; in cifs_lock_test() 1051 flock->fl_pid = conf_lock->pid; in cifs_lock_test() 1053 flock->fl_type = F_RDLCK; in cifs_lock_test() 1055 flock->fl_type = F_WRLCK; in cifs_lock_test() 1059 flock in cifs_lock_test() 1034 cifs_lock_test(struct cifsFileInfo *cfile, __u64 offset, __u64 length, __u8 type, struct file_lock *flock) cifs_lock_test() argument 1130 cifs_posix_lock_test(struct file *file, struct file_lock *flock) cifs_posix_lock_test() argument 1159 cifs_posix_lock_set(struct file *file, struct file_lock *flock) cifs_posix_lock_set() argument 1275 struct file_lock *flock; cifs_push_posix_locks() local 1386 cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock, bool *wait_flag, struct TCP_Server_Info *server) cifs_read_flock() argument 1433 cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, bool wait_flag, bool posix_lck, unsigned int xid) cifs_getlk() argument 1521 cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, unsigned int xid) cifs_unlock_range() argument 1634 cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, bool wait_flag, bool posix_lck, int lock, int unlock, unsigned int xid) cifs_setlk() argument 1776 cifs_lock(struct file *file, int cmd, struct file_lock *flock) cifs_lock() argument [all...] |
H A D | smb2file.c | 116 smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, in smb2_unlock_range() argument 125 __u64 length = 1 + flock->fl_end - flock->fl_start; in smb2_unlock_range() 149 if (flock->fl_start > li->offset || in smb2_unlock_range() 150 (flock->fl_start + length) < in smb2_unlock_range() 155 * flock and OFD lock are associated with an open in smb2_unlock_range() 158 if (!(flock->fl_flags & (FL_FLOCK | FL_OFDLCK))) in smb2_unlock_range()
|
/kernel/linux/linux-6.6/fs/smb/client/ |
H A D | file.c | 1298 * style). If such a lock exists, update the flock structure with its 1299 * properties. Otherwise, set the flock type to F_UNLCK if we can cache brlocks 1305 __u8 type, struct file_lock *flock) in cifs_lock_test() 1316 flock->fl_flags, &conf_lock, in cifs_lock_test() 1319 flock->fl_start = conf_lock->offset; in cifs_lock_test() 1320 flock->fl_end = conf_lock->offset + conf_lock->length - 1; in cifs_lock_test() 1321 flock->fl_pid = conf_lock->pid; in cifs_lock_test() 1323 flock->fl_type = F_RDLCK; in cifs_lock_test() 1325 flock->fl_type = F_WRLCK; in cifs_lock_test() 1329 flock in cifs_lock_test() 1304 cifs_lock_test(struct cifsFileInfo *cfile, __u64 offset, __u64 length, __u8 type, struct file_lock *flock) cifs_lock_test() argument 1401 cifs_posix_lock_test(struct file *file, struct file_lock *flock) cifs_posix_lock_test() argument 1430 cifs_posix_lock_set(struct file *file, struct file_lock *flock) cifs_posix_lock_set() argument 1548 struct file_lock *flock; cifs_push_posix_locks() local 1664 cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock, bool *wait_flag, struct TCP_Server_Info *server) cifs_read_flock() argument 1711 cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, bool wait_flag, bool posix_lck, unsigned int xid) cifs_getlk() argument 1802 cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, unsigned int xid) cifs_unlock_range() argument 1916 cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, bool wait_flag, bool posix_lck, int lock, int unlock, unsigned int xid) cifs_setlk() argument 2059 cifs_lock(struct file *file, int cmd, struct file_lock *flock) cifs_lock() argument [all...] |
H A D | smb2file.c | 189 smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, in smb2_unlock_range() argument 198 __u64 length = 1 + flock->fl_end - flock->fl_start; in smb2_unlock_range() 222 if (flock->fl_start > li->offset || in smb2_unlock_range() 223 (flock->fl_start + length) < in smb2_unlock_range() 228 * flock and OFD lock are associated with an open in smb2_unlock_range() 231 if (!(flock->fl_flags & (FL_FLOCK | FL_OFDLCK))) in smb2_unlock_range()
|
/kernel/liteos_a/kernel/base/vm/ |
H A D | los_vm_scan.c | 245 SPIN_LOCK_S *flock = NULL; in OsShrinkInactiveList() local 252 flock = &fpage->mapping->list_lock; in OsShrinkInactiveList() 254 if (LOS_SpinTrylock(flock) != LOS_OK) { in OsShrinkInactiveList() 260 LOS_SpinUnlock(flock); in OsShrinkInactiveList() 265 LOS_SpinUnlock(flock); in OsShrinkInactiveList() 277 LOS_SpinUnlock(flock); in OsShrinkInactiveList()
|
/kernel/linux/linux-6.6/tools/testing/selftests/filelock/ |
H A D | ofdlocks.c | 11 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()
|
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/nx-gzip/include/ |
H A D | nx_dbg.h | 34 flock(nx_gzip_log->_fileno, LOCK_EX); \ 42 flock(nx_gzip_log->_fileno, LOCK_UN); \
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/nx-gzip/include/ |
H A D | nx_dbg.h | 34 flock(nx_gzip_log->_fileno, LOCK_EX); \ 42 flock(nx_gzip_log->_fileno, LOCK_UN); \
|
/kernel/linux/linux-6.6/arch/arm/kernel/ |
H A D | sys_oabi-compat.c | 239 struct flock64 flock; in sys_oabi_fcntl64() local 251 err = get_oabi_flock(&flock, argp); in sys_oabi_fcntl64() 254 err = fcntl_getlk64(f.file, 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, f.file, cmd, &flock); in sys_oabi_fcntl64()
|
/kernel/linux/linux-6.6/include/linux/ |
H A D | filelock.h | 73 * POSIX byte range locks, BSD (flock) locks, and leases. It's important to 137 int fcntl_getlk(struct file *, unsigned int, struct flock *); 139 struct flock *); 192 struct flock __user *user) in fcntl_getlk() 198 unsigned int cmd, struct flock __user *user) in fcntl_setlk()
|
/kernel/linux/linux-5.10/tools/testing/selftests/wireguard/qemu/ |
H A D | Makefile | 41 flock -x $$@.lock -c '[ -f $$@ ] && exit 0; wget -O $$@.tmp $(MIRROR)$(1) || wget -O $$@.tmp $(2)$(1) || rm -f $$@.tmp; [ -f $$@.tmp ] || exit 1; if echo "$(3) $$@.tmp" | sha256sum -c -; then mv $$@.tmp $$@; else rm -f $$@.tmp; exit 71; fi' 270 flock -s $<.lock tar -C $(BUILD_PATH) -xf $< 286 flock -s $<.lock tar -C $(BUILD_PATH) -xf $< 298 flock -s $<.lock tar -C $(BUILD_PATH) -xf $< 312 flock -s $<.lock tar -C $(BUILD_PATH) -xf $< 322 flock -s $<.lock tar -C $(BUILD_PATH) -xf $< 332 flock -s $<.lock tar -C $(BUILD_PATH) -xf $< 347 flock -s $<.lock tar -C $(BUILD_PATH) -xf $< 358 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
|
/kernel/linux/linux-6.6/tools/testing/selftests/wireguard/qemu/ |
H A D | Makefile | 37 flock -x $$@.lock -c '[ -f $$@ ] && exit 0; wget -O $$@.tmp $(MIRROR)$(1) || wget -O $$@.tmp $(2)$(1) || rm -f $$@.tmp; [ -f $$@.tmp ] || exit 1; if ([ -n "$(4)" ] && sed -n "s#^\([a-f0-9]\{64\}\) \($(1)\)\$$$$#\1 $(DISTFILES_PATH)/\2.tmp#p" "$(4)" || echo "$(3) $$@.tmp") | sha256sum -c -; then mv $$@.tmp $$@; else rm -f $$@.tmp; exit 71; fi' 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 $<
|
/kernel/linux/linux-6.6/fs/smb/server/ |
H A D | vfs.h | 140 void ksmbd_vfs_posix_lock_wait(struct file_lock *flock); 141 int ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout); 142 void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock);
|
H A D | vfs.c | 328 struct file_lock *flock; in check_lock_range() local 336 list_for_each_entry(flock, &ctx->flc_posix, fl_list) { in check_lock_range() 338 if (flock->fl_end >= start && end >= flock->fl_start) { in check_lock_range() 339 if (flock->fl_type == F_RDLCK) { in check_lock_range() 345 } else if (flock->fl_type == F_WRLCK) { in check_lock_range() 347 if (flock->fl_file != filp) { in check_lock_range() 1825 void ksmbd_vfs_posix_lock_wait(struct file_lock *flock) in ksmbd_vfs_posix_lock_wait() argument 1827 wait_event(flock->fl_wait, !flock in ksmbd_vfs_posix_lock_wait() 1830 ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout) ksmbd_vfs_posix_lock_wait_timeout() argument 1837 ksmbd_vfs_posix_lock_unblock(struct file_lock *flock) ksmbd_vfs_posix_lock_unblock() argument [all...] |
/kernel/linux/linux-5.10/arch/mips/include/uapi/asm/ |
H A D | fcntl.h | 54 * The flavours of struct flock. "struct flock" is the ABI compliant 55 * variant. Finally struct flock64 is the LFS variant of struct flock. As 57 * contain all the same fields as struct flock. 64 struct flock { struct
|
/kernel/linux/patches/linux-5.10/prebuilts/usr/include/asm-mips/asm/ |
H A D | fcntl.h | 21 #include <bits/flock.h>
|
/kernel/linux/patches/linux-6.6/prebuilts/usr/include/asm-mips/asm/ |
H A D | fcntl.h | 21 #include <bits/flock.h>
|
/kernel/linux/linux-5.10/drivers/nvme/target/ |
H A D | fc.c | 85 spinlock_t flock; member 640 spin_lock_init(&fod->flock); in nvmet_fc_prep_fcp_iodlist() 902 spin_lock(&fod->flock); in nvmet_fc_delete_target_queue() 911 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue() 915 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue() 2292 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_transfer_fcp_data() 2294 spin_unlock_irqrestore(&fod->flock, flags); in nvmet_fc_transfer_fcp_data() 2335 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_fod_op_done() 2338 spin_unlock_irqrestore(&fod->flock, flags); in nvmet_fc_fod_op_done() 2347 spin_lock_irqsave(&fod->flock, flag in nvmet_fc_fod_op_done() [all...] |
/kernel/linux/linux-6.6/drivers/nvme/target/ |
H A D | fc.c | 85 spinlock_t flock; member 652 spin_lock_init(&fod->flock); in nvmet_fc_prep_fcp_iodlist() 899 spin_lock(&fod->flock); in nvmet_fc_delete_target_queue() 908 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue() 912 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue() 2315 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_transfer_fcp_data() 2317 spin_unlock_irqrestore(&fod->flock, flags); in nvmet_fc_transfer_fcp_data() 2358 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_fod_op_done() 2361 spin_unlock_irqrestore(&fod->flock, flags); in nvmet_fc_fod_op_done() 2370 spin_lock_irqsave(&fod->flock, flag in nvmet_fc_fod_op_done() [all...] |