locks.c (a5a64498c194c82ecad3a2d67cff6231cda8d3dd) locks.c (da9592edebceeba1b9301beafe80ec8b9c2db0ce)
1/*
2 * linux/fs/locks.c
3 *
4 * Provide support for fcntl()'s F_GETLK, F_SETLK, and F_SETLKW calls.
5 * Doug Evans (dje@spiff.uucp), August 07, 1992
6 *
7 * Deadlock detection added.
8 * FIXME: one thing isn't handled yet:

--- 1335 unchanged lines hidden (view full) ---

1344int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
1345{
1346 struct file_lock *fl, **before, **my_before = NULL, *lease;
1347 struct file_lock *new_fl = NULL;
1348 struct dentry *dentry = filp->f_path.dentry;
1349 struct inode *inode = dentry->d_inode;
1350 int error, rdlease_count = 0, wrlease_count = 0;
1351
1/*
2 * linux/fs/locks.c
3 *
4 * Provide support for fcntl()'s F_GETLK, F_SETLK, and F_SETLKW calls.
5 * Doug Evans (dje@spiff.uucp), August 07, 1992
6 *
7 * Deadlock detection added.
8 * FIXME: one thing isn't handled yet:

--- 1335 unchanged lines hidden (view full) ---

1344int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
1345{
1346 struct file_lock *fl, **before, **my_before = NULL, *lease;
1347 struct file_lock *new_fl = NULL;
1348 struct dentry *dentry = filp->f_path.dentry;
1349 struct inode *inode = dentry->d_inode;
1350 int error, rdlease_count = 0, wrlease_count = 0;
1351
1352 if ((current->fsuid != inode->i_uid) && !capable(CAP_LEASE))
1352 if ((current_fsuid() != inode->i_uid) && !capable(CAP_LEASE))
1353 return -EACCES;
1354 if (!S_ISREG(inode->i_mode))
1355 return -EINVAL;
1356 error = security_file_lock(filp, arg);
1357 if (error)
1358 return error;
1359
1360 time_out_leases(inode);

--- 941 unchanged lines hidden ---
1353 return -EACCES;
1354 if (!S_ISREG(inode->i_mode))
1355 return -EINVAL;
1356 error = security_file_lock(filp, arg);
1357 if (error)
1358 return error;
1359
1360 time_out_leases(inode);

--- 941 unchanged lines hidden ---