Unionfs: fix silly compile-time warnings
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 02:12:01 +0000 (21:12 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 02:12:01 +0000 (21:12 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/copyup.c
fs/unionfs/lookup.c
fs/unionfs/main.c
fs/unionfs/rdstate.c
fs/unionfs/subr.c

index 806d0892cc227dd1850bec7877a57ffeb4ce2de5..2c3e10d77452a9ee47b94a03fa268a79362d0c9c 100644 (file)
@@ -38,7 +38,7 @@ static int copyup_deleted_file(struct file *file, struct dentry *dentry,
 
        lower_dentry = unionfs_lower_dentry_idx(dentry, bstart);
 
-       sprintf(name, ".unionfs%*.*lx",
+       sprintf((char *) name, ".unionfs%*.*lx",
                i_inosize, i_inosize, lower_dentry->d_inode->i_ino);
 
        /*
@@ -53,7 +53,7 @@ static int copyup_deleted_file(struct file *file, struct dentry *dentry,
 retry:
        tmp_dentry = NULL;
        do {
-               char *suffix = name + nlen - countersize;
+               char *suffix = (char *) name + nlen - countersize;
 
                dput(tmp_dentry);
                counter++;
@@ -62,7 +62,7 @@ retry:
                pr_debug("unionfs: trying to rename %s to %s\n",
                         dentry->d_name.name, name);
 
-               tmp_dentry = lookup_one_len(name, lower_dentry->d_parent,
+               tmp_dentry = lookup_one_len((char *) name, lower_dentry->d_parent,
                                            nlen);
                if (IS_ERR(tmp_dentry)) {
                        err = PTR_ERR(tmp_dentry);
index 0c22346589e76664bafa75227ab76997eafefa26..85619c6e0296c05be141d41ea8d87904c0e563a4 100644 (file)
@@ -547,7 +547,7 @@ int copyup_named_file(struct inode *dir, struct file *file,
        struct file *output_file = NULL;
 
        err = copyup_dentry(dir, file->f_dentry, bstart, new_bindex,
-                           name, strlen(name), &output_file, len);
+                           name, strlen((char *) name), &output_file, len);
        if (!err) {
                fbstart(file) = new_bindex;
                unionfs_set_lower_file_idx(file, new_bindex, output_file);
@@ -755,7 +755,7 @@ begin:
 
        if (child_dentry != dentry) {
                /* lookup child in the underlying file system */
-               lower_dentry = lookup_one_len(childname, lower_parent_dentry,
+               lower_dentry = lookup_one_len((char *) childname, lower_parent_dentry,
                                              childnamelen);
                if (IS_ERR(lower_dentry))
                        goto out;
@@ -764,8 +764,8 @@ begin:
                 * Is the name a whiteout of the child name ?  lookup the
                 * whiteout child in the underlying file system
                 */
-               lower_dentry = lookup_one_len(name, lower_parent_dentry,
-                                             strlen(name));
+               lower_dentry = lookup_one_len((char *) name, lower_parent_dentry,
+                                             strlen((char *)name));
                if (IS_ERR(lower_dentry))
                        goto out;
 
index 0a969c8c32de0b0d96162293fcb973ca3fa55ec6..d2642209f6bc30694bfffbad9da702d7c2a43e70 100644 (file)
@@ -149,7 +149,7 @@ struct dentry *unionfs_lookup_backend(struct dentry *dentry,
        namelen = dentry->d_name.len;
 
        /* No dentries should get created for possible whiteout names. */
-       if (!is_validname(name)) {
+       if (!is_validname((char *) name)) {
                err = -EPERM;
                goto out_free;
        }
@@ -234,7 +234,7 @@ struct dentry *unionfs_lookup_backend(struct dentry *dentry,
                        /* FIXME: fix following line for mount point crossing */
                        nd->mnt = unionfs_lower_mnt_idx(parent_dentry, bindex);
                }
-               lower_dentry = lookup_one_len_nd(name, lower_dir_dentry,
+               lower_dentry = lookup_one_len_nd((char *) name, lower_dir_dentry,
                                                 namelen, nd);
                if (IS_ERR(lower_dentry)) {
                        dput(first_lower_dentry);
@@ -333,7 +333,7 @@ out_negative:
                        nd->mnt = unionfs_lower_mnt_idx(parent_dentry, bindex);
                }
                first_lower_dentry =
-                       lookup_one_len_nd(name, lower_dir_dentry,
+                       lookup_one_len_nd((char *) name, lower_dir_dentry,
                                          namelen, nd);
                first_dentry_offset = bindex;
                if (IS_ERR(first_lower_dentry)) {
index ced92927043ba6ee9a306504e5ec32f91b472aae..f40634ac5f223c5ab1b2acade7e1c3427742e7a7 100644 (file)
@@ -567,7 +567,7 @@ static struct dentry *unionfs_d_alloc_root(struct super_block *sb)
 
        if (sb) {
                static const struct qstr name = {
-                       .name = "/",
+                       .name = (unsigned char *) "/",
                        .len = 1
                };
 
index 1ea59e4a36c0632c365d27402cb6b44135113202..9241543f2adf747edfcf35d274169e783ab96a93 100644 (file)
@@ -200,7 +200,7 @@ struct filldir_node *find_filldir_node(struct unionfs_dir_state *rdstate,
 
        BUG_ON(namelen <= 0);
 
-       hash = full_name_hash(name, namelen);
+       hash = full_name_hash((unsigned char *) name, namelen);
        index = hash % rdstate->size;
 
        head = &(rdstate->list[index]);
@@ -247,7 +247,7 @@ int add_filldir_node(struct unionfs_dir_state *rdstate, const char *name,
 
        BUG_ON(namelen <= 0);
 
-       hash = full_name_hash(name, namelen);
+       hash = full_name_hash((unsigned char *) name, namelen);
        index = hash % rdstate->size;
        head = &(rdstate->list[index]);
 
index 062ebee23f3c74f2071f0dfabc63020e3b773bcf..438bce903bb6444bdedc331d7dfeb1d52d4f435d 100644 (file)
@@ -127,7 +127,7 @@ int unionfs_refresh_lower_dentry(struct dentry *dentry, int bindex)
 
        BUG_ON(!S_ISDIR(lower_parent->d_inode->i_mode));
 
-       lower_dentry = lookup_one_len(dentry->d_name.name, lower_parent,
+       lower_dentry = lookup_one_len((char *) dentry->d_name.name, lower_parent,
                                      dentry->d_name.len);
        if (IS_ERR(lower_dentry)) {
                err = PTR_ERR(lower_dentry);
@@ -226,7 +226,7 @@ char *alloc_whname(const unsigned char *name, int len)
                return ERR_PTR(-ENOMEM);
 
        strcpy(buf, UNIONFS_WHPFX);
-       strlcat(buf, name, len + UNIONFS_WHLEN + 1);
+       strlcat(buf, (char *) name, len + UNIONFS_WHLEN + 1);
 
        return buf;
 }