Home
last modified time | relevance | path

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

123

/linux-5.19.10/fs/
Dfcntl.c318 struct flock flock; in do_fcntl() local
346 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl()
348 err = fcntl_getlk(filp, cmd, &flock); in do_fcntl()
349 if (!err && copy_to_user(argp, &flock, sizeof(flock))) in do_fcntl()
360 if (copy_from_user(&flock, argp, sizeof(flock))) in do_fcntl()
362 err = fcntl_setlk(fd, filp, cmd, &flock); in do_fcntl()
467 struct flock64 flock; in SYSCALL_DEFINE3() local
486 if (copy_from_user(&flock, argp, sizeof(flock))) in SYSCALL_DEFINE3()
488 err = fcntl_getlk64(f.file, cmd, &flock); in SYSCALL_DEFINE3()
489 if (!err && copy_to_user(argp, &flock, sizeof(flock))) in SYSCALL_DEFINE3()
[all …]
Dlocks.c519 struct flock *l) in flock_to_posix_lock()
2098 SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) in SYSCALL_DEFINE2() argument
2143 if (f.file->f_op->flock) in SYSCALL_DEFINE2()
2144 error = f.file->f_op->flock(f.file, in SYSCALL_DEFINE2()
2207 static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) in posix_lock_to_flock() argument
2209 flock->l_pid = locks_translate_pid(fl, task_active_pid_ns(current)); in posix_lock_to_flock()
2220 flock->l_start = fl->fl_start; in posix_lock_to_flock()
2221 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 : in posix_lock_to_flock()
2223 flock->l_whence = 0; in posix_lock_to_flock()
2224 flock->l_type = fl->fl_type; in posix_lock_to_flock()
[all …]
/linux-5.19.10/fs/9p/
Dvfs_file.c132 struct p9_flock flock; in v9fs_file_do_lock() local
149 memset(&flock, 0, sizeof(flock)); in v9fs_file_do_lock()
153 flock.type = P9_LOCK_TYPE_RDLCK; in v9fs_file_do_lock()
156 flock.type = P9_LOCK_TYPE_WRLCK; in v9fs_file_do_lock()
159 flock.type = P9_LOCK_TYPE_UNLCK; in v9fs_file_do_lock()
162 flock.start = fl->fl_start; in v9fs_file_do_lock()
164 flock.length = 0; in v9fs_file_do_lock()
166 flock.length = fl->fl_end - fl->fl_start + 1; in v9fs_file_do_lock()
167 flock.proc_id = fl->fl_pid; in v9fs_file_do_lock()
168 flock.client_id = fid->clnt->name; in v9fs_file_do_lock()
[all …]
/linux-5.19.10/Documentation/filesystems/
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-5.19.10/fs/cifs/
Dfile.c1112 __u8 type, struct file_lock *flock) in cifs_lock_test() argument
1123 flock->fl_flags, &conf_lock, in cifs_lock_test()
1126 flock->fl_start = conf_lock->offset; in cifs_lock_test()
1127 flock->fl_end = conf_lock->offset + conf_lock->length - 1; in cifs_lock_test()
1128 flock->fl_pid = conf_lock->pid; in cifs_lock_test()
1130 flock->fl_type = F_RDLCK; in cifs_lock_test()
1132 flock->fl_type = F_WRLCK; in cifs_lock_test()
1136 flock->fl_type = F_UNLCK; in cifs_lock_test()
1207 cifs_posix_lock_test(struct file *file, struct file_lock *flock) in cifs_posix_lock_test() argument
1211 unsigned char saved_type = flock->fl_type; in cifs_posix_lock_test()
[all …]
Dsmb2file.c103 smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, in smb2_unlock_range() argument
112 __u64 length = 1 + flock->fl_end - flock->fl_start; in smb2_unlock_range()
136 if (flock->fl_start > li->offset || in smb2_unlock_range()
137 (flock->fl_start + length) < in smb2_unlock_range()
145 if (!(flock->fl_flags & (FL_FLOCK | FL_OFDLCK))) in smb2_unlock_range()
/linux-5.19.10/tools/testing/selftests/powerpc/nx-gzip/include/
Dnx_dbg.h34 flock(nx_gzip_log->_fileno, LOCK_EX); \
42 flock(nx_gzip_log->_fileno, LOCK_UN); \
/linux-5.19.10/arch/arm/kernel/
Dsys_oabi-compat.c236 struct flock64 flock; in sys_oabi_fcntl64() local
248 err = get_oabi_flock(&flock, argp); in sys_oabi_fcntl64()
251 err = fcntl_getlk64(f.file, cmd, &flock); in sys_oabi_fcntl64()
253 err = put_oabi_flock(&flock, argp); in sys_oabi_fcntl64()
262 err = get_oabi_flock(&flock, argp); in sys_oabi_fcntl64()
265 err = fcntl_setlk64(fd, f.file, cmd, &flock); in sys_oabi_fcntl64()
/linux-5.19.10/fs/ksmbd/
Dvfs.h139 void ksmbd_vfs_posix_lock_wait(struct file_lock *flock);
140 int ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout);
141 void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock);
Dvfs.c323 struct file_lock *flock; in check_lock_range() local
331 list_for_each_entry(flock, &ctx->flc_posix, fl_list) { in check_lock_range()
333 if (flock->fl_end >= start && end >= flock->fl_start) { in check_lock_range()
334 if (flock->fl_type == F_RDLCK) { in check_lock_range()
340 } else if (flock->fl_type == F_WRLCK) { in check_lock_range()
342 if (flock->fl_file != filp) { in check_lock_range()
1800 void ksmbd_vfs_posix_lock_wait(struct file_lock *flock) in ksmbd_vfs_posix_lock_wait() argument
1802 wait_event(flock->fl_wait, !flock->fl_blocker); in ksmbd_vfs_posix_lock_wait()
1805 int ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout) in ksmbd_vfs_posix_lock_wait_timeout() argument
1807 return wait_event_interruptible_timeout(flock->fl_wait, in ksmbd_vfs_posix_lock_wait_timeout()
[all …]
Dsmb2pdu.c6697 static int smb2_set_flock_flags(struct file_lock *flock, int flags) in smb2_set_flock_flags() argument
6706 flock->fl_type = F_RDLCK; in smb2_set_flock_flags()
6707 flock->fl_flags |= FL_SLEEP; in smb2_set_flock_flags()
6712 flock->fl_type = F_WRLCK; in smb2_set_flock_flags()
6713 flock->fl_flags |= FL_SLEEP; in smb2_set_flock_flags()
6719 flock->fl_type = F_RDLCK; in smb2_set_flock_flags()
6725 flock->fl_type = F_WRLCK; in smb2_set_flock_flags()
6729 flock->fl_type = F_UNLCK; in smb2_set_flock_flags()
6737 static struct ksmbd_lock *smb2_lock_init(struct file_lock *flock, in smb2_lock_init() argument
6748 lock->fl = flock; in smb2_lock_init()
[all …]
/linux-5.19.10/tools/testing/selftests/wireguard/qemu/
DMakefile37flock -x $$@.lock -c '[ -f $$@ ] && exit 0; wget -O $$@.tmp $(MIRROR)$(1) || wget -O $$@.tmp $(2)$…
337 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
347 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
360 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
374 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
384 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
394 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
409 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
420 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
/linux-5.19.10/drivers/nvme/target/
Dfc.c85 spinlock_t flock; member
642 spin_lock_init(&fod->flock); in nvmet_fc_prep_fcp_iodlist()
898 spin_lock(&fod->flock); in nvmet_fc_delete_target_queue()
907 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue()
911 spin_unlock(&fod->flock); in nvmet_fc_delete_target_queue()
2301 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_transfer_fcp_data()
2303 spin_unlock_irqrestore(&fod->flock, flags); in nvmet_fc_transfer_fcp_data()
2344 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_fod_op_done()
2347 spin_unlock_irqrestore(&fod->flock, flags); in nvmet_fc_fod_op_done()
2356 spin_lock_irqsave(&fod->flock, flags); in nvmet_fc_fod_op_done()
[all …]
/linux-5.19.10/fs/afs/
DMakefile16 flock.o \
/linux-5.19.10/tools/perf/trace/beauty/
DBuild3 perf-y += flock.o
/linux-5.19.10/net/9p/
Dclient.c2201 int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status) in p9_client_lock_dotl() argument
2211 fid->fid, flock->type, flock->flags, flock->start, in p9_client_lock_dotl()
2212 flock->length, flock->proc_id, flock->client_id); in p9_client_lock_dotl()
2214 req = p9_client_rpc(clnt, P9_TLOCK, "dbdqqds", fid->fid, flock->type, in p9_client_lock_dotl()
2215 flock->flags, flock->start, flock->length, in p9_client_lock_dotl()
2216 flock->proc_id, flock->client_id); in p9_client_lock_dotl()
/linux-5.19.10/tools/include/uapi/asm-generic/
Dfcntl.h196 struct flock { struct
/linux-5.19.10/include/uapi/asm-generic/
Dfcntl.h196 struct flock { struct
/linux-5.19.10/tools/power/x86/intel-speed-select/
Disst-daemon.c200 if (flock(pid_file_handle, LOCK_EX|LOCK_NB) < 0) {
/linux-5.19.10/include/net/9p/
Dclient.h223 int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status);
/linux-5.19.10/arch/um/os-Linux/
Dfile.c580 struct flock lock = ((struct flock) { .l_type = type, in os_lock_file()
/linux-5.19.10/Documentation/x86/
Dresctrl.rst991 Locking is based on flock, which is available in libc and also as a shell
996 A) Take flock(LOCK_EX) on /sys/fs/resctrl
1002 A) Take flock(LOCK_SH) on /sys/fs/resctrl
1009 $ flock -s /sys/fs/resctrl/ find /sys/fs/resctrl
1019 $ flock /sys/fs/resctrl/ ./create-dir.sh
1035 ret = flock(fd, LOCK_SH);
1037 perror("flock");
1047 ret = flock(fd, LOCK_EX);
1049 perror("flock");
1059 ret = flock(fd, LOCK_UN);
[all …]
/linux-5.19.10/tools/perf/util/
Dbpf_counter.c372 err = flock(map_fd, LOCK_EX); in bperf_lock_attr_map()
586 flock(attr_map_fd, LOCK_UN); in bperf__load()
/linux-5.19.10/kernel/
Dsys_ni.c88 COND_SYSCALL(flock);
/linux-5.19.10/fs/fuse/
Dfile.c313 if (ff->flock) { in fuse_file_release()
2490 int flock, struct fuse_lk_in *inarg) in fuse_lk_fill() argument
2503 if (flock) in fuse_lk_fill()
2532 static int fuse_setlk(struct file *file, struct file_lock *fl, int flock) in fuse_setlk() argument
2552 fuse_lk_fill(&args, file, fl, opcode, pid_nr, flock, &inarg); in fuse_setlk()
2597 ff->flock = true; in fuse_file_flock()
3180 .flock = fuse_file_flock,

123