Skip to contentSkip to conversation

fs : mark nibblemap const

PATCH In review Philippe De Muyter 2 participants 3 messages Jul 13, 2007 – Sep 2, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs : mark nibblemap const

Hi all

Mark nibblemap const

fs/affs/bitmap.c +1 -1
diff -r 6c0a10cc415a fs/affs/bitmap.c
@@ -11,7 +11,7 @@
 
 /* This is, of course, shamelessly stolen from fs/minix */
 
-static int nibblemap[] = { 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4 };
+static const int nibblemap[] = { 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4 };
 
 static u32
 affs_count_free_bits(u32 blocksize, const void *data)
fs/ext2/balloc.c +1 -1
diff -r 6c0a10cc415a fs/ext2/balloc.c
@@ -522,7 +522,7 @@ io_error:
 
 #ifdef EXT2FS_DEBUG
 
-static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
+static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
 
 unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars)
 {
fs/ext3/bitmap.c +1 -1
diff -r 6c0a10cc415a fs/ext3/bitmap.c
@@ -13,7 +13,7 @@
 
 #ifdef EXT3FS_DEBUG
 
-static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
+static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
 
 unsigned long ext3_count_free (struct buffer_head * map, unsigned int numchars)
 {
fs/ext4/bitmap.c +1 -1
diff -r 6c0a10cc415a fs/ext4/bitmap.c
@@ -13,7 +13,7 @@
 
 #ifdef EXT4FS_DEBUG
 
-static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
+static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
 
 unsigned long ext4_count_free (struct buffer_head * map, unsigned int numchars)
 {
fs/minix/bitmap.c +1 -1
diff -r 6c0a10cc415a fs/minix/bitmap.c
@@ -17,7 +17,7 @@
 #include <linux/bitops.h>
 #include <linux/sched.h>
 
-static int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 };
+static const int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 };
 
 static unsigned long count_free(struct buffer_head *map[], unsigned numblocks, __u32 numbits)
 {
#1 lore raw

Hint needed : how to debug sempahore's problem

Hi all,

Can someone give me some hint or link for the following question :

I have several processes blocked in 'D' state, and I surmise they are waiting for a semaphore (in the `down' routine). How is it possible :
- to verify the processes are really blocked on a semaphore,
- to see which semaphore they are waiting on,
- to find out which process/driver/whatever holds those semaphores.

If that matters, I work on a m68k board.

Thanks in advance

Philippe

#2 lore raw

Re: Hint needed : how to debug sempahore's problem

Quoted 1 line · Philippe De Muyter

Hi all,

Hi,

Quoted 7 lines

Can someone give me some hint or link for the following question :

I have several processes blocked in 'D' state, and I surmise they are waiting for a semaphore (in the `down' routine). How is it possible :
- to verify the processes are really blocked on a semaphore,
- to see which semaphore they are waiting on,
- to find out which process/driver/whatever holds those semaphores.

I'm sure there might be a better solution, but the easiest one I've found for myself is enabling sysrq and sending sysrq-p or sysrq-t combination to the board's console and see the callpaths that lead to a deadlock (or other incorrect locking situation) in the kernel.

Signature · 1 line
I like long walks, especially when they are taken by people who annoy me.