vfs_setlease - sets a lease on an open file
2. SYNOPSIS ▲
int vfs_setlease(struct file * filp , long arg , struct file_lock ** lease );
3. ARGUMENTS ▲
type of lease to obtain
file_lock to use
4. DESCRIPTION ▲
Call this to establish a lease on the file. The (*lease)->fl_lmops->lm_break operation must be set; if not, break_lease will oops!
This will call the filesystemAqs setlease file method, if defined. Note that there is no getlease method; instead, the filesystem setlease method should call back to setlease to add a lease to the inodeAqs lease list, where fcntl_getlease can find it. Since fcntl_getlease only reports whether the current task holds a lease, a cluster filesystem need only do this for leases held by processes on this node.
There is also no break_lease method; filesystems that handle their own leases should break leases themselves from the filesystemAqs open, create, and (on truncate) setattr methods.
5. WARNING ▲
the only current setlease methods exist only to disable leases in certain cases. More vfs changes may be required to allow a full filesystem lease implementation.
6. COPYRIGHT ▲