Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61450
b: refs/heads/master
c: 6044606
h: refs/heads/master
v: v3
  • Loading branch information
Marc Eshel authored and J. Bruce Fields committed Jul 18, 2007
1 parent d9e9e9b commit b6a91d6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4698afe8e3a725576366f86560a8a8242b21b9f7
refs/heads/master: 60446067ba7a8e890a91db3b4a7436fe0ebd2dee
24 changes: 24 additions & 0 deletions trunk/fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,29 @@ static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync)
return ret;
}

/**
* gfs2_setlease - acquire/release a file lease
* @file: the file pointer
* @arg: lease type
* @fl: file lock
*
* Returns: errno
*/

static int gfs2_setlease(struct file *file, long arg, struct file_lock **fl)
{
struct gfs2_sbd *sdp = GFS2_SB(file->f_mapping->host);

/*
* We don't currently have a way to enforce a lease across the whole
* cluster; until we do, disable leases (by just returning -EINVAL),
* unless the administrator has requested purely local locking.
*/
if (!sdp->sd_args.ar_localflocks)
return -EINVAL;
return setlease(file, arg, fl);
}

/**
* gfs2_lock - acquire/release a posix lock on a file
* @file: the file pointer
Expand Down Expand Up @@ -638,6 +661,7 @@ const struct file_operations gfs2_file_fops = {
.flock = gfs2_flock,
.splice_read = generic_file_splice_read,
.splice_write = generic_file_splice_write,
.setlease = gfs2_setlease,
};

const struct file_operations gfs2_dir_fops = {
Expand Down

0 comments on commit b6a91d6

Please sign in to comment.