Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26541
b: refs/heads/master
c: 75dff55
h: refs/heads/master
i:
  26539: acc9b6c
v: v3
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed May 8, 2006
1 parent 341b662 commit b163399
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d21f09ca03d1142f1988001f228d02581d8986c
refs/heads/master: 75dff55af9a989293e9f9bacf049858f4262bc08
21 changes: 12 additions & 9 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,15 +446,14 @@ static struct lock_manager_operations lease_manager_ops = {
*/
static int lease_init(struct file *filp, int type, struct file_lock *fl)
{
if (assign_type(fl, type) != 0)
return -EINVAL;

fl->fl_owner = current->files;
fl->fl_pid = current->tgid;

fl->fl_file = filp;
fl->fl_flags = FL_LEASE;
if (assign_type(fl, type) != 0) {
locks_free_lock(fl);
return -EINVAL;
}
fl->fl_start = 0;
fl->fl_end = OFFSET_MAX;
fl->fl_ops = NULL;
Expand All @@ -466,16 +465,19 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl)
static int lease_alloc(struct file *filp, int type, struct file_lock **flp)
{
struct file_lock *fl = locks_alloc_lock();
int error;
int error = -ENOMEM;

if (fl == NULL)
return -ENOMEM;
goto out;

error = lease_init(filp, type, fl);
if (error)
return error;
if (error) {
locks_free_lock(fl);
fl = NULL;
}
out:
*flp = fl;
return 0;
return error;
}

/* Check if two locks overlap each other.
Expand Down Expand Up @@ -1372,6 +1374,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
goto out;

if (my_before != NULL) {
*flp = *my_before;
error = lease->fl_lmops->fl_change(my_before, arg);
goto out;
}
Expand Down

0 comments on commit b163399

Please sign in to comment.