]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ecryptfs/messaging.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6-omap-h63xx.git] / fs / ecryptfs / messaging.c
index 3baf253be95ad5f6e641cedbeb0f9c6a679c04eb..a96d341d154d0d0082047ca291632bd4002a7ac9 100644 (file)
@@ -19,7 +19,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-
+#include <linux/sched.h>
 #include "ecryptfs_kernel.h"
 
 static LIST_HEAD(ecryptfs_msg_ctx_free_list);
@@ -419,8 +419,9 @@ int ecryptfs_init_messaging(unsigned int transport)
        }
        mutex_init(&ecryptfs_daemon_id_hash_mux);
        mutex_lock(&ecryptfs_daemon_id_hash_mux);
-       ecryptfs_hash_buckets = 0;
-       while (ecryptfs_number_of_users >> ++ecryptfs_hash_buckets);
+       ecryptfs_hash_buckets = 1;
+       while (ecryptfs_number_of_users >> ecryptfs_hash_buckets)
+               ecryptfs_hash_buckets++;
        ecryptfs_daemon_id_hash = kmalloc(sizeof(struct hlist_head)
                                          * ecryptfs_hash_buckets, GFP_KERNEL);
        if (!ecryptfs_daemon_id_hash) {