]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Eliminate unused parameter warnings from Android build
authorTheodore Ts'o <tytso@mit.edu>
Mon, 13 Jul 2015 12:31:51 +0000 (08:31 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 13 Jul 2015 13:12:23 +0000 (09:12 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
28 files changed:
debugfs/debugfs.c
debugfs/debugfs.h
debugfs/do_journal.c
debugfs/quota.c
debugfs/set_fields.c
debugfs/util.c
e2fsck/pass1.c
e2fsck/pass2.c
lib/blkid/probe.c
lib/ext2fs/blkmap64_ba.c
lib/ext2fs/jfs_compat.h
lib/ext2fs/mmp.c
lib/ext2fs/punch.c
lib/ext2fs/unix_io.c
lib/ss/get_readline.c
lib/support/mkquota.c
lib/support/plausible.c
lib/support/quotaio.c
lib/support/quotaio.h
lib/support/quotaio_v2.c
lib/uuid/gen_uuid.c
misc/create_inode.c
misc/create_inode.h
misc/e4crypt.c
misc/tune2fs.c
misc/util.c
resize/resize2fs.c
util/android_config.h

index 749796b2f2b0ddc4cc77fe3adf866d14e62c65cb..e5134bf87501b93c04657c90a790758a57f7970e 100644 (file)
@@ -1734,7 +1734,7 @@ void do_mkdir(int argc, char *argv[])
                                "<filename>", CHECK_FS_RW))
                return;
 
-       retval = do_mkdir_internal(current_fs, cwd, argv[1], NULL, root);
+       retval = do_mkdir_internal(current_fs, cwd, argv[1], root);
        if (retval)
                com_err(argv[0], retval, 0);
 
@@ -2247,9 +2247,9 @@ void do_symlink(int argc, char *argv[])
 
 }
 
+#if CONFIG_MMP
 void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[])
 {
-#if CONFIG_MMP
        struct mmp_struct *mmp_s;
        time_t t;
        errcode_t retval = 0;
@@ -2286,11 +2286,17 @@ void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[])
        fprintf(stdout, "device_name: %s\n", mmp_s->mmp_bdevname);
        fprintf(stdout, "magic: 0x%x\n", mmp_s->mmp_magic);
        fprintf(stdout, "checksum: 0x%08x\n", mmp_s->mmp_checksum);
+       fprintf(stdout, "MMP is unsupported, please recompile with "
+                       "--enable-mmp\n");
+}
 #else
+void do_dump_mmp(int argc EXT2FS_ATTR((unused)),
+                char *argv[] EXT2FS_ATTR((unused)))
+{
        fprintf(stdout, "MMP is unsupported, please recompile with "
                        "--enable-mmp\n");
-#endif
 }
+#endif
 
 static int source_file(const char *cmd_file, int ss_idx)
 {
index c9a444c2e1ba90307eadb5f51bdb67180153e4bb..6972d50240889ae32a663fe69bf9cd1f424fb1f0 100644 (file)
@@ -181,7 +181,7 @@ extern void do_get_quota(int argc, char *argv[]);
 
 /* util.c */
 extern time_t string_to_time(const char *arg);
-errcode_t read_list(const char *str, blk64_t **list, size_t *len);
+errcode_t read_list(char *str, blk64_t **list, size_t *len);
 
 /* xattrs.c */
 void dump_inode_attributes(FILE *out, ext2_ino_t ino);
index 22322e5bcca9045e9e83a6e0872ebea696baa27b..ef0db2e94327766bc3c04d4f31efb9b32cf3cbbe 100644 (file)
@@ -66,7 +66,8 @@ typedef struct journal_transaction_s journal_transaction_t;
 
 static journal_t *current_journal = NULL;
 
-static void journal_dump_trans(journal_transaction_t *trans, const char *tag)
+static void journal_dump_trans(journal_transaction_t *trans EXT2FS_ATTR((unused)),
+                              const char *tag EXT2FS_ATTR((unused)))
 {
        dbg_printf("TRANS %p(%s): tid=%d start=%llu block=%llu end=%llu "
                   "flags=0x%x\n", trans, tag, trans->tid, trans->start,
@@ -957,7 +958,8 @@ void do_journal_open(int argc, char *argv[])
                com_err(argv[0], err, "while examining journal");
 }
 
-void do_journal_close(int argc, char *argv[])
+void do_journal_close(int argc EXT2FS_ATTR((unused)),
+                     char *argv[] EXT2FS_ATTR((unused)))
 {
        if (current_journal == NULL) {
                printf("Journal not open.\n");
@@ -967,7 +969,7 @@ void do_journal_close(int argc, char *argv[])
        ext2fs_close_journal(current_fs, &current_journal);
 }
 
-void do_journal_run(int argc, char *argv[])
+void do_journal_run(int argc EXT2FS_ATTR((unused)), char *argv[])
 {
        errcode_t err;
 
index 9612f6420cb4c86371d158043fff48060e1da3b3..7aa0f3b20c29e50e25d7ac83b50b48faf80cb535 100644 (file)
@@ -90,7 +90,8 @@ static int parse_quota_type(const char *cmdname, const char *str)
 }
 
 
-static int list_quota_callback(struct dquot *dq, void *cb_data)
+static int list_quota_callback(struct dquot *dq,
+                              void *cb_data EXT2FS_ATTR((unused)))
 {
        printf("%8u   %8lld %8lld %8lld    %8lld %8lld %8lld\n",
               dq->dq_id, (long long)dq->dq_dqb.dqb_curspace,
index 45fc75069934955814d55ec9b1e4401fc007123f..b14fec991392a7281f4c2ded8bf3e03afdbaf9a0 100644 (file)
@@ -849,9 +849,9 @@ static errcode_t parse_mmp_clear(struct field_set_info *info,
        return 1; /* we don't need the MMP block written again */
 }
 
+#ifdef CONFIG_MMP
 void do_set_mmp_value(int argc, char *argv[])
 {
-#ifdef CONFIG_MMP
        const char *usage = "<field> <value>\n"
                "\t\"set_mmp_value -l\" will list the names of "
                "MMP fields\n\twhich can be set.";
@@ -906,9 +906,13 @@ void do_set_mmp_value(int argc, char *argv[])
                                 &set_mmp);
                *mmp_s = set_mmp;
        }
+}
 #else
+void do_set_mmp_value(int argc EXT2FS_ATTR((unused)),
+                     char *argv[] EXT2FS_ATTR((unused)))
+{
        fprintf(stdout, "MMP is unsupported, please recompile with "
                        "--enable-mmp\n");
-#endif
 }
+#endif
 
index 4fef89ae466e3a6e8dc163ba270427b1d89fd270..56ea695c32c166d9060ebe099479ce46ff960ece 100644 (file)
@@ -498,11 +498,11 @@ int ext2_file_type(unsigned int mode)
        return 0;
 }
 
-errcode_t read_list(const char *str, blk64_t **list, size_t *len)
+errcode_t read_list(char *str, blk64_t **list, size_t *len)
 {
        blk64_t *lst = *list;
        size_t ln = *len;
-       char *tok, *p = optarg;
+       char *tok, *p = str;
        errcode_t retval;
 
        while ((tok = strtok(p, ","))) {
index c894e7afcf9b119ebc87802284037fcc6407a0b8..23d2e99f7dd74dc92ed59a7eaa8885255decfcfa 100644 (file)
@@ -856,8 +856,8 @@ static int fix_inline_data_extents_file(e2fsck_t ctx,
        }
 
        /* If it looks short enough to be inline data, try to clear extents */
-       if (EXT2_INODE_SIZE(fs->super) > EXT2_GOOD_OLD_INODE_SIZE)
-               max_inline_ea_size = EXT2_INODE_SIZE(fs->super) -
+       if (inode_size > EXT2_GOOD_OLD_INODE_SIZE)
+               max_inline_ea_size = inode_size -
                                     (EXT2_GOOD_OLD_INODE_SIZE +
                                      ((struct ext2_inode_large *)inode)->i_extra_isize);
        else
@@ -975,7 +975,7 @@ void e2fsck_pass1(e2fsck_t ctx)
        unsigned int    save_type;
        int             imagic_fs, extent_fs, inlinedata_fs;
        int             low_dtime_check = 1;
-       int             inode_size;
+       int             inode_size = EXT2_INODE_SIZE(fs->super);
        int             failed_csum = 0;
        ext2_ino_t      ino_threshold = 0;
        dgrp_t          ra_group = 0;
@@ -1083,7 +1083,6 @@ void e2fsck_pass1(e2fsck_t ctx)
                ctx->flags |= E2F_FLAG_ABORT;
                return;
        }
-       inode_size = EXT2_INODE_SIZE(fs->super);
        inode = (struct ext2_inode *)
                e2fsck_allocate_memory(ctx, inode_size, "scratch inode");
 
index d0bb755b8630b780028c8231e81f2b7e982829ea..f4913f6ade212ed6bf9b2a9ace00f839f022a58c 100644 (file)
@@ -475,7 +475,6 @@ static int check_dotdot(e2fsck_t ctx,
  */
 static int check_name(e2fsck_t ctx,
                      struct ext2_dir_entry *dirent,
-                     ext2_ino_t dir_ino,
                      struct problem_context *pctx)
 {
        int     i;
@@ -1381,7 +1380,7 @@ skip_checksum:
                        }
                }
 
-               if (!encrypted && check_name(ctx, dirent, ino, &cd->pctx))
+               if (!encrypted && check_name(ctx, dirent, &cd->pctx))
                        dir_modified++;
 
                if (check_filetype(ctx, dirent, ino, &cd->pctx))
index 4b797ab1edd6b87a7e06094d4d590808616e12ed..b260862e86cc7e39fd41b263c2edc79e9314ea5f 100644 (file)
@@ -874,8 +874,9 @@ static int probe_jfs(struct blkid_probe *probe,
        return 0;
 }
 
-static int probe_zfs(struct blkid_probe *probe, struct blkid_magic *id,
-                    unsigned char *buf)
+static int probe_zfs(struct blkid_probe *probe __BLKID_ATTR((unused)),
+                    struct blkid_magic *id __BLKID_ATTR((unused)),
+                    unsigned char *buf __BLKID_ATTR((unused)))
 {
 #if 0
        char *vdev_label;
@@ -1376,7 +1377,7 @@ static int probe_lvm2(struct blkid_probe *probe,
 }
 
 static int probe_btrfs(struct blkid_probe *probe,
-                       struct blkid_magic *id,
+                       struct blkid_magic *id __BLKID_ATTR((unused)),
                        unsigned char *buf)
 {
        struct btrfs_super_block *bs;
index 87946c7a6b145aad72b1a5925e7559374a16a5fa..4671c50d00a8fa8bfaf5818c585b1d2793d5011c 100644 (file)
@@ -318,7 +318,9 @@ static void ba_print_stats(ext2fs_generic_bitmap bitmap)
                sizeof(struct ext2fs_ba_private_struct));
 }
 #else
-static void ba_print_stats(ext2fs_generic_bitmap bitmap) {}
+static void ba_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused)))
+{
+}
 #endif
 
 /* Find the first zero bit between start and end, inclusive. */
index a3261ad083c36e28d597fa376431691dc30b0c1d..75a0596687d958e5f6aca0457e92f1b3aa0d4e72 100644 (file)
@@ -37,8 +37,9 @@ typedef __u64 u64;
 #define put_bh(x)      brelse(x)
 #define be64_to_cpu(x) ext2fs_be64_to_cpu(x)
 
-static inline __u32 jbd2_chksum(journal_t *j, __u32 crc, const void *address,
-                       unsigned int length)
+static inline __u32 jbd2_chksum(journal_t *j EXT2FS_ATTR((unused)),
+                               __u32 crc, const void *address,
+                               unsigned int length)
 {
        return ext2fs_crc32c_le(crc, address, length);
 }
index 8d927d92db765f4cf33fe402171700c410f33e9f..ac27837098d614beafb16471c3032ea115b338de 100644 (file)
 #define O_DIRECT 0
 #endif
 
+#pragma GCC diagnostic push
+#ifndef CONFIG_MMP
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
 errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf)
 {
 #ifdef CONFIG_MMP
@@ -453,3 +458,4 @@ mmp_error:
        return EXT2_ET_OP_NOT_SUPPORTED;
 #endif
 }
+#pragma GCC diagnostic pop
index 3cce1f87dd069e8941cfd96ea537fd3dcdc0760f..db4aa19153e0b77f2b6256ed709b0b2a5a63586d 100644 (file)
@@ -436,7 +436,8 @@ errout:
        
 static errcode_t ext2fs_punch_inline_data(ext2_filsys fs, ext2_ino_t ino,
                                          struct ext2_inode *inode,
-                                         blk64_t start, blk64_t end)
+                                         blk64_t start,
+                                         blk64_t end EXT2FS_ATTR((unused)))
 {
        errcode_t retval;
 
index e6407ce2e0fde49d336ea67d8bd2ddd4edf8ec33..dd842711ae203cf40acef122671012222dfd2263 100644 (file)
@@ -991,6 +991,9 @@ unimplemented:
        return EXT2_ET_UNIMPLEMENTED;
 }
 
+/* parameters might not be used if OS doesn't support zeroout */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
 static errcode_t unix_zeroout(io_channel channel, unsigned long long block,
                              unsigned long long count)
 {
@@ -1056,6 +1059,7 @@ err:
 unimplemented:
        return EXT2_ET_UNIMPLEMENTED;
 }
+#pragma GCC diagnostic pop
 
 static struct struct_io_manager struct_unix_manager = {
        .magic          = EXT2_ET_MAGIC_IO_MANAGER,
index 6eb66a91bd70e2734970d37994575f9b89542b73..9365be062db98770735bb76281a3771a2f1da325 100644 (file)
@@ -39,9 +39,9 @@ static void ss_release_readline(ss_data *info)
 /* Libraries we will try to use for readline/editline functionality */
 #define DEFAULT_LIBPATH "libreadline.so.6:libreadline.so.5:libreadline.so.4:libreadline.so:libedit.so.2:libedit.so:libeditline.so.0:libeditline.so"
 
+#ifdef HAVE_DLOPEN
 void ss_get_readline(int sci_idx)
 {
-#ifdef HAVE_DLOPEN
        void    *handle = NULL;
        ss_data *info = ss_info(sci_idx);
        const char **t, *libpath = 0;
@@ -92,7 +92,9 @@ void ss_get_readline(int sci_idx)
             dlsym(handle, "rl_attempted_completion_function")) != NULL)
                *completion_func = ss_rl_completion;
        info->readline_shutdown = ss_release_readline;
-#endif
 }
-
-
+#else
+void ss_get_readline(int sci_idx __SS_ATTR((unused)))
+{
+}
+#endif
index b45ae71ee618c36aae58dd26b16ab44319132b2c..00e96f8c7f7a144e29e31b1d9bd0c8b7dddc5875 100644 (file)
@@ -57,7 +57,8 @@ static void print_dquot(const char *desc, struct dquot *dq)
                dq->dq_dqb.dqb_isoftlimit, dq->dq_dqb.dqb_ihardlimit);
 }
 #else
-static void print_dquot(const char *desc, struct dquot *dq)
+static void print_dquot(const char *desc EXT2FS_ATTR((unused)),
+                       struct dquot *dq EXT2FS_ATTR((unused)))
 {
 }
 #endif
@@ -66,7 +67,7 @@ static void print_dquot(const char *desc, struct dquot *dq)
  * Returns 0 if not able to find the quota file, otherwise returns its
  * inode number.
  */
-int quota_file_exists(ext2_filsys fs, int qtype, int fmt)
+int quota_file_exists(ext2_filsys fs, int qtype)
 {
        char qf_name[256];
        errcode_t ret;
@@ -339,7 +340,8 @@ static struct dquot *get_dq(dict_t *dict, __u32 key)
 /*
  * Called to update the blocks used by a particular inode
  */
-void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
+void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode,
+                   ext2_ino_t ino EXT2FS_ATTR((unused)),
                    qsize_t space)
 {
        struct dquot    *dq;
@@ -365,7 +367,8 @@ void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
 /*
  * Called to remove some blocks used by a particular inode
  */
-void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
+void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode,
+                   ext2_ino_t ino EXT2FS_ATTR((unused)),
                    qsize_t space)
 {
        struct dquot    *dq;
@@ -391,7 +394,7 @@ void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
  * Called to count the files used by an inode's user/group
  */
 void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode *inode,
-                      ext2_ino_t ino, int adjust)
+                      ext2_ino_t ino EXT2FS_ATTR((unused)), int adjust)
 {
        struct dquot    *dq;
        dict_t          *dict;
index e2b7ff4a698d2dd4ff2f7189c79c4250edb609ed..0a029e2663667d6b8660c8733536e18616c8c939 100644 (file)
@@ -118,9 +118,9 @@ static void print_ext2_info(const char *device)
  * return 1 if there is no partition table, 0 if a partition table is
  * detected, and -1 on an error.
  */
+#ifdef HAVE_BLKID_PROBE_ENABLE_PARTITIONS
 static int check_partition_table(const char *device)
 {
-#ifdef HAVE_BLKID_PROBE_ENABLE_PARTITIONS
        blkid_probe pr;
        const char *value;
        int ret;
@@ -151,10 +151,13 @@ static int check_partition_table(const char *device)
 errout:
        blkid_free_probe(pr);
        return ret;
+}
 #else
+static int check_partition_table(const char *device EXT2FS_ATTR((unused)))
+{
        return -1;
-#endif
 }
+#endif
 
 /*
  * return 1 if the device looks plausible, creating the file if necessary
index c7e5f87b5a1bf2750931e15d3491f914ea5392f3..3af82f7d40aecd9494b1d3eff1328ed8cd04bbf6 100644 (file)
@@ -55,22 +55,6 @@ const char *quota_get_qf_name(int type, int fmt, char *buf)
        return buf;
 }
 
-const char *quota_get_qf_path(const char *mntpt, int qtype, int fmt,
-                             char *path_buf, size_t path_buf_size)
-{
-       char qf_name[QUOTA_NAME_LEN];
-
-       if (!mntpt || !path_buf || !path_buf_size)
-               return NULL;
-
-       strncpy(path_buf, mntpt, path_buf_size);
-       strncat(path_buf, "/", 1);
-       strncat(path_buf, quota_get_qf_name(qtype, fmt, qf_name),
-               path_buf_size - strlen(path_buf));
-
-       return path_buf;
-}
-
 /*
  * Set grace time if needed
  */
@@ -98,11 +82,12 @@ void update_grace_times(struct dquot *q)
        }
 }
 
-static int compute_num_blocks_proc(ext2_filsys fs, blk64_t *blocknr,
-                              e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
-                              blk64_t ref_block EXT2FS_ATTR((unused)),
-                              int ref_offset EXT2FS_ATTR((unused)),
-                              void *private)
+static int compute_num_blocks_proc(ext2_filsys fs EXT2FS_ATTR((unused)),
+                                  blk64_t *blocknr EXT2FS_ATTR((unused)),
+                                  e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
+                                  blk64_t ref_block EXT2FS_ATTR((unused)),
+                                  int ref_offset EXT2FS_ATTR((unused)),
+                                  void *private)
 {
        blk64_t *num_blocks = private;
 
index 96661ac159827df9c12cc063ff73c19027f48cd6..9d580ae207cc9d07de3c445b3895703d4fc8f03d 100644 (file)
@@ -198,8 +198,6 @@ void update_grace_times(struct dquot *q);
 #define QUOTA_NAME_LEN 16
 
 const char *quota_get_qf_name(int type, int fmt, char *buf);
-const char *quota_get_qf_path(const char *mntpt, int qtype, int fmt,
-                             char *path_buf, size_t path_buf_size);
 
 /* In mkquota.c */
 errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype);
@@ -215,7 +213,7 @@ errcode_t quota_compute_usage(quota_ctx_t qctx);
 void quota_release_context(quota_ctx_t *qctx);
 
 errcode_t quota_remove_inode(ext2_filsys fs, int qtype);
-int quota_file_exists(ext2_filsys fs, int qtype, int fmt);
+int quota_file_exists(ext2_filsys fs, int qtype);
 void quota_set_sb_inum(ext2_filsys fs, ext2_ino_t ino, int qtype);
 errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
                                   int *usage_inconsistent);
index 504b3ea31645404d38b262fa1e54d946f6a4255b..38be2a34ffae2c92b3a593e9f421888383be1df3 100644 (file)
@@ -277,7 +277,8 @@ static int v2_scan_dquots(struct quota_handle *h,
  * TODO: Not used right now, but we should be able to use this when we add
  * support to debugfs to read quota files.
  */
-static int v2_report(struct quota_handle *h, int verbose)
+static int v2_report(struct quota_handle *h EXT2FS_ATTR((unused)),
+                    int verbose EXT2FS_ATTR((unused)))
 {
        log_err("Not Implemented.");
        return -1;
index e89ccccefa251d97bc3f35fd41e4661c135a0fa1..794c5851ba37394a69e31bbdefc0fbb4d19ff117 100644 (file)
@@ -478,6 +478,10 @@ static void close_all_fds(void)
 }
 #endif /* defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */
 
+#pragma GCC diagnostic push
+#if !defined(USE_UUIDD) || !defined(HAVE_SYS_UN_H)
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
 /*
  * Try using the uuidd daemon to generate the UUID
  *
@@ -560,6 +564,7 @@ fail:
 #endif
        return -1;
 }
+#pragma GCC diagnostic pop
 
 void uuid__generate_time(uuid_t out, int *num)
 {
index a3b477f1522795c62aeeb9dcdff222cc2ed62f3b..4dd31083e48b4caaaa805b1976bd7d521ff089d7 100644 (file)
@@ -106,8 +106,8 @@ static errcode_t add_link(ext2_filsys fs, ext2_ino_t parent_ino,
 }
 
 /* Set the uid, gid, mode and time for the inode */
-static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd,
-                                ext2_ino_t ino, struct stat *st)
+static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino,
+                                struct stat *st)
 {
        errcode_t               retval;
        struct ext2_inode       inode;
@@ -131,10 +131,10 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd,
        return retval;
 }
 
+#ifdef HAVE_LLISTXATTR
 static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino,
                                 const char *filename)
 {
-#ifdef HAVE_LLISTXATTR
        errcode_t                       retval, close_retval;
        struct ext2_xattr_handle        *handle;
        ssize_t                         size, value_size;
@@ -220,10 +220,16 @@ static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino,
                retval = retval ? retval : close_retval;
        }
        return retval;
+       return 0;
+}
 #else /* HAVE_LLISTXATTR */
+static errcode_t set_inode_xattr(ext2_filsys fs EXT2FS_ATTR((unused)),
+                                ext2_ino_t ino EXT2FS_ATTR((unused)),
+                                const char *filename EXT2FS_ATTR((unused)))
+{
        return 0;
-#endif  /* HAVE_LLISTXATTR */
 }
+#endif  /* HAVE_LLISTXATTR */
 
 /* Make a special files (block and character devices), fifo's, and sockets  */
 errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name,
@@ -348,7 +354,7 @@ errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name,
 
 /* Make a directory in the fs */
 errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name,
-                           struct stat *st, ext2_ino_t root)
+                           ext2_ino_t root)
 {
        char                    *cp;
        ext2_ino_t              parent_ino;
@@ -791,7 +797,7 @@ static errcode_t __populate_fs(ext2_filsys fs, ext2_ino_t parent_ino,
                        if (parent_ino == EXT2_ROOT_INO &&
                            strcmp(name, "lost+found") == 0)
                                goto find_lnf;
-                       retval = do_mkdir_internal(fs, parent_ino, name, &st,
+                       retval = do_mkdir_internal(fs, parent_ino, name,
                                                   root);
                        if (retval) {
                                com_err(__func__, retval,
@@ -828,7 +834,7 @@ find_lnf:
                        goto out;
                }
 
-               retval = set_inode_extra(fs, parent_ino, ino, &st);
+               retval = set_inode_extra(fs, ino, &st);
                if (retval) {
                        com_err(__func__, retval,
                                _("while setting inode for \"%s\""), name);
index 145fd57bc963736cfee2a318fbfe41772b9c23cc..cf49df2ee7e808fce3620b3959b72ba88b9411c8 100644 (file)
@@ -33,8 +33,7 @@ extern errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd,
                                     const char *name, char *target,
                                     ext2_ino_t root);
 extern errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd,
-                                  const char *name, struct stat *st,
-                                  ext2_ino_t root);
+                                  const char *name, ext2_ino_t root);
 extern errcode_t do_write_internal(ext2_filsys fs, ext2_ino_t cwd,
                                   const char *src, const char *dest,
                                   ext2_ino_t root);
index 3fd6c1cebdb963d30a88e97850a0221114ea0969..f7d6b5a3a7b12ce2a03b14db6b87e6f4d3c8b506 100644 (file)
@@ -228,8 +228,9 @@ static void clear_secrets(void)
        memset(passphrase, 0, sizeof(passphrase));
 }
 
-static void die_signal_handler(int signum, siginfo_t *siginfo,
-                              void *context)
+static void die_signal_handler(int signum EXT2FS_ATTR((unused)),
+                              siginfo_t *siginfo EXT2FS_ATTR((unused)),
+                              void *context EXT2FS_ATTR((unused)))
 {
        clear_secrets();
        exit(-1);
@@ -795,7 +796,8 @@ void do_get_policy(int argc, char **argv, const struct cmd_desc *cmd)
 "Give the invoking process (typically a shell) a new session keyring,\n" \
 "discarding its old session keyring.\n"
 
-void do_new_session(int argc, char **argv, const struct cmd_desc *cmd)
+void do_new_session(int argc, char **argv EXT2FS_ATTR((unused)),
+                   const struct cmd_desc *cmd)
 {
        long keyid, ret;
 
@@ -830,7 +832,8 @@ const struct cmd_desc cmd_list[] = {
        { NULL, NULL, NULL, NULL, 0 }
 };
 
-void do_help(int argc, char **argv, const struct cmd_desc *cmd)
+void do_help(int argc, char **argv,
+            const struct cmd_desc *cmd EXT2FS_ATTR((unused)))
 {
        const struct cmd_desc *p;
 
index 4805216355e54460ba096ac63a0feee9dda11123..be031688c20d75778eed04990fe406e29fc4af9a 100644 (file)
@@ -1432,8 +1432,7 @@ static void handle_quota_options(ext2_filsys fs)
                quota_compute_usage(qctx);
 
        if (usrquota == QOPT_ENABLE && !fs->super->s_usr_quota_inum) {
-               if ((qf_ino = quota_file_exists(fs, USRQUOTA,
-                                               QFMT_VFS_V1)) > 0)
+               if ((qf_ino = quota_file_exists(fs, USRQUOTA)) > 0)
                        quota_update_limits(qctx, qf_ino, USRQUOTA);
                quota_write_inode(qctx, USRQUOTA);
        } else if (usrquota == QOPT_DISABLE) {
@@ -1441,8 +1440,7 @@ static void handle_quota_options(ext2_filsys fs)
        }
 
        if (grpquota == QOPT_ENABLE && !fs->super->s_grp_quota_inum) {
-               if ((qf_ino = quota_file_exists(fs, GRPQUOTA,
-                                               QFMT_VFS_V1)) > 0)
+               if ((qf_ino = quota_file_exists(fs, GRPQUOTA)) > 0)
                        quota_update_limits(qctx, qf_ino, GRPQUOTA);
                quota_write_inode(qctx, GRPQUOTA);
        } else if (grpquota == QOPT_DISABLE) {
index 346cd1114cc447e6885879c25c5eb8091114c070..36cea7bc02d1d7f72f96849ce57cf968c5701031 100644 (file)
@@ -79,7 +79,7 @@ char *get_progname(char *argv_zero)
 
 static jmp_buf alarm_env;
 
-static void alarm_signal(int signal)
+static void alarm_signal(int signal EXT2FS_ATTR((unused)))
 {
        longjmp(alarm_env, 1);
 }
index 041ff75029b293127ed09e0b6104861de6d8224d..07c6a0c1ffdaeae6d2f6cddc5d421281b2abb00c 100644 (file)
@@ -1614,7 +1614,8 @@ static blk64_t get_new_block(ext2_resize_t rfs)
        }
 }
 
-static errcode_t resize2fs_get_alloc_block(ext2_filsys fs, blk64_t goal,
+static errcode_t resize2fs_get_alloc_block(ext2_filsys fs,
+                                          blk64_t goal EXT2FS_ATTR((unused)),
                                           blk64_t *ret)
 {
        ext2_resize_t rfs = (ext2_resize_t) fs->priv_data;
@@ -1959,8 +1960,10 @@ out:
        return errcode;
 }
 
-static void quiet_com_err_proc(const char *whoami, errcode_t code,
-                              const char *fmt, va_list args)
+static void quiet_com_err_proc(const char *whoami EXT2FS_ATTR((unused)),
+                              errcode_t code EXT2FS_ATTR((unused)),
+                              const char *fmt EXT2FS_ATTR((unused)),
+                              va_list args EXT2FS_ATTR((unused)))
 {
 }
 
index 9825bb5e219078c3ca664f036b3d25f483b363f3..4c5b7a01a55a18c29e0a1c571d5fcf1d4fd5dc48 100644 (file)
@@ -19,7 +19,9 @@
 #define HAVE_LSEEK64_PROTOTYPE 1
 #define HAVE_MMAP 1
 #define HAVE_NETINET_IN_H 1
+#define HAVE_NET_IF_H 1
 #define HAVE_SETJMP_H 1
+#define HAVE_SNPRINTF 1
 #define HAVE_STDLIB_H 1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRDUP 1