[Ocfs-tools-commits]
jlbec commits r132 - in trunk/ocfs2: debugfs.ocfs2 libocfs2
libocfs2/include mkfs.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Jul 2 18:07:43 CDT 2004
Author: jlbec
Date: 2004-07-02 17:07:41 -0500 (Fri, 02 Jul 2004)
New Revision: 132
Modified:
trunk/ocfs2/debugfs.ocfs2/commands.c
trunk/ocfs2/debugfs.ocfs2/dump.c
trunk/ocfs2/debugfs.ocfs2/readfs.c
trunk/ocfs2/libocfs2/include/filesys.h
trunk/ocfs2/libocfs2/include/ocfs2_disk_dlm.h
trunk/ocfs2/libocfs2/include/ocfs2_fs.h
trunk/ocfs2/libocfs2/openfs.c
trunk/ocfs2/libocfs2/unix_io.c
trunk/ocfs2/mkfs.ocfs2/mkfs2.c
Log:
o Signedness
Modified: trunk/ocfs2/debugfs.ocfs2/commands.c
===================================================================
--- trunk/ocfs2/debugfs.ocfs2/commands.c 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/debugfs.ocfs2/commands.c 2004-07-02 22:07:41 UTC (rev 132)
@@ -133,7 +133,7 @@
*/
static Command * find_command (char *cmd)
{
- int i;
+ unsigned int i;
for (i = 0; i < sizeof (commands) / sizeof (commands[0]); i++)
if (strcmp (cmd, commands[i].cmd) == 0)
Modified: trunk/ocfs2/debugfs.ocfs2/dump.c
===================================================================
--- trunk/ocfs2/debugfs.ocfs2/dump.c 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/debugfs.ocfs2/dump.c 2004-07-02 22:07:41 UTC (rev 132)
@@ -343,7 +343,7 @@
pub->publ_seq_num, pub->time);
for (j = 0; j < sb->s_max_nodes; j++)
- printf ("%d", ((pub->vote_map & (1 << j)) ? 1 : 0));
+ printf ("%d", ((pub->vote_map[j / sizeof(pub->vote_map[0])] & (1 << (j % sizeof(pub->vote_map[0])))) ? 1 : 0));
printf(" %-s\n", pub_flag->str);
Modified: trunk/ocfs2/debugfs.ocfs2/readfs.c
===================================================================
--- trunk/ocfs2/debugfs.ocfs2/readfs.c 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/debugfs.ocfs2/readfs.c 2004-07-02 22:07:41 UTC (rev 132)
@@ -188,7 +188,7 @@
{
ocfs2_extent_rec *rec;
GArray *arr = NULL;
- int i = 0;
+ unsigned int i = 0;
char *buf = NULL;
__u32 len;
__u64 off;
@@ -234,7 +234,7 @@
struct ocfs2_dir_entry *rec;
GArray *dirarr = NULL;
char *dlm = ocfs2_system_inode_names[DLM_SYSTEM_INODE];
- int i;
+ unsigned int i;
inode = (ocfs2_dinode *)sysdir;
@@ -272,7 +272,7 @@
ocfs2_extent_rec *rec;
char *p = NULL;
__u64 off, foff, len;
- int i;
+ unsigned int i;
char *newbuf = NULL;
__u64 newlen = 0;
char *inode_buf = NULL;
Modified: trunk/ocfs2/libocfs2/include/filesys.h
===================================================================
--- trunk/ocfs2/libocfs2/include/filesys.h 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/libocfs2/include/filesys.h 2004-07-02 22:07:41 UTC (rev 132)
@@ -102,8 +102,9 @@
};
-errcode_t ocfs2_open(const char *name, int flags, int superblock,
- unsigned int blksize, ocfs2_filesys **ret_fs);
+errcode_t ocfs2_open(const char *name, int flags,
+ unsigned int superblock, unsigned int blksize,
+ ocfs2_filesys **ret_fs);
errcode_t ocfs2_flush(ocfs2_filesys *fs);
errcode_t ocfs2_close(ocfs2_filesys *fs);
void ocfs2_freefs(ocfs2_filesys *fs);
Modified: trunk/ocfs2/libocfs2/include/ocfs2_disk_dlm.h
===================================================================
--- trunk/ocfs2/libocfs2/include/ocfs2_disk_dlm.h 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/libocfs2/include/ocfs2_disk_dlm.h 2004-07-02 22:07:41 UTC (rev 132)
@@ -90,7 +90,8 @@
/*00*/ ocfs2_disk_lock disk_lock;
/*30*/ __u8 signature[OCFS2_NODE_CONFIG_SIGN_LEN];
__u32 version;
- __u32 num_nodes;
+ __u16 num_nodes;
+ __u16 reserved1;
/*40*/ __u32 last_node;
__u32 onch_pad;
__u64 cfg_seq_num;
@@ -107,8 +108,8 @@
__u32 dirty; /* Is the node in a clean state */
/*10*/ __u32 vote_type; /* Type required */
__u32 mounted; /* Does the publisher have it mounted */
-/*18*/ __u32 reserved1[8];
-/*38*/ __u64 vote_map; /* Who needs to vote */
+/*18*/ __u32 vote_map[8]; /* Who needs to vote */
+/*38*/ __u64 reserved1;
/*50*/ __u64 publ_seq_num; /* Sequence for vote */
__u64 lock_id; /* Lock vote is requested for */
/* last seq num used in comm voting */
Modified: trunk/ocfs2/libocfs2/include/ocfs2_fs.h
===================================================================
--- trunk/ocfs2/libocfs2/include/ocfs2_fs.h 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/libocfs2/include/ocfs2_fs.h 2004-07-02 22:07:41 UTC (rev 132)
@@ -252,7 +252,7 @@
/*00*/ __u8 h_signature[8]; /* Signature for verification */
__u64 h_suballoc_blkno; /* Node suballocator offset,
in blocks */
-/*10*/ __u16 h_suballoc_node; /* Node suballocator this
+/*10*/ __s16 h_suballoc_node; /* Node suballocator this
extent_header belongs to */
__u16 h_reserved1;
__u32 h_reserved2;
@@ -272,9 +272,10 @@
*/
typedef struct _ocfs2_disk_lock
{
-/*00*/ __u32 dl_master; /* Node number of current master */
+/*00*/ __s16 dl_master; /* Node number of current master */
+ __u16 dl_reserved1;
__u8 dl_level; /* Lock level */
- __u8 dl_reserved1[3]; /* Pad to u64 */
+ __u8 dl_reserved2[3]; /* Pad to u64 */
__u64 dl_seq_num; /* Lock transaction seqnum */
/*10*/ __u32 dl_node_map[8]; /* Bitmap of interested nodes,
was __u32 */
@@ -305,10 +306,11 @@
directory dinode */
__u32 s_blocksize_bits; /* Blocksize for this fs */
__u32 s_clustersize_bits; /* Clustersize for this fs */
-/*40*/ __u32 s_max_nodes; /* Max nodes in this cluster before
+/*40*/ __u16 s_max_nodes; /* Max nodes in this cluster before
tunefs required */
- __u32 s_reserved1;
- __u64 s_reserved2;
+ __u16 s_reserved1;
+ __u32 s_reserved2;
+ __u64 s_reserved3;
/*50*/ __u8 s_label[64]; /* Label for mounting, etc. */
/*90*/ __u8 s_uuid[16]; /* Was vol_id */
/*A0*/
@@ -338,7 +340,7 @@
/*00*/ __u8 i_signature[8]; /* Signature for validation */
__u32 i_generation; /* Generation number */
__u16 i_reserved1;
- __u16 i_suballoc_node; /* Node suballocater this inode
+ __s16 i_suballoc_node; /* Node suballocater this inode
belongs to */
/*10*/ __u64 i_suballoc_blkno; /* Node suballocator offset,
in blocks */
Modified: trunk/ocfs2/libocfs2/openfs.c
===================================================================
--- trunk/ocfs2/libocfs2/openfs.c 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/libocfs2/openfs.c 2004-07-02 22:07:41 UTC (rev 132)
@@ -123,8 +123,9 @@
return ret;
}
-errcode_t ocfs2_open(const char *name, int flags, int superblock,
- unsigned int block_size, ocfs2_filesys **ret_fs)
+errcode_t ocfs2_open(const char *name, int flags,
+ unsigned int superblock, unsigned int block_size,
+ ocfs2_filesys **ret_fs)
{
ocfs2_filesys *fs;
errcode_t ret;
@@ -219,7 +220,7 @@
ret = OCFS2_ET_UNEXPECTED_BLOCK_SIZE;
if (block_size !=
- (1 << OCFS2_RAW_SB(fs->fs_super)->s_blocksize_bits))
+ (1U << OCFS2_RAW_SB(fs->fs_super)->s_blocksize_bits))
goto out;
fs->fs_clustersize =
Modified: trunk/ocfs2/libocfs2/unix_io.c
===================================================================
--- trunk/ocfs2/libocfs2/unix_io.c 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/libocfs2/unix_io.c 2004-07-02 22:07:41 UTC (rev 132)
@@ -278,7 +278,7 @@
static void dump_u32(uint32_t *val)
{
- int i;
+ unsigned int i;
uint8_t *bytes = (uint8_t *)val;
for (i = 0; i < sizeof(uint32_t); i++)
@@ -287,7 +287,7 @@
static void dump_block(int64_t blkno, int blksize, char *buf)
{
- int i;
+ unsigned int i;
uint32_t *vals = (uint32_t *)buf;
fprintf(stdout, "Dumping block %lld (%d bytes):\n", blkno,
Modified: trunk/ocfs2/mkfs.ocfs2/mkfs2.c
===================================================================
--- trunk/ocfs2/mkfs.ocfs2/mkfs2.c 2004-07-02 21:33:32 UTC (rev 131)
+++ trunk/ocfs2/mkfs.ocfs2/mkfs2.c 2004-07-02 22:07:41 UTC (rev 132)
@@ -314,7 +314,7 @@
first_zero = -1;
bail:
- if (first_zero != -1 && first_zero > bitmap->valid_bits) {
+ if (first_zero != (__u32)-1 && first_zero > bitmap->valid_bits) {
fprintf(stderr, "um... first_zero>bitmap->valid_bits (%d > %d)",
first_zero, bitmap->valid_bits);
first_zero = -1;
@@ -780,7 +780,7 @@
pagesize = getpagesize();
pagesize_bits = 0;
for (i=32; i>=0; i--) {
- if ((1 << i) == pagesize)
+ if (pagesize == (1U << i))
pagesize_bits = i;
}
if (!pagesize_bits)
@@ -795,7 +795,7 @@
}
blocksize_bits = 0;
for (i=32; i>=0; i--) {
- if ((1 << i) == blocksize)
+ if ((1U << i) == blocksize)
blocksize_bits = i;
}
if (!blocksize_bits)
@@ -803,7 +803,7 @@
cluster_size_bits = 0;
for (i=32; i>=0; i--) {
- if ((1 << i) == cluster_size)
+ if ((1U << i) == cluster_size)
cluster_size_bits = i;
}
if (!cluster_size_bits)
@@ -1112,7 +1112,7 @@
/* superblock */
superblock_rec.fe_off = alloc_inode(SUPERBLOCK_BLOCKS);
- if (superblock_rec.fe_off != MAGIC_SUPERBLOCK_BLOCK_NUMBER << blocksize_bits)
+ if (superblock_rec.fe_off != (__u64)MAGIC_SUPERBLOCK_BLOCK_NUMBER << blocksize_bits)
MKFS_FATAL("superblock starts at byte %llu, must start at %llu\n",
superblock_rec.fe_off, MAGIC_SUPERBLOCK_BLOCK_NUMBER << blocksize_bits);
More information about the Ocfs-tools-commits
mailing list