s3: Avoid a lot of calls to serverid_exists()
authorVolker Lendecke <vl@samba.org>
Fri, 1 Jun 2012 13:15:07 +0000 (15:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Jun 2012 16:58:30 +0000 (18:58 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jun  1 18:58:30 CEST 2012 on sn-devel-104

source3/locking/locking.c

index 00a46fa6190e1b1ef8567e1c18c8dc87b2dd6ee6..76c2bc7a483d825ee97450ea67205fe559d9c0a9 100644 (file)
@@ -620,7 +620,7 @@ bool is_valid_share_mode_entry(const struct share_mode_entry *e)
        num_props += (EXCLUSIVE_OPLOCK_TYPE(e->op_type) ? 1 : 0);
        num_props += (LEVEL_II_OPLOCK_TYPE(e->op_type) ? 1 : 0);
 
-       if (serverid_exists(&e->pid) && (num_props > 1)) {
+       if ((num_props > 1) && serverid_exists(&e->pid)) {
                smb_panic("Invalid share mode entry");
        }
        return (num_props != 0);