]> 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 47d7e7b611f7d5ed6a143b748f9fdd889101a4c3..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);
@@ -169,7 +169,8 @@ int ecryptfs_process_helo(unsigned int transport, uid_t uid, pid_t pid)
        if (!new_id) {
                rc = -ENOMEM;
                ecryptfs_printk(KERN_ERR, "Failed to allocate memory; unable "
-                               "to register daemon [%d] for user\n", pid, uid);
+                               "to register daemon [%d] for user [%d]\n",
+                               pid, uid);
                goto unlock;
        }
        if (!ecryptfs_find_daemon_id(uid, &old_id)) {
@@ -418,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) {