Home
last modified time | relevance | path

Searched refs:fl (Results 1 – 25 of 47) sorted by relevance

12

/fs/
Dlocks.c177 #define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) argument
178 #define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) argument
179 #define IS_LEASE(fl) (fl->fl_flags & (FL_LEASE|FL_DELEG|FL_LAYOUT)) argument
180 #define IS_OFDLCK(fl) (fl->fl_flags & FL_OFDLCK) argument
181 #define IS_REMOTELCK(fl) (fl->fl_pid <= 0) argument
183 static bool lease_breaking(struct file_lock *fl) in lease_breaking() argument
185 return fl->fl_flags & (FL_UNLOCK_PENDING | FL_DOWNGRADE_PENDING); in lease_breaking()
188 static int target_leasetype(struct file_lock *fl) in target_leasetype() argument
190 if (fl->fl_flags & FL_UNLOCK_PENDING) in target_leasetype()
192 if (fl->fl_flags & FL_DOWNGRADE_PENDING) in target_leasetype()
[all …]
Dfcntl.c533 struct compat_flock fl; in get_compat_flock() local
535 if (copy_from_user(&fl, ufl, sizeof(struct compat_flock))) in get_compat_flock()
537 copy_flock_fields(kfl, &fl); in get_compat_flock()
543 struct compat_flock64 fl; in get_compat_flock64() local
545 if (copy_from_user(&fl, ufl, sizeof(struct compat_flock64))) in get_compat_flock64()
547 copy_flock_fields(kfl, &fl); in get_compat_flock64()
553 struct compat_flock fl; in put_compat_flock() local
555 memset(&fl, 0, sizeof(struct compat_flock)); in put_compat_flock()
556 copy_flock_fields(&fl, kfl); in put_compat_flock()
557 if (copy_to_user(ufl, &fl, sizeof(struct compat_flock))) in put_compat_flock()
[all …]
/fs/lockd/
Dclntproc.c31 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host);
126 static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_setlockargs() argument
133 memcpy(&lock->fh, NFS_FH(locks_inode(fl->fl_file)), sizeof(struct nfs_fh)); in nlmclnt_setlockargs()
137 (unsigned int)fl->fl_u.nfs_fl.owner->pid, in nlmclnt_setlockargs()
139 lock->svid = fl->fl_u.nfs_fl.owner->pid; in nlmclnt_setlockargs()
140 lock->fl.fl_start = fl->fl_start; in nlmclnt_setlockargs()
141 lock->fl.fl_end = fl->fl_end; in nlmclnt_setlockargs()
142 lock->fl.fl_type = fl->fl_type; in nlmclnt_setlockargs()
147 WARN_ON_ONCE(req->a_args.lock.fl.fl_ops != NULL); in nlmclnt_release_lockargs()
158 int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl, void *data) in nlmclnt_proc() argument
[all …]
Dsvclock.c148 struct file_lock *fl; in nlmsvc_lookup_block() local
151 file, lock->fl.fl_pid, in nlmsvc_lookup_block()
152 (long long)lock->fl.fl_start, in nlmsvc_lookup_block()
153 (long long)lock->fl.fl_end, lock->fl.fl_type); in nlmsvc_lookup_block()
155 fl = &block->b_call->a_args.lock.fl; in nlmsvc_lookup_block()
157 block->b_file, fl->fl_pid, in nlmsvc_lookup_block()
158 (long long)fl->fl_start, in nlmsvc_lookup_block()
159 (long long)fl->fl_end, fl->fl_type, in nlmsvc_lookup_block()
161 if (block->b_file == file && nlm_compare_locks(fl, &lock->fl)) { in nlmsvc_lookup_block()
239 call->a_args.lock.fl.fl_flags |= FL_SLEEP; in nlmsvc_create_block()
[all …]
Dxdr4.c109 struct file_lock *fl = &lock->fl; in nlm4_decode_lock() local
120 locks_init_lock(fl); in nlm4_decode_lock()
121 fl->fl_flags = FL_POSIX; in nlm4_decode_lock()
122 fl->fl_type = F_RDLCK; /* as good as anything else */ in nlm4_decode_lock()
127 fl->fl_start = s64_to_loff_t(start); in nlm4_decode_lock()
130 fl->fl_end = OFFSET_MAX; in nlm4_decode_lock()
132 fl->fl_end = s64_to_loff_t(end); in nlm4_decode_lock()
150 struct file_lock *fl = &resp->lock.fl; in nlm4_encode_testres() local
152 *p++ = (fl->fl_type == F_RDLCK)? xdr_zero : xdr_one; in nlm4_encode_testres()
159 start = loff_t_to_s64(fl->fl_start); in nlm4_encode_testres()
[all …]
Dxdr.c117 struct file_lock *fl = &lock->fl; in nlm_decode_lock() local
128 locks_init_lock(fl); in nlm_decode_lock()
129 fl->fl_flags = FL_POSIX; in nlm_decode_lock()
130 fl->fl_type = F_RDLCK; /* as good as anything else */ in nlm_decode_lock()
135 fl->fl_start = s32_to_loff_t(start); in nlm_decode_lock()
138 fl->fl_end = OFFSET_MAX; in nlm_decode_lock()
140 fl->fl_end = s32_to_loff_t(end); in nlm_decode_lock()
157 struct file_lock *fl = &resp->lock.fl; in nlm_encode_testres() local
159 *p++ = (fl->fl_type == F_RDLCK)? xdr_zero : xdr_one; in nlm_encode_testres()
166 start = loff_t_to_s32(fl->fl_start); in nlm_encode_testres()
[all …]
Dclntxdr.c64 const struct file_lock *fl = &lock->fl; in nlm_compute_offsets() local
66 *l_offset = loff_t_to_s32(fl->fl_start); in nlm_compute_offsets()
67 if (fl->fl_end == OFFSET_MAX) in nlm_compute_offsets()
70 *l_len = loff_t_to_s32(fl->fl_end - fl->fl_start + 1); in nlm_compute_offsets()
241 encode_bool(xdr, lock->fl.fl_type == F_RDLCK); in encode_nlm_holder()
254 struct file_lock *fl = &lock->fl; in decode_nlm_holder() local
261 locks_init_lock(fl); in decode_nlm_holder()
268 fl->fl_pid = (pid_t)lock->svid; in decode_nlm_holder()
278 fl->fl_flags = FL_POSIX; in decode_nlm_holder()
279 fl->fl_type = exclusive != 0 ? F_WRLCK : F_RDLCK; in decode_nlm_holder()
[all …]
Dclnt4xdr.c68 const struct file_lock *fl = &lock->fl; in nlm4_compute_offsets() local
70 *l_offset = loff_t_to_s64(fl->fl_start); in nlm4_compute_offsets()
71 if (fl->fl_end == OFFSET_MAX) in nlm4_compute_offsets()
74 *l_len = loff_t_to_s64(fl->fl_end - fl->fl_start + 1); in nlm4_compute_offsets()
246 encode_bool(xdr, lock->fl.fl_type == F_RDLCK); in encode_nlm4_holder()
259 struct file_lock *fl = &lock->fl; in decode_nlm4_holder() local
267 locks_init_lock(fl); in decode_nlm4_holder()
274 fl->fl_pid = (pid_t)lock->svid; in decode_nlm4_holder()
284 fl->fl_flags = FL_POSIX; in decode_nlm4_holder()
285 fl->fl_type = exclusive != 0 ? F_WRLCK : F_RDLCK; in decode_nlm4_holder()
[all …]
Dclntlock.c100 struct nlm_wait *nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl) in nlmclnt_prepare_block() argument
107 block->b_lock = fl; in nlmclnt_prepare_block()
166 const struct file_lock *fl = &lock->fl; in nlmclnt_grant() local
179 if (fl_blocked->fl_start != fl->fl_start) in nlmclnt_grant()
181 if (fl_blocked->fl_end != fl->fl_end) in nlmclnt_grant()
234 struct file_lock *fl, *next; in reclaimer() local
260 list_for_each_entry_safe(fl, next, &host->h_reclaim, fl_u.nfs_fl.list) { in reclaimer()
261 list_del_init(&fl->fl_u.nfs_fl.list); in reclaimer()
271 if (nlmclnt_reclaim(host, fl, req) != 0) in reclaimer()
273 list_add_tail(&fl->fl_u.nfs_fl.list, &host->h_granted); in reclaimer()
Dsvcsubs.c167 struct file_lock *fl; in nlm_traverse_locks() local
176 list_for_each_entry(fl, &flctx->flc_posix, fl_list) { in nlm_traverse_locks()
177 if (fl->fl_lmops != &nlmsvc_lock_operations) in nlm_traverse_locks()
183 lockhost = ((struct nlm_lockowner *)fl->fl_owner)->host; in nlm_traverse_locks()
185 struct file_lock lock = *fl; in nlm_traverse_locks()
229 struct file_lock *fl; in nlm_file_inuse() local
237 list_for_each_entry(fl, &flctx->flc_posix, fl_list) { in nlm_file_inuse()
238 if (fl->fl_lmops == &nlmsvc_lock_operations) { in nlm_file_inuse()
/fs/afs/
Dflock.c17 static void afs_fl_copy_lock(struct file_lock *new, struct file_lock *fl);
18 static void afs_fl_release_private(struct file_lock *fl);
463 static int afs_do_setlk(struct file *file, struct file_lock *fl) in afs_do_setlk() argument
478 fl->fl_start, fl->fl_end, fl->fl_type, mode); in afs_do_setlk()
480 fl->fl_ops = &afs_lock_ops; in afs_do_setlk()
481 INIT_LIST_HEAD(&fl->fl_u.afs.link); in afs_do_setlk()
482 fl->fl_u.afs.state = AFS_LOCK_PENDING; in afs_do_setlk()
484 partial = (fl->fl_start != 0 || fl->fl_end != OFFSET_MAX); in afs_do_setlk()
485 type = (fl->fl_type == F_RDLCK) ? AFS_LOCK_READ : AFS_LOCK_WRITE; in afs_do_setlk()
493 trace_afs_flock_op(vnode, fl, afs_flock_op_set_lock); in afs_do_setlk()
[all …]
/fs/dlm/
Dplock.c30 int (*callback)(struct file_lock *fl, int result);
31 void *fl; member
78 struct file *file, struct file_lock *fl) in do_unlock_close() argument
87 op->info.pid = fl->fl_pid; in do_unlock_close()
92 if (fl->fl_lmops && fl->fl_lmops->lm_grant) in do_unlock_close()
93 op->info.owner = (__u64) fl->fl_pid; in do_unlock_close()
95 op->info.owner = (__u64)(long) fl->fl_owner; in do_unlock_close()
102 int cmd, struct file_lock *fl) in dlm_posix_lock() argument
121 op->info.pid = fl->fl_pid; in dlm_posix_lock()
122 op->info.ex = (fl->fl_type == F_WRLCK); in dlm_posix_lock()
[all …]
/fs/ceph/
Dlocks.c41 static void ceph_fl_release_lock(struct file_lock *fl) in ceph_fl_release_lock() argument
43 struct ceph_file_info *fi = fl->fl_file->private_data; in ceph_fl_release_lock()
44 struct inode *inode = file_inode(fl->fl_file); in ceph_fl_release_lock()
64 int cmd, u8 wait, struct file_lock *fl) in ceph_lock_message() argument
79 fl->fl_ops = &ceph_fl_lock_ops; in ceph_lock_message()
80 fl->fl_ops->fl_copy_lock(fl, NULL); in ceph_lock_message()
94 if (LLONG_MAX == fl->fl_end) in ceph_lock_message()
97 length = fl->fl_end - fl->fl_start + 1; in ceph_lock_message()
99 owner = secure_addr(fl->fl_owner); in ceph_lock_message()
103 (int)operation, owner, (u64)fl->fl_pid, fl->fl_start, length, in ceph_lock_message()
[all …]
/fs/9p/
Dvfs_file.c116 static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_lock() argument
121 p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); in v9fs_file_lock()
124 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) in v9fs_file_lock()
127 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) { in v9fs_file_lock()
135 static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_do_lock() argument
147 if ((fl->fl_flags & FL_POSIX) != FL_POSIX) in v9fs_file_do_lock()
150 res = locks_lock_file_wait(filp, fl); in v9fs_file_do_lock()
157 switch (fl->fl_type) { in v9fs_file_do_lock()
168 flock.start = fl->fl_start; in v9fs_file_do_lock()
169 if (fl->fl_end == OFFSET_MAX) in v9fs_file_do_lock()
[all …]
/fs/nfs/filelayout/
Dfilelayout.c538 struct nfs4_filelayout_segment *fl, in filelayout_check_deviceid() argument
546 if (fl->dsaddr != NULL) in filelayout_check_deviceid()
550 d = nfs4_find_get_deviceid(NFS_SERVER(lo->plh_inode), &fl->deviceid, in filelayout_check_deviceid()
560 if (fl->first_stripe_index >= dsaddr->stripe_count) { in filelayout_check_deviceid()
562 __func__, fl->first_stripe_index); in filelayout_check_deviceid()
566 if ((fl->stripe_type == STRIPE_SPARSE && in filelayout_check_deviceid()
567 fl->num_fh > 1 && fl->num_fh != dsaddr->ds_num) || in filelayout_check_deviceid()
568 (fl->stripe_type == STRIPE_DENSE && in filelayout_check_deviceid()
569 fl->num_fh != dsaddr->stripe_count)) { in filelayout_check_deviceid()
571 __func__, fl->num_fh); in filelayout_check_deviceid()
[all …]
/fs/ocfs2/
Dlocks.c25 int cmd, struct file_lock *fl) in ocfs2_do_flock() argument
31 if (fl->fl_type == F_WRLCK) in ocfs2_do_flock()
73 ret = locks_lock_file_wait(file, fl); in ocfs2_do_flock()
83 static int ocfs2_do_funlock(struct file *file, int cmd, struct file_lock *fl) in ocfs2_do_funlock() argument
90 ret = locks_lock_file_wait(file, fl); in ocfs2_do_funlock()
99 int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl) in ocfs2_flock() argument
104 if (!(fl->fl_flags & FL_FLOCK)) in ocfs2_flock()
111 return locks_lock_file_wait(file, fl); in ocfs2_flock()
113 if (fl->fl_type == F_UNLCK) in ocfs2_flock()
114 return ocfs2_do_funlock(file, cmd, fl); in ocfs2_flock()
[all …]
Dlocks.h15 int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl);
16 int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl);
Dalloc.c6537 struct ocfs2_per_slot_free_list *fl; in ocfs2_run_deallocs() local
6543 fl = ctxt->c_first_suballocator; in ocfs2_run_deallocs()
6545 if (fl->f_first) { in ocfs2_run_deallocs()
6546 trace_ocfs2_run_deallocs(fl->f_inode_type, in ocfs2_run_deallocs()
6547 fl->f_slot); in ocfs2_run_deallocs()
6549 fl->f_inode_type, in ocfs2_run_deallocs()
6550 fl->f_slot, in ocfs2_run_deallocs()
6551 fl->f_first); in ocfs2_run_deallocs()
6558 ctxt->c_first_suballocator = fl->f_next_suballocator; in ocfs2_run_deallocs()
6559 kfree(fl); in ocfs2_run_deallocs()
[all …]
/fs/nfsd/
Dflexfilelayout.c30 struct pnfs_ff_layout *fl; in nfsd4_ff_proc_layoutget() local
38 fl = kzalloc(sizeof(*fl), GFP_KERNEL); in nfsd4_ff_proc_layoutget()
39 if (!fl) in nfsd4_ff_proc_layoutget()
41 args->lg_content = fl; in nfsd4_ff_proc_layoutget()
48 fl->flags = FF_FLAGS_NO_LAYOUTCOMMIT | FF_FLAGS_NO_IO_THRU_MDS | in nfsd4_ff_proc_layoutget()
54 fl->uid = make_kuid(&init_user_ns, u); in nfsd4_ff_proc_layoutget()
56 fl->uid = inode->i_uid; in nfsd4_ff_proc_layoutget()
57 fl->gid = inode->i_gid; in nfsd4_ff_proc_layoutget()
59 error = nfsd4_set_deviceid(&fl->deviceid, fhp, device_generation); in nfsd4_ff_proc_layoutget()
63 fl->fh.size = fhp->fh_handle.fh_size; in nfsd4_ff_proc_layoutget()
[all …]
Dflexfilelayoutxdr.c22 struct pnfs_ff_layout *fl = lgp->lg_content; in nfsd4_ff_encode_layoutget() local
33 fh_len = 4 + fl->fh.size; in nfsd4_ff_encode_layoutget()
35 uid.len = sprintf(uid.buf, "%u", from_kuid(&init_user_ns, fl->uid)); in nfsd4_ff_encode_layoutget()
36 gid.len = sprintf(gid.buf, "%u", from_kgid(&init_user_ns, fl->gid)); in nfsd4_ff_encode_layoutget()
57 p = xdr_encode_opaque_fixed(p, &fl->deviceid, in nfsd4_ff_encode_layoutget()
62 *p++ = cpu_to_be32(fl->stateid.si_generation); in nfsd4_ff_encode_layoutget()
63 p = xdr_encode_opaque_fixed(p, &fl->stateid.si_opaque, in nfsd4_ff_encode_layoutget()
67 p = xdr_encode_opaque(p, fl->fh.data, fl->fh.size); in nfsd4_ff_encode_layoutget()
72 *p++ = cpu_to_be32(fl->flags); in nfsd4_ff_encode_layoutget()
Dnfs4layouts.c184 struct file_lock *fl; in nfsd4_layout_setlease() local
190 fl = locks_alloc_lock(); in nfsd4_layout_setlease()
191 if (!fl) in nfsd4_layout_setlease()
193 locks_init_lock(fl); in nfsd4_layout_setlease()
194 fl->fl_lmops = &nfsd4_layouts_lm_ops; in nfsd4_layout_setlease()
195 fl->fl_flags = FL_LAYOUT; in nfsd4_layout_setlease()
196 fl->fl_type = F_RDLCK; in nfsd4_layout_setlease()
197 fl->fl_end = OFFSET_MAX; in nfsd4_layout_setlease()
198 fl->fl_owner = ls; in nfsd4_layout_setlease()
199 fl->fl_pid = current->tgid; in nfsd4_layout_setlease()
[all …]
/fs/nfs/
Dfile.c657 do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) in do_getlk() argument
661 unsigned int saved_type = fl->fl_type; in do_getlk()
664 posix_test_lock(filp, fl); in do_getlk()
665 if (fl->fl_type != F_UNLCK) { in do_getlk()
669 fl->fl_type = saved_type; in do_getlk()
677 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_getlk()
681 fl->fl_type = F_UNLCK; in do_getlk()
686 do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) in do_unlk() argument
706 if (status < 0 && !(fl->fl_flags & FL_CLOSE)) in do_unlk()
715 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_unlk()
[all …]
Dproc.c648 nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl) in nfs_proc_lock() argument
652 return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl, NULL); in nfs_proc_lock()
657 static int nfs_lock_check_bounds(const struct file_lock *fl) in nfs_lock_check_bounds() argument
661 start = (__s32)fl->fl_start; in nfs_lock_check_bounds()
662 if ((loff_t)start != fl->fl_start) in nfs_lock_check_bounds()
665 if (fl->fl_end != OFFSET_MAX) { in nfs_lock_check_bounds()
666 end = (__s32)fl->fl_end; in nfs_lock_check_bounds()
667 if ((loff_t)end != fl->fl_end) in nfs_lock_check_bounds()
/fs/gfs2/
Dfile.c1194 static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) in gfs2_lock() argument
1200 if (!(fl->fl_flags & FL_POSIX)) in gfs2_lock()
1202 if (__mandatory_lock(&ip->i_inode) && fl->fl_type != F_UNLCK) in gfs2_lock()
1208 fl->fl_type = F_UNLCK; in gfs2_lock()
1211 if (fl->fl_type == F_UNLCK) in gfs2_lock()
1212 locks_lock_file_wait(file, fl); in gfs2_lock()
1216 return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl); in gfs2_lock()
1217 else if (fl->fl_type == F_UNLCK) in gfs2_lock()
1218 return dlm_posix_unlock(ls->ls_dlm, ip->i_no_addr, file, fl); in gfs2_lock()
1220 return dlm_posix_lock(ls->ls_dlm, ip->i_no_addr, file, cmd, fl); in gfs2_lock()
[all …]
/fs/fuse/
Dfile.c2308 struct file_lock *fl) in convert_fuse_file_lock() argument
2320 fl->fl_start = ffl->start; in convert_fuse_file_lock()
2321 fl->fl_end = ffl->end; in convert_fuse_file_lock()
2328 fl->fl_pid = pid_nr_ns(find_pid_ns(ffl->pid, fc->pid_ns), &init_pid_ns); in convert_fuse_file_lock()
2335 fl->fl_type = ffl->type; in convert_fuse_file_lock()
2340 const struct file_lock *fl, int opcode, pid_t pid, in fuse_lk_fill() argument
2349 inarg->owner = fuse_lock_owner_id(fc, fl->fl_owner); in fuse_lk_fill()
2350 inarg->lk.start = fl->fl_start; in fuse_lk_fill()
2351 inarg->lk.end = fl->fl_end; in fuse_lk_fill()
2352 inarg->lk.type = fl->fl_type; in fuse_lk_fill()
[all …]

12