CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL5 Changes by: [EMAIL PROTECTED] 2007-10-11 20:32:37
Modified files: gfs2/edit : hexedit.h savemeta.c gfs2/fsck : lost_n_found.c pass1.c pass1b.c gfs2/include : gfs_ondisk.h gfs2/libgfs2 : fs_ops.c ondisk.c super.c gfs2/quota : main.c gfs2/tool : main.c Log message: Resolves: bz 251180: Build time warnings for gfs2 userland tools Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.3&r2=1.4.2.4 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/savemeta.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.1&r2=1.1.2.2 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/lost_n_found.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3&r2=1.3.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/pass1.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.6&r2=1.4.2.7 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/pass1b.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.3&r2=1.3.2.4 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/include/gfs_ondisk.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1&r2=1.1.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/fs_ops.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.8&r2=1.4.2.9 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/ondisk.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.2&r2=1.5.2.3 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/super.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.2&r2=1.3.2.3 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/quota/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.5&r2=1.2.2.6 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/tool/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4&r2=1.4.2.1 --- cluster/gfs2/edit/hexedit.h 2007/06/26 01:40:43 1.4.2.3 +++ cluster/gfs2/edit/hexedit.h 2007/10/11 20:32:35 1.4.2.4 @@ -223,7 +223,6 @@ __LINE__, __FILE__); \ } -#define pa(struct, member, count) print_array(#member, struct->member, count); #define printk printw /* Divide x by y. Round up if there is a remainder. */ --- cluster/gfs2/edit/savemeta.c 2007/06/26 01:53:19 1.1.2.1 +++ cluster/gfs2/edit/savemeta.c 2007/10/11 20:32:35 1.1.2.2 @@ -282,7 +282,7 @@ int error; struct gfs2_rindex buf; struct rgrp_list *rgd, *prev_rgd; - uint64_t prev_length; + uint64_t prev_length = 0; *count1 = 0; prev_rgd = NULL; --- cluster/gfs2/fsck/lost_n_found.c 2006/06/12 20:41:43 1.3 +++ cluster/gfs2/fsck/lost_n_found.c 2007/10/11 20:32:36 1.3.2.1 @@ -15,7 +15,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <dirent.h> @@ -94,35 +93,35 @@ dir_add(ip, filename, filename_len, &(lf_dip->i_di.di_num), DT_DIR); free(filename); - sprintf(tmp_name, "lost_dir_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_dir_%llu", ip->i_di.di_num.no_addr); inode_type = DT_DIR; break; case S_IFREG: - sprintf(tmp_name, "lost_file_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_file_%llu", ip->i_di.di_num.no_addr); inode_type = DT_REG; break; case S_IFLNK: - sprintf(tmp_name, "lost_link_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_link_%llu", ip->i_di.di_num.no_addr); inode_type = DT_LNK; break; case S_IFBLK: - sprintf(tmp_name, "lost_blkdev_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_blkdev_%llu", ip->i_di.di_num.no_addr); inode_type = DT_BLK; break; case S_IFCHR: - sprintf(tmp_name, "lost_chrdev_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_chrdev_%llu", ip->i_di.di_num.no_addr); inode_type = DT_CHR; break; case S_IFIFO: - sprintf(tmp_name, "lost_fifo_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_fifo_%llu", ip->i_di.di_num.no_addr); inode_type = DT_FIFO; break; case S_IFSOCK: - sprintf(tmp_name, "lost_socket_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_socket_%llu", ip->i_di.di_num.no_addr); inode_type = DT_SOCK; break; default: - sprintf(tmp_name, "lost_%"PRIu64, ip->i_di.di_num.no_addr); + sprintf(tmp_name, "lost_%llu", ip->i_di.di_num.no_addr); inode_type = DT_REG; break; } --- cluster/gfs2/fsck/pass1.c 2007/08/15 22:31:00 1.4.2.6 +++ cluster/gfs2/fsck/pass1.c 2007/10/11 20:32:36 1.4.2.7 @@ -253,7 +253,7 @@ void *private) { struct gfs2_sbd *sdp = ip->i_sbd; - struct gfs2_buffer_head *leaf_bh; + struct gfs2_buffer_head *leaf_bh = NULL; int ret = 0; struct gfs2_block_query q = {0}; struct block_count *bc = (struct block_count *) private; --- cluster/gfs2/fsck/pass1b.c 2007/09/18 18:14:27 1.3.2.3 +++ cluster/gfs2/fsck/pass1b.c 2007/10/11 20:32:36 1.3.2.4 @@ -464,7 +464,7 @@ struct blocks *b; uint64_t i; struct gfs2_block_query q; - osi_list_t *tmp; + osi_list_t *tmp = NULL; struct metawalk_fxns find_dirents = {0}; find_dirents.check_dentry = &find_dentry; int rc = 0; --- cluster/gfs2/include/Attic/gfs_ondisk.h 2006/08/22 19:02:49 1.1 +++ cluster/gfs2/include/Attic/gfs_ondisk.h 2007/10/11 20:32:36 1.1.2.1 @@ -717,31 +717,6 @@ #define CPIN_64(s1, s2, member) {(s1->member) = gfs64_to_cpu((s2->member));} #define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_gfs64((s1->member));} -#define pa(struct, member, count) print_array(#member, struct->member, count); - -/** - * print_array - Print out an array of bytes - * @title: what to print before the array - * @buf: the array - * @count: the number of bytes - * - */ - -static void -print_array(char *title, char *buf, int count) -{ - int x; - - printk(" %s =\n", title); - for (x = 0; x < count; x++) { - printk("%.2X ", (unsigned char)buf[x]); - if (x % 16 == 15) - printk("\n"); - } - if (x % 16) - printk("\n"); -} - /** * gfs_inum_in - Read in an inode number * @no: the cpu-order structure @@ -946,7 +921,6 @@ gfs_inum_print(&sb->sb_quota_di); gfs_inum_print(&sb->sb_license_di); - pa(sb, sb_reserved, 96); } /** @@ -999,8 +973,6 @@ pv(ji, ji_addr, "%"PRIu64); pv(ji, ji_nsegment, "%u"); pv(ji, ji_pad, "%u"); - - pa(ji, ji_reserved, 64); } /** @@ -1068,8 +1040,6 @@ pv(ri, ri_data, "%u"); pv(ri, ri_bitbytes, "%u"); - - pa(ri, ri_reserved, 64); } /** @@ -1149,8 +1119,6 @@ pv(rg, rg_usedmeta, "%u"); pv(rg, rg_freemeta, "%u"); - - pa(rg, rg_reserved, 64); } /** @@ -1203,8 +1171,6 @@ pv(quota, qu_limit, "%"PRIu64); pv(quota, qu_warn, "%"PRIu64); pv(quota, qu_value, "%"PRId64); - - pa(quota, qu_reserved, 64); } /** @@ -1347,8 +1313,6 @@ gfs_inum_print(&di->di_next_unused); pv(di, di_eattr, "%"PRIu64); - - pa(di, di_reserved, 56); } /** @@ -1395,8 +1359,6 @@ gfs_indirect_print(struct gfs_indirect *indirect) { gfs_meta_header_print(&indirect->in_header); - - pa(indirect, in_reserved, 64); } /** @@ -1459,8 +1421,6 @@ pv(de, de_name_len, "%u"); pv(de, de_type, "%u"); - pa(de, de_reserved, 14); - memset(buf, 0, GFS_FNAMESIZE + 1); memcpy(buf, name, de->de_name_len); printk(" name = %s\n", buf); @@ -1525,8 +1485,6 @@ pv(lf, lf_entries, "%u"); pv(lf, lf_dirent_format, "%u"); pv(lf, lf_next, "%"PRIu64); - - pa(lf, lf_reserved, 64); } /** @@ -1600,8 +1558,6 @@ pv(lh, lh_tail, "%"PRIu64); pv(lh, lh_last_dump, "%"PRIu64); - - pa(lh, lh_reserved, 64); } /** @@ -1663,8 +1619,6 @@ pv(ld, ld_length, "%u"); pv(ld, ld_data1, "%u"); pv(ld, ld_data2, "%u"); - - pa(ld, ld_reserved, 64); } /** --- cluster/gfs2/libgfs2/fs_ops.c 2007/09/24 23:17:41 1.4.2.8 +++ cluster/gfs2/libgfs2/fs_ops.c 2007/10/11 20:32:36 1.4.2.9 @@ -1363,7 +1363,7 @@ static int dir_e_search(struct gfs2_inode *dip, const char *filename, int len, unsigned int *type, struct gfs2_inum *inum) { - struct gfs2_buffer_head *bh; + struct gfs2_buffer_head *bh = NULL; struct gfs2_dirent *dent; int error; @@ -1445,7 +1445,7 @@ int error; int found = 0; uint64_t leaf_no; - struct gfs2_buffer_head *bh; + struct gfs2_buffer_head *bh = NULL; struct gfs2_dirent *cur, *prev; index = (1 << (dip->i_di.di_depth))-1; @@ -1471,8 +1471,10 @@ if(!found) return 1; - dirent2_del(dip, bh, prev, cur); - brelse(bh, updated); + if (bh) { + dirent2_del(dip, bh, prev, cur); + brelse(bh, updated); + } return 0; } --- cluster/gfs2/libgfs2/ondisk.c 2007/08/24 06:08:21 1.5.2.2 +++ cluster/gfs2/libgfs2/ondisk.c 2007/10/11 20:32:36 1.5.2.3 @@ -32,28 +32,6 @@ #define CPIN_64(s1, s2, member) {(s1->member) = be64_to_cpu((s2->member));} #define CPOUT_64(s1, s2, member) {(s2->member) = cpu_to_be64((s1->member));} -/** - * print_array - Print out an array of bytes - * @title: what to print before the array - * @buf: the array - * @count: the number of bytes - * - */ - -static void print_array(char *title, unsigned char *buf, int count) -{ - int x; - - printf(" %s =\n", title); - for (x = 0; x < count; x++) { - printf("%.2X ", (unsigned char)buf[x]); - if (x % 16 == 15) - printf("\n"); - } - if (x % 16) - printf("\n"); -} - /* * gfs2_xxx_in - read in an xxx struct * first arg: the cpu-order structure --- cluster/gfs2/libgfs2/super.c 2007/06/26 01:40:43 1.3.2.2 +++ cluster/gfs2/libgfs2/super.c 2007/10/11 20:32:36 1.3.2.3 @@ -179,7 +179,7 @@ int error; struct gfs2_rindex buf; struct rgrp_list *rgd, *prev_rgd; - uint64_t prev_length; + uint64_t prev_length = 0; *count1 = 0; prev_rgd = NULL; --- cluster/gfs2/quota/main.c 2007/08/24 06:08:21 1.2.2.5 +++ cluster/gfs2/quota/main.c 2007/10/11 20:32:37 1.2.2.6 @@ -255,24 +255,24 @@ case GQ_UNITS_KILOBYTE: if (sb->sb_bsize == 512) - printf("limit: %-10"PRIu64" warn: %-10"PRIu64"value: %-10"PRId64"\n", + printf("limit: %-10llu warn: %-10lluvalue: %-10llu\n", q->qu_limit / 2, q->qu_warn / 2, q->qu_value / 2); else - printf("limit: %-10"PRIu64" warn: %-10"PRIu64"value: %-10"PRId64"\n", + printf("limit: %-10llu warn: %-10lluvalue: %-10llu\n", q->qu_limit << (sb->sb_bsize_shift - 10), q->qu_warn << (sb->sb_bsize_shift - 10), q->qu_value << (sb->sb_bsize_shift - 10)); break; case GQ_UNITS_FSBLOCK: - printf("limit: %-10"PRIu64" warn: %-10"PRIu64" value: %-10"PRId64"\n", + printf("limit: %-10llu warn: %-10llu value: %-10llu\n", q->qu_limit, q->qu_warn, q->qu_value); break; case GQ_UNITS_BASICBLOCK: - printf("limit: %-10"PRIu64" warn: %-10"PRIu64" value: %-10"PRId64"\n", + printf("limit: %-10llu warn: %-10llu value: %-10llu\n", q->qu_limit << (sb->sb_bsize_shift - 9), q->qu_warn << (sb->sb_bsize_shift - 9), q->qu_value << (sb->sb_bsize_shift - 9)); @@ -319,8 +319,8 @@ if (error < 0) die("failed to read from quota file: %s\n", strerror(errno)); if (error != sizeof(struct gfs2_quota)) - die("Couldn't read %d bytes from quota file at offset %llu\n", - sizeof(struct gfs2_quota), offset); + die("Couldn't read %lu bytes from quota file at offset %llu\n", + sizeof(struct gfs2_quota), (unsigned long long)offset); gfs2_quota_in(q, buf); } --- cluster/gfs2/tool/main.c 2006/05/05 18:06:09 1.4 +++ cluster/gfs2/tool/main.c 2007/10/11 20:32:37 1.4.2.1 @@ -225,9 +225,7 @@ decode_arguments(argc, argv); - if (FALSE) { - /* Do Nothing */ - } else if (strcmp(action, "clearflag") == 0) + if (strcmp(action, "clearflag") == 0) set_flag(argc, argv); else if (strcmp(action, "counters") == 0) print_counters(argc, argv);