diff options
| -rw-r--r-- | fs/locks.c | 15 | ||||
| -rw-r--r-- | include/linux/fs.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/fs/locks.c b/fs/locks.c index caa9b466cd91..70a3df0d930d 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -391,6 +391,16 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, } #endif +/* default lease lock manager operations */ +static void lease_break_callback(struct file_lock *fl) +{ + kill_fasync(&fl->fl_fasync, SIGIO, POLL_MSG); +} + +struct lock_manager_operations lease_manager_ops = { + .fl_break = lease_break_callback, +}; + /* Allocate a file_lock initialised to this type of lease */ static int lease_alloc(struct file *filp, int type, struct file_lock **flp) { @@ -1127,7 +1137,10 @@ int __break_lease(struct inode *inode, unsigned int mode) if (fl->fl_type != future) { fl->fl_type = future; fl->fl_break_time = break_time; - kill_fasync(&fl->fl_fasync, SIGIO, POLL_MSG); + if (fl->fl_lmops && fl->fl_lmops->fl_break) + fl->fl_lmops->fl_break(fl); + else /* lease must have lmops break callback */ + BUG(); } } diff --git a/include/linux/fs.h b/include/linux/fs.h index 2177ae562927..9e9befdd0289 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -635,6 +635,7 @@ struct lock_manager_operations { void (*fl_notify)(struct file_lock *); /* unblock callback */ void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); + void (*fl_break)(struct file_lock *); }; /* that will die - we need it for nfs_lock_info */ |
