Lines Matching refs:lease
581 /* default lease lock manager operations */
613 * Initialize a lease, use the default lock manager operations
632 /* Allocate a file_lock initialised to this type of lease */
1508 /* We already had a lease on this file; just change its type */
1557 static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker)
1561 if (lease->fl_lmops->lm_breaker_owns_lease
1562 && lease->fl_lmops->lm_breaker_owns_lease(lease))
1564 if ((breaker->fl_flags & FL_LAYOUT) != (lease->fl_flags & FL_LAYOUT)) {
1568 if ((breaker->fl_flags & FL_DELEG) && (lease->fl_flags & FL_LEASE)) {
1573 rc = locks_conflict(breaker, lease);
1575 trace_leases_conflict(rc, lease, breaker);
1603 * some kind of lock (maybe a lease) on this file. Leases are broken on
1693 * Wait for the next conflicting lease that has not been
1713 * lease_get_mtime - update modified time of an inode with exclusive lease
1719 * exclusive lease, then they could be modifying it.
1743 * fcntl_getlease - Enquire what lease is currently active
1747 * (if no lease break is pending):
1749 * %F_RDLCK to indicate a shared lease is held.
1751 * %F_WRLCK to indicate an exclusive lease is held.
1753 * %F_UNLCK to indicate no lease is held.
1755 * (if a lease break is pending):
1757 * %F_RDLCK to indicate an exclusive lease needs to be
1758 * changed to a shared lease (or removed).
1760 * %F_UNLCK to indicate the lease needs to be removed.
1795 * desired lease.
1797 * @arg: type of lease that we're trying to acquire
1801 * conflict with the lease we're trying to set.
1818 * Make sure that only read/write count is from lease requestor.
1838 struct file_lock *fl, *my_fl = NULL, *lease;
1845 lease = *flp;
1846 trace_generic_add_lease(inode, lease);
1874 error = check_conflicting_open(filp, arg, lease->fl_flags);
1880 * lease on this file, then we hold it on this filp
1882 * And if we are trying to acquire an exclusive lease,
1889 fl->fl_owner == lease->fl_owner) {
1895 * No exclusive leases if someone else has a lease on
1901 * Modifying our existing lease is OK, but no getting a
1902 * new lease if someone else is opening for write:
1909 lease = my_fl;
1910 error = lease->fl_lmops->lm_change(lease, arg, &dispose);
1920 locks_insert_lock_ctx(lease, &ctx->flc_lease);
1924 * open but before the lease was inserted. Check again for a
1925 * conflicting open and cancel the lease if there is one.
1931 error = check_conflicting_open(filp, arg, lease->fl_flags);
1933 locks_unlink_lock_ctx(lease);
1938 if (lease->fl_lmops->lm_setup)
1939 lease->fl_lmops->lm_setup(lease, priv);
1984 * generic_setlease - sets a lease on an open file
1986 * @arg: type of lease to obtain
2028 * a new lease with the lease_notifier_chain. This is used by (e.g.) nfsd
2030 * conflicting lease.
2041 setlease_notifier(long arg, struct file_lock *lease)
2044 srcu_notifier_call_chain(&lease_notifier_chain, arg, lease);
2066 setlease_notifier(long arg, struct file_lock *lease)
2084 * vfs_setlease - sets a lease on an open file
2086 * @arg: type of lease to obtain
2087 * @lease: file_lock to use when adding a lease
2088 * @priv: private info for lm_setup when adding a lease (may be
2091 * Call this to establish a lease on the file. The "lease" argument is not
2093 * an existing lease, the ``(*lease)->fl_lmops->lm_break`` operation must be
2101 vfs_setlease(struct file *filp, long arg, struct file_lock **lease, void **priv)
2103 if (lease)
2104 setlease_notifier(arg, *lease);
2106 return filp->f_op->setlease(filp, arg, lease, priv);
2108 return generic_setlease(filp, arg, lease, priv);
2138 * fcntl_setlease - sets a lease on an open file
2141 * @arg: type of lease to obtain
2143 * Call this fcntl to establish a lease on the file.
2145 * receive a signal when the lease is broken.