--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -191,6 +196,7 @@ void locks_init_lock(struct file_lock *f
 	fl->fl_start = fl->fl_end = 0;
 	fl->fl_ops = NULL;
 	fl->fl_lmops = NULL;
+	fl->fl_xid = -1;
 }
 
 EXPORT_SYMBOL(locks_init_lock);
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -248,6 +254,7 @@ void locks_copy_lock(struct file_lock *n
 	new->fl_file = fl->fl_file;
 	new->fl_ops = fl->fl_ops;
 	new->fl_lmops = fl->fl_lmops;
+	new->fl_xid = fl->fl_xid;
 
 	locks_copy_private(new, fl);
 }
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -451,6 +463,7 @@ static int lease_init(struct file *filp,
 
 	fl->fl_owner = current->files;
 	fl->fl_pid = current->tgid;
+	fl->fl_xid = vx_current_xid();
 
 	fl->fl_file = filp;
 	fl->fl_flags = FL_LEASE;
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -773,6 +791,7 @@ static int flock_lock_file(struct file *
 	if (found)
 		cond_resched();
 
+	new_fl->fl_xid = -1;
 find_conflict:
 	for_each_lock(inode, before) {
 		struct file_lock *fl = *before;
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -2123,6 +2162,10 @@ int get_locks_status(char *buffer, char 
 	list_for_each(tmp, &file_lock_list) {
 		struct list_head *btmp;
 		struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
+
+		if (!vx_check(fl->fl_xid, VS_WATCH_P|VS_IDENT))
+			continue;
+
 		lock_get_status(q, fl, ++i, "");
 		move_lock_status(&q, &pos, offset);
 
--- olpc-2.6-master.00/include/linux/fs.h	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/include/linux/fs.h	2007-03-01 17:09:59.000000000 -0500
@@ -807,6 +831,7 @@ struct file_lock {
 	unsigned char fl_type;
 	loff_t fl_start;
 	loff_t fl_end;
+	xid_t fl_xid;
 
 	struct fasync_struct *	fl_fasync; /* for lease break notifications */
 	unsigned long fl_break_time;	/* for nonblocking lease breaks */
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -801,7 +821,8 @@ out:
 	return error;
 }
 
-static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request, struct file_lock *conflock)
+static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request,
+	struct file_lock *conflock, xid_t xid)
 {
 	struct file_lock *fl;
 	struct file_lock *new_fl = NULL;
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -821,7 +844,11 @@ static int __posix_lock_file_conf(struct
 	    (request->fl_type != F_UNLCK ||
 	     request->fl_start != 0 || request->fl_end != OFFSET_MAX)) {
 		new_fl = locks_alloc_lock();
+		new_fl->fl_xid = xid;
+		vx_locks_inc(new_fl);
 		new_fl2 = locks_alloc_lock();
+		new_fl2->fl_xid = xid;
+		vx_locks_inc(new_fl2);
 	}
 
 	lock_kernel();
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -1018,7 +1045,8 @@ static int __posix_lock_file_conf(struct
  */
 int posix_lock_file(struct file *filp, struct file_lock *fl)
 {
-	return __posix_lock_file_conf(filp->f_path.dentry->d_inode, fl, NULL);
+	return __posix_lock_file_conf(filp->f_path.dentry->d_inode,
+		fl, NULL, filp->f_xid);
 }
 EXPORT_SYMBOL(posix_lock_file);
 
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -1033,7 +1061,8 @@ EXPORT_SYMBOL(posix_lock_file);
 int posix_lock_file_conf(struct file *filp, struct file_lock *fl,
 			struct file_lock *conflock)
 {
-	return __posix_lock_file_conf(filp->f_path.dentry->d_inode, fl, conflock);
+	return __posix_lock_file_conf(filp->f_path.dentry->d_inode,
+		fl, conflock, filp->f_xid);
 }
 EXPORT_SYMBOL(posix_lock_file_conf);
 
--- olpc-2.6-master.00/fs/locks.c	2007-02-28 20:05:28.000000000 -0500
+++ olpc-2.6-master-vs22x.02/fs/locks.c	2007-03-01 12:01:25.000000000 -0500
@@ -1123,7 +1152,7 @@ int locks_mandatory_area(int read_write,
 	fl.fl_end = offset + count - 1;
 
 	for (;;) {
-		error = __posix_lock_file_conf(inode, &fl, NULL);
+		error = __posix_lock_file_conf(inode, &fl, NULL, filp->f_xid);
 		if (error != -EAGAIN)
 			break;
 		if (!(fl.fl_flags & FL_SLEEP))
