locks: make "added" in __posix_lock_file a bool
authorJeff Layton <jlayton@redhat.com>
Fri, 21 Jun 2013 12:58:13 +0000 (08:58 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 29 Jun 2013 08:57:40 +0000 (12:57 +0400)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/locks.c

index ddeab49fe2be741ea95ae9e53012049a6bb1b51d..1d6cb28816be4f6ec21015d8328d0d55077abf7e 100644 (file)
@@ -791,7 +791,8 @@ static int __posix_lock_file(struct inode *inode, struct file_lock *request, str
        struct file_lock *left = NULL;
        struct file_lock *right = NULL;
        struct file_lock **before;
-       int error, added = 0;
+       int error;
+       bool added = false;
 
        /*
         * We may need two file_lock structures for this operation,
@@ -885,7 +886,7 @@ static int __posix_lock_file(struct inode *inode, struct file_lock *request, str
                                continue;
                        }
                        request = fl;
-                       added = 1;
+                       added = true;
                }
                else {
                        /* Processing for different lock types is a bit
@@ -896,7 +897,7 @@ static int __posix_lock_file(struct inode *inode, struct file_lock *request, str
                        if (fl->fl_start > request->fl_end)
                                break;
                        if (request->fl_type == F_UNLCK)
-                               added = 1;
+                               added = true;
                        if (fl->fl_start < request->fl_start)
                                left = fl;
                        /* If the next lock in the list has a higher end
@@ -926,7 +927,7 @@ static int __posix_lock_file(struct inode *inode, struct file_lock *request, str
                                locks_release_private(fl);
                                locks_copy_private(fl, request);
                                request = fl;
-                               added = 1;
+                               added = true;
                        }
                }
                /* Go on to next lock.