Eliminate unused parameter warnings from Android build

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debian
Theodore Ts'o 2015-07-13 08:31:51 -04:00
parent aee40b870c
commit 25f291c9b3
28 changed files with 120 additions and 86 deletions

View File

@ -1734,7 +1734,7 @@ void do_mkdir(int argc, char *argv[])
"<filename>", CHECK_FS_RW)) "<filename>", CHECK_FS_RW))
return; return;
retval = do_mkdir_internal(current_fs, cwd, argv[1], NULL, root); retval = do_mkdir_internal(current_fs, cwd, argv[1], root);
if (retval) if (retval)
com_err(argv[0], retval, 0); 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[]) void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[])
{ {
#if CONFIG_MMP
struct mmp_struct *mmp_s; struct mmp_struct *mmp_s;
time_t t; time_t t;
errcode_t retval = 0; 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, "device_name: %s\n", mmp_s->mmp_bdevname);
fprintf(stdout, "magic: 0x%x\n", mmp_s->mmp_magic); fprintf(stdout, "magic: 0x%x\n", mmp_s->mmp_magic);
fprintf(stdout, "checksum: 0x%08x\n", mmp_s->mmp_checksum); fprintf(stdout, "checksum: 0x%08x\n", mmp_s->mmp_checksum);
#else
fprintf(stdout, "MMP is unsupported, please recompile with " fprintf(stdout, "MMP is unsupported, please recompile with "
"--enable-mmp\n"); "--enable-mmp\n");
#endif
} }
#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
static int source_file(const char *cmd_file, int ss_idx) static int source_file(const char *cmd_file, int ss_idx)
{ {

View File

@ -181,7 +181,7 @@ extern void do_get_quota(int argc, char *argv[]);
/* util.c */ /* util.c */
extern time_t string_to_time(const char *arg); 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 */ /* xattrs.c */
void dump_inode_attributes(FILE *out, ext2_ino_t ino); void dump_inode_attributes(FILE *out, ext2_ino_t ino);

View File

@ -66,7 +66,8 @@ typedef struct journal_transaction_s journal_transaction_t;
static journal_t *current_journal = NULL; 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 " dbg_printf("TRANS %p(%s): tid=%d start=%llu block=%llu end=%llu "
"flags=0x%x\n", trans, tag, trans->tid, trans->start, "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"); 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) { if (current_journal == NULL) {
printf("Journal not open.\n"); printf("Journal not open.\n");
@ -967,7 +969,7 @@ void do_journal_close(int argc, char *argv[])
ext2fs_close_journal(current_fs, &current_journal); 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; errcode_t err;

View 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", printf("%8u %8lld %8lld %8lld %8lld %8lld %8lld\n",
dq->dq_id, (long long)dq->dq_dqb.dqb_curspace, dq->dq_id, (long long)dq->dq_dqb.dqb_curspace,

View 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 */ return 1; /* we don't need the MMP block written again */
} }
#ifdef CONFIG_MMP
void do_set_mmp_value(int argc, char *argv[]) void do_set_mmp_value(int argc, char *argv[])
{ {
#ifdef CONFIG_MMP
const char *usage = "<field> <value>\n" const char *usage = "<field> <value>\n"
"\t\"set_mmp_value -l\" will list the names of " "\t\"set_mmp_value -l\" will list the names of "
"MMP fields\n\twhich can be set."; "MMP fields\n\twhich can be set.";
@ -906,9 +906,13 @@ void do_set_mmp_value(int argc, char *argv[])
&set_mmp); &set_mmp);
*mmp_s = set_mmp; *mmp_s = set_mmp;
} }
}
#else #else
void do_set_mmp_value(int argc EXT2FS_ATTR((unused)),
char *argv[] EXT2FS_ATTR((unused)))
{
fprintf(stdout, "MMP is unsupported, please recompile with " fprintf(stdout, "MMP is unsupported, please recompile with "
"--enable-mmp\n"); "--enable-mmp\n");
#endif
} }
#endif

View File

@ -498,11 +498,11 @@ int ext2_file_type(unsigned int mode)
return 0; 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; blk64_t *lst = *list;
size_t ln = *len; size_t ln = *len;
char *tok, *p = optarg; char *tok, *p = str;
errcode_t retval; errcode_t retval;
while ((tok = strtok(p, ","))) { while ((tok = strtok(p, ","))) {

View 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 it looks short enough to be inline data, try to clear extents */
if (EXT2_INODE_SIZE(fs->super) > EXT2_GOOD_OLD_INODE_SIZE) if (inode_size > EXT2_GOOD_OLD_INODE_SIZE)
max_inline_ea_size = EXT2_INODE_SIZE(fs->super) - max_inline_ea_size = inode_size -
(EXT2_GOOD_OLD_INODE_SIZE + (EXT2_GOOD_OLD_INODE_SIZE +
((struct ext2_inode_large *)inode)->i_extra_isize); ((struct ext2_inode_large *)inode)->i_extra_isize);
else else
@ -975,7 +975,7 @@ void e2fsck_pass1(e2fsck_t ctx)
unsigned int save_type; unsigned int save_type;
int imagic_fs, extent_fs, inlinedata_fs; int imagic_fs, extent_fs, inlinedata_fs;
int low_dtime_check = 1; int low_dtime_check = 1;
int inode_size; int inode_size = EXT2_INODE_SIZE(fs->super);
int failed_csum = 0; int failed_csum = 0;
ext2_ino_t ino_threshold = 0; ext2_ino_t ino_threshold = 0;
dgrp_t ra_group = 0; dgrp_t ra_group = 0;
@ -1083,7 +1083,6 @@ void e2fsck_pass1(e2fsck_t ctx)
ctx->flags |= E2F_FLAG_ABORT; ctx->flags |= E2F_FLAG_ABORT;
return; return;
} }
inode_size = EXT2_INODE_SIZE(fs->super);
inode = (struct ext2_inode *) inode = (struct ext2_inode *)
e2fsck_allocate_memory(ctx, inode_size, "scratch inode"); e2fsck_allocate_memory(ctx, inode_size, "scratch inode");

View File

@ -475,7 +475,6 @@ static int check_dotdot(e2fsck_t ctx,
*/ */
static int check_name(e2fsck_t ctx, static int check_name(e2fsck_t ctx,
struct ext2_dir_entry *dirent, struct ext2_dir_entry *dirent,
ext2_ino_t dir_ino,
struct problem_context *pctx) struct problem_context *pctx)
{ {
int i; 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++; dir_modified++;
if (check_filetype(ctx, dirent, ino, &cd->pctx)) if (check_filetype(ctx, dirent, ino, &cd->pctx))

View File

@ -874,8 +874,9 @@ static int probe_jfs(struct blkid_probe *probe,
return 0; return 0;
} }
static int probe_zfs(struct blkid_probe *probe, struct blkid_magic *id, static int probe_zfs(struct blkid_probe *probe __BLKID_ATTR((unused)),
unsigned char *buf) struct blkid_magic *id __BLKID_ATTR((unused)),
unsigned char *buf __BLKID_ATTR((unused)))
{ {
#if 0 #if 0
char *vdev_label; char *vdev_label;
@ -1376,7 +1377,7 @@ static int probe_lvm2(struct blkid_probe *probe,
} }
static int probe_btrfs(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) unsigned char *buf)
{ {
struct btrfs_super_block *bs; struct btrfs_super_block *bs;

View File

@ -318,7 +318,9 @@ static void ba_print_stats(ext2fs_generic_bitmap bitmap)
sizeof(struct ext2fs_ba_private_struct)); sizeof(struct ext2fs_ba_private_struct));
} }
#else #else
static void ba_print_stats(ext2fs_generic_bitmap bitmap) {} static void ba_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused)))
{
}
#endif #endif
/* Find the first zero bit between start and end, inclusive. */ /* Find the first zero bit between start and end, inclusive. */

View File

@ -37,8 +37,9 @@ typedef __u64 u64;
#define put_bh(x) brelse(x) #define put_bh(x) brelse(x)
#define be64_to_cpu(x) ext2fs_be64_to_cpu(x) #define be64_to_cpu(x) ext2fs_be64_to_cpu(x)
static inline __u32 jbd2_chksum(journal_t *j, __u32 crc, const void *address, static inline __u32 jbd2_chksum(journal_t *j EXT2FS_ATTR((unused)),
unsigned int length) __u32 crc, const void *address,
unsigned int length)
{ {
return ext2fs_crc32c_le(crc, address, length); return ext2fs_crc32c_le(crc, address, length);
} }

View File

@ -31,6 +31,11 @@
#define O_DIRECT 0 #define O_DIRECT 0
#endif #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) errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf)
{ {
#ifdef CONFIG_MMP #ifdef CONFIG_MMP
@ -453,3 +458,4 @@ mmp_error:
return EXT2_ET_OP_NOT_SUPPORTED; return EXT2_ET_OP_NOT_SUPPORTED;
#endif #endif
} }
#pragma GCC diagnostic pop

View File

@ -436,7 +436,8 @@ errout:
static errcode_t ext2fs_punch_inline_data(ext2_filsys fs, ext2_ino_t ino, static errcode_t ext2fs_punch_inline_data(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode *inode, struct ext2_inode *inode,
blk64_t start, blk64_t end) blk64_t start,
blk64_t end EXT2FS_ATTR((unused)))
{ {
errcode_t retval; errcode_t retval;

View File

@ -991,6 +991,9 @@ unimplemented:
return EXT2_ET_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, static errcode_t unix_zeroout(io_channel channel, unsigned long long block,
unsigned long long count) unsigned long long count)
{ {
@ -1056,6 +1059,7 @@ err:
unimplemented: unimplemented:
return EXT2_ET_UNIMPLEMENTED; return EXT2_ET_UNIMPLEMENTED;
} }
#pragma GCC diagnostic pop
static struct struct_io_manager struct_unix_manager = { static struct struct_io_manager struct_unix_manager = {
.magic = EXT2_ET_MAGIC_IO_MANAGER, .magic = EXT2_ET_MAGIC_IO_MANAGER,

View File

@ -39,9 +39,9 @@ static void ss_release_readline(ss_data *info)
/* Libraries we will try to use for readline/editline functionality */ /* 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" #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) void ss_get_readline(int sci_idx)
{ {
#ifdef HAVE_DLOPEN
void *handle = NULL; void *handle = NULL;
ss_data *info = ss_info(sci_idx); ss_data *info = ss_info(sci_idx);
const char **t, *libpath = 0; const char **t, *libpath = 0;
@ -92,7 +92,9 @@ void ss_get_readline(int sci_idx)
dlsym(handle, "rl_attempted_completion_function")) != NULL) dlsym(handle, "rl_attempted_completion_function")) != NULL)
*completion_func = ss_rl_completion; *completion_func = ss_rl_completion;
info->readline_shutdown = ss_release_readline; info->readline_shutdown = ss_release_readline;
#endif
} }
#else
void ss_get_readline(int sci_idx __SS_ATTR((unused)))
{
}
#endif

View 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); dq->dq_dqb.dqb_isoftlimit, dq->dq_dqb.dqb_ihardlimit);
} }
#else #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 #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 * Returns 0 if not able to find the quota file, otherwise returns its
* inode number. * 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]; char qf_name[256];
errcode_t ret; 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 * 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) qsize_t space)
{ {
struct dquot *dq; 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 * 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) qsize_t space)
{ {
struct dquot *dq; 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 * Called to count the files used by an inode's user/group
*/ */
void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode *inode, 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; struct dquot *dq;
dict_t *dict; dict_t *dict;

View 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 * return 1 if there is no partition table, 0 if a partition table is
* detected, and -1 on an error. * detected, and -1 on an error.
*/ */
#ifdef HAVE_BLKID_PROBE_ENABLE_PARTITIONS
static int check_partition_table(const char *device) static int check_partition_table(const char *device)
{ {
#ifdef HAVE_BLKID_PROBE_ENABLE_PARTITIONS
blkid_probe pr; blkid_probe pr;
const char *value; const char *value;
int ret; int ret;
@ -151,10 +151,13 @@ static int check_partition_table(const char *device)
errout: errout:
blkid_free_probe(pr); blkid_free_probe(pr);
return ret; return ret;
#else
return -1;
#endif
} }
#else
static int check_partition_table(const char *device EXT2FS_ATTR((unused)))
{
return -1;
}
#endif
/* /*
* return 1 if the device looks plausible, creating the file if necessary * return 1 if the device looks plausible, creating the file if necessary

View File

@ -55,22 +55,6 @@ const char *quota_get_qf_name(int type, int fmt, char *buf)
return 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 * 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, static int compute_num_blocks_proc(ext2_filsys fs EXT2FS_ATTR((unused)),
e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)), blk64_t *blocknr EXT2FS_ATTR((unused)),
blk64_t ref_block EXT2FS_ATTR((unused)), e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
int ref_offset EXT2FS_ATTR((unused)), blk64_t ref_block EXT2FS_ATTR((unused)),
void *private) int ref_offset EXT2FS_ATTR((unused)),
void *private)
{ {
blk64_t *num_blocks = private; blk64_t *num_blocks = private;

View File

@ -198,8 +198,6 @@ void update_grace_times(struct dquot *q);
#define QUOTA_NAME_LEN 16 #define QUOTA_NAME_LEN 16
const char *quota_get_qf_name(int type, int fmt, char *buf); 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 */ /* In mkquota.c */
errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype); 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); void quota_release_context(quota_ctx_t *qctx);
errcode_t quota_remove_inode(ext2_filsys fs, int qtype); 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); 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, errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
int *usage_inconsistent); int *usage_inconsistent);

View 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 * TODO: Not used right now, but we should be able to use this when we add
* support to debugfs to read quota files. * 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."); log_err("Not Implemented.");
return -1; return -1;

View File

@ -478,6 +478,10 @@ static void close_all_fds(void)
} }
#endif /* defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */ #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 * Try using the uuidd daemon to generate the UUID
* *
@ -560,6 +564,7 @@ fail:
#endif #endif
return -1; return -1;
} }
#pragma GCC diagnostic pop
void uuid__generate_time(uuid_t out, int *num) void uuid__generate_time(uuid_t out, int *num)
{ {

View 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 */ /* Set the uid, gid, mode and time for the inode */
static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd, static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino,
ext2_ino_t ino, struct stat *st) struct stat *st)
{ {
errcode_t retval; errcode_t retval;
struct ext2_inode inode; struct ext2_inode inode;
@ -131,10 +131,10 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd,
return retval; return retval;
} }
#ifdef HAVE_LLISTXATTR
static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino, static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino,
const char *filename) const char *filename)
{ {
#ifdef HAVE_LLISTXATTR
errcode_t retval, close_retval; errcode_t retval, close_retval;
struct ext2_xattr_handle *handle; struct ext2_xattr_handle *handle;
ssize_t size, value_size; 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; retval = retval ? retval : close_retval;
} }
return retval; return retval;
#else /* HAVE_LLISTXATTR */
return 0; return 0;
#endif /* HAVE_LLISTXATTR */
} }
#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 */
/* Make a special files (block and character devices), fifo's, and sockets */ /* 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, 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 */ /* Make a directory in the fs */
errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name, 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; char *cp;
ext2_ino_t parent_ino; 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 && if (parent_ino == EXT2_ROOT_INO &&
strcmp(name, "lost+found") == 0) strcmp(name, "lost+found") == 0)
goto find_lnf; goto find_lnf;
retval = do_mkdir_internal(fs, parent_ino, name, &st, retval = do_mkdir_internal(fs, parent_ino, name,
root); root);
if (retval) { if (retval) {
com_err(__func__, retval, com_err(__func__, retval,
@ -828,7 +834,7 @@ find_lnf:
goto out; goto out;
} }
retval = set_inode_extra(fs, parent_ino, ino, &st); retval = set_inode_extra(fs, ino, &st);
if (retval) { if (retval) {
com_err(__func__, retval, com_err(__func__, retval,
_("while setting inode for \"%s\""), name); _("while setting inode for \"%s\""), name);

View File

@ -33,8 +33,7 @@ extern errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd,
const char *name, char *target, const char *name, char *target,
ext2_ino_t root); ext2_ino_t root);
extern errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd, extern errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd,
const char *name, struct stat *st, const char *name, ext2_ino_t root);
ext2_ino_t root);
extern errcode_t do_write_internal(ext2_filsys fs, ext2_ino_t cwd, extern errcode_t do_write_internal(ext2_filsys fs, ext2_ino_t cwd,
const char *src, const char *dest, const char *src, const char *dest,
ext2_ino_t root); ext2_ino_t root);

View File

@ -228,8 +228,9 @@ static void clear_secrets(void)
memset(passphrase, 0, sizeof(passphrase)); memset(passphrase, 0, sizeof(passphrase));
} }
static void die_signal_handler(int signum, siginfo_t *siginfo, static void die_signal_handler(int signum EXT2FS_ATTR((unused)),
void *context) siginfo_t *siginfo EXT2FS_ATTR((unused)),
void *context EXT2FS_ATTR((unused)))
{ {
clear_secrets(); clear_secrets();
exit(-1); 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" \ "Give the invoking process (typically a shell) a new session keyring,\n" \
"discarding its old 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; long keyid, ret;
@ -830,7 +832,8 @@ const struct cmd_desc cmd_list[] = {
{ NULL, NULL, NULL, NULL, 0 } { 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; const struct cmd_desc *p;

View File

@ -1432,8 +1432,7 @@ static void handle_quota_options(ext2_filsys fs)
quota_compute_usage(qctx); quota_compute_usage(qctx);
if (usrquota == QOPT_ENABLE && !fs->super->s_usr_quota_inum) { if (usrquota == QOPT_ENABLE && !fs->super->s_usr_quota_inum) {
if ((qf_ino = quota_file_exists(fs, USRQUOTA, if ((qf_ino = quota_file_exists(fs, USRQUOTA)) > 0)
QFMT_VFS_V1)) > 0)
quota_update_limits(qctx, qf_ino, USRQUOTA); quota_update_limits(qctx, qf_ino, USRQUOTA);
quota_write_inode(qctx, USRQUOTA); quota_write_inode(qctx, USRQUOTA);
} else if (usrquota == QOPT_DISABLE) { } 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 (grpquota == QOPT_ENABLE && !fs->super->s_grp_quota_inum) {
if ((qf_ino = quota_file_exists(fs, GRPQUOTA, if ((qf_ino = quota_file_exists(fs, GRPQUOTA)) > 0)
QFMT_VFS_V1)) > 0)
quota_update_limits(qctx, qf_ino, GRPQUOTA); quota_update_limits(qctx, qf_ino, GRPQUOTA);
quota_write_inode(qctx, GRPQUOTA); quota_write_inode(qctx, GRPQUOTA);
} else if (grpquota == QOPT_DISABLE) { } else if (grpquota == QOPT_DISABLE) {

View File

@ -79,7 +79,7 @@ char *get_progname(char *argv_zero)
static jmp_buf alarm_env; static jmp_buf alarm_env;
static void alarm_signal(int signal) static void alarm_signal(int signal EXT2FS_ATTR((unused)))
{ {
longjmp(alarm_env, 1); longjmp(alarm_env, 1);
} }

View 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) blk64_t *ret)
{ {
ext2_resize_t rfs = (ext2_resize_t) fs->priv_data; ext2_resize_t rfs = (ext2_resize_t) fs->priv_data;
@ -1959,8 +1960,10 @@ out:
return errcode; return errcode;
} }
static void quiet_com_err_proc(const char *whoami, errcode_t code, static void quiet_com_err_proc(const char *whoami EXT2FS_ATTR((unused)),
const char *fmt, va_list args) errcode_t code EXT2FS_ATTR((unused)),
const char *fmt EXT2FS_ATTR((unused)),
va_list args EXT2FS_ATTR((unused)))
{ {
} }

View File

@ -19,7 +19,9 @@
#define HAVE_LSEEK64_PROTOTYPE 1 #define HAVE_LSEEK64_PROTOTYPE 1
#define HAVE_MMAP 1 #define HAVE_MMAP 1
#define HAVE_NETINET_IN_H 1 #define HAVE_NETINET_IN_H 1
#define HAVE_NET_IF_H 1
#define HAVE_SETJMP_H 1 #define HAVE_SETJMP_H 1
#define HAVE_SNPRINTF 1
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
#define HAVE_STRCASECMP 1 #define HAVE_STRCASECMP 1
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1