git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eCryptfs: Revert to a writethrough cache model
[pandora-kernel.git]
/
fs
/
locks.c
diff --git
a/fs/locks.c
b/fs/locks.c
index
3b0d05d
..
fcc50ab
100644
(file)
--- a/
fs/locks.c
+++ b/
fs/locks.c
@@
-308,7
+308,7
@@
static int flock_make_lock(struct file *filp, struct file_lock **lock,
return 0;
}
return 0;
}
-static int assign_type(struct file_lock *fl,
int
type)
+static int assign_type(struct file_lock *fl,
long
type)
{
switch (type) {
case F_RDLCK:
{
switch (type) {
case F_RDLCK:
@@
-445,7
+445,7
@@
static const struct lock_manager_operations lease_manager_ops = {
/*
* Initialize a lease, use the default lock manager operations
*/
/*
* Initialize a lease, use the default lock manager operations
*/
-static int lease_init(struct file *filp,
int
type, struct file_lock *fl)
+static int lease_init(struct file *filp,
long
type, struct file_lock *fl)
{
if (assign_type(fl, type) != 0)
return -EINVAL;
{
if (assign_type(fl, type) != 0)
return -EINVAL;
@@
-463,7
+463,7
@@
static int lease_init(struct file *filp, int type, struct file_lock *fl)
}
/* Allocate a file_lock initialised to this type of lease */
}
/* Allocate a file_lock initialised to this type of lease */
-static struct file_lock *lease_alloc(struct file *filp,
int
type)
+static struct file_lock *lease_alloc(struct file *filp,
long
type)
{
struct file_lock *fl = locks_alloc_lock();
int error = -ENOMEM;
{
struct file_lock *fl = locks_alloc_lock();
int error = -ENOMEM;
@@
-510,12
+510,13
@@
static void __locks_delete_block(struct file_lock *waiter)
/*
*/
/*
*/
-
static
void locks_delete_block(struct file_lock *waiter)
+void locks_delete_block(struct file_lock *waiter)
{
lock_flocks();
__locks_delete_block(waiter);
unlock_flocks();
}
{
lock_flocks();
__locks_delete_block(waiter);
unlock_flocks();
}
+EXPORT_SYMBOL(locks_delete_block);
/* Insert waiter into blocker's block list.
* We use a circular list so that processes can be easily woken up in
/* Insert waiter into blocker's block list.
* We use a circular list so that processes can be easily woken up in
@@
-1205,6
+1206,8
@@
int __break_lease(struct inode *inode, unsigned int mode)
int want_write = (mode & O_ACCMODE) != O_RDONLY;
new_fl = lease_alloc(NULL, want_write ? F_WRLCK : F_RDLCK);
int want_write = (mode & O_ACCMODE) != O_RDONLY;
new_fl = lease_alloc(NULL, want_write ? F_WRLCK : F_RDLCK);
+ if (IS_ERR(new_fl))
+ return PTR_ERR(new_fl);
lock_flocks();
lock_flocks();
@@
-1221,12
+1224,6
@@
int __break_lease(struct inode *inode, unsigned int mode)
if (fl->fl_owner == current->files)
i_have_this_lease = 1;
if (fl->fl_owner == current->files)
i_have_this_lease = 1;
- if (IS_ERR(new_fl) && !i_have_this_lease
- && ((mode & O_NONBLOCK) == 0)) {
- error = PTR_ERR(new_fl);
- goto out;
- }
-
break_time = 0;
if (lease_break_time > 0) {
break_time = jiffies + lease_break_time * HZ;
break_time = 0;
if (lease_break_time > 0) {
break_time = jiffies + lease_break_time * HZ;
@@
-1284,8
+1281,7
@@
restart:
out:
unlock_flocks();
out:
unlock_flocks();
- if (!IS_ERR(new_fl))
- locks_free_lock(new_fl);
+ locks_free_lock(new_fl);
return error;
}
return error;
}
@@
-1469,7
+1465,7
@@
int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
case F_WRLCK:
return generic_add_lease(filp, arg, flp);
default:
case F_WRLCK:
return generic_add_lease(filp, arg, flp);
default:
-
BUG()
;
+
return -EINVAL
;
}
}
EXPORT_SYMBOL(generic_setlease);
}
}
EXPORT_SYMBOL(generic_setlease);