X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Flocks.c;h=7189834098a1b4ef1c1886de4d050e1f05ab7eef;hb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;hp=1aead65f29ab5b5abcdbf2ccb076b45509e0afc5;hpb=43bc926fffd92024b46cafaf7350d669ba9ca884;p=linux-2.6.git diff --git a/fs/locks.c b/fs/locks.c index 1aead65f2..718983409 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -293,8 +293,6 @@ static int flock_make_lock(struct file *filp, struct file_lock **lock, fl->fl_type = type; fl->fl_end = OFFSET_MAX; - vxd_assert(filp->f_xid == vx_current_xid(), - "f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid()); fl->fl_xid = filp->f_xid; vx_locks_inc(fl); @@ -483,9 +481,6 @@ static int lease_alloc(struct file *filp, int type, struct file_lock **flp) goto out; fl->fl_xid = vx_current_xid(); - if (filp) - vxd_assert(filp->f_xid == fl->fl_xid, - "f_xid(%d) == fl_xid(%d)", filp->f_xid, fl->fl_xid); vx_locks_inc(fl); error = lease_init(filp, type, fl); if (error) { @@ -819,8 +814,6 @@ static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request struct file_lock **before; int error, added = 0; - vxd_assert(xid == vx_current_xid(), - "xid(%d) == current(%d)", xid, vx_current_xid()); /* * We may need two file_lock structures for this operation, * so we get them in advance to avoid races. @@ -1416,8 +1409,9 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) if (!leases_enable) goto out; - error = lease_alloc(filp, arg, &fl); - if (error) + error = -ENOMEM; + fl = locks_alloc_lock(); + if (fl == NULL) goto out; locks_copy_lock(fl, lease); @@ -1425,6 +1419,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) locks_insert_lock(before, fl); *flp = fl; + error = 0; out: return error; } @@ -1678,8 +1673,6 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, if (file_lock == NULL) return -ENOLCK; - vxd_assert(filp->f_xid == vx_current_xid(), - "f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid()); file_lock->fl_xid = filp->f_xid; vx_locks_inc(file_lock); @@ -1826,8 +1819,6 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, if (file_lock == NULL) return -ENOLCK; - vxd_assert(filp->f_xid == vx_current_xid(), - "f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid()); file_lock->fl_xid = filp->f_xid; vx_locks_inc(file_lock);