original development tree for Linux kernel GTP module; now long in mainline.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
7.6 KiB

[PATCH] getting rid of all casts of k[cmz]alloc() calls Run this: #!/bin/sh for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do echo "De-casting $f..." perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f done And then go through and reinstate those cases where code is casting pointers to non-pointers. And then drop a few hunks which conflicted with outstanding work. Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Greg KH <greg@kroah.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Paul Fulghum <paulkf@microgate.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Karsten Keil <kkeil@suse.de> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Ian Kent <raven@themaw.net> Cc: Steven French <sfrench@us.ibm.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Neil Brown <neilb@cse.unsw.edu.au> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago
[PATCH] getting rid of all casts of k[cmz]alloc() calls Run this: #!/bin/sh for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do echo "De-casting $f..." perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f done And then go through and reinstate those cases where code is casting pointers to non-pointers. And then drop a few hunks which conflicted with outstanding work. Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Greg KH <greg@kroah.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Paul Fulghum <paulkf@microgate.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Karsten Keil <kkeil@suse.de> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Ian Kent <raven@themaw.net> Cc: Steven French <sfrench@us.ibm.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Neil Brown <neilb@cse.unsw.edu.au> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago
[PATCH] getting rid of all casts of k[cmz]alloc() calls Run this: #!/bin/sh for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do echo "De-casting $f..." perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f done And then go through and reinstate those cases where code is casting pointers to non-pointers. And then drop a few hunks which conflicted with outstanding work. Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Greg KH <greg@kroah.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Paul Fulghum <paulkf@microgate.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Karsten Keil <kkeil@suse.de> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Ian Kent <raven@themaw.net> Cc: Steven French <sfrench@us.ibm.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Neil Brown <neilb@cse.unsw.edu.au> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago
  1. /*
  2. * linux/fs/befs/debug.c
  3. *
  4. * Copyright (C) 2001 Will Dyson (will_dyson at pobox.com)
  5. *
  6. * With help from the ntfs-tng driver by Anton Altparmakov
  7. *
  8. * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
  9. *
  10. * debug functions
  11. */
  12. #ifdef __KERNEL__
  13. #include <stdarg.h>
  14. #include <linux/string.h>
  15. #include <linux/spinlock.h>
  16. #include <linux/kernel.h>
  17. #include <linux/fs.h>
  18. #include <linux/slab.h>
  19. #endif /* __KERNEL__ */
  20. #include "befs.h"
  21. #define ERRBUFSIZE 1024
  22. void
  23. befs_error(const struct super_block *sb, const char *fmt, ...)
  24. {
  25. va_list args;
  26. char *err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL);
  27. if (err_buf == NULL) {
  28. printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE);
  29. return;
  30. }
  31. va_start(args, fmt);
  32. vsnprintf(err_buf, ERRBUFSIZE, fmt, args);
  33. va_end(args);
  34. printk(KERN_ERR "BeFS(%s): %s\n", sb->s_id, err_buf);
  35. kfree(err_buf);
  36. }
  37. void
  38. befs_warning(const struct super_block *sb, const char *fmt, ...)
  39. {
  40. va_list args;
  41. char *err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL);
  42. if (err_buf == NULL) {
  43. printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE);
  44. return;
  45. }
  46. va_start(args, fmt);
  47. vsnprintf(err_buf, ERRBUFSIZE, fmt, args);
  48. va_end(args);
  49. printk(KERN_WARNING "BeFS(%s): %s\n", sb->s_id, err_buf);
  50. kfree(err_buf);
  51. }
  52. void
  53. befs_debug(const struct super_block *sb, const char *fmt, ...)
  54. {
  55. #ifdef CONFIG_BEFS_DEBUG
  56. va_list args;
  57. char *err_buf = NULL;
  58. if (BEFS_SB(sb)->mount_opts.debug) {
  59. err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL);
  60. if (err_buf == NULL) {
  61. printk(KERN_ERR "could not allocate %d bytes\n",
  62. ERRBUFSIZE);
  63. return;
  64. }
  65. va_start(args, fmt);
  66. vsnprintf(err_buf, ERRBUFSIZE, fmt, args);
  67. va_end(args);
  68. printk(KERN_DEBUG "BeFS(%s): %s\n", sb->s_id, err_buf);
  69. kfree(err_buf);
  70. }
  71. #endif //CONFIG_BEFS_DEBUG
  72. }
  73. void
  74. befs_dump_inode(const struct super_block *sb, befs_inode * inode)
  75. {
  76. #ifdef CONFIG_BEFS_DEBUG
  77. befs_block_run tmp_run;
  78. befs_debug(sb, "befs_inode information");
  79. befs_debug(sb, " magic1 %08x", fs32_to_cpu(sb, inode->magic1));
  80. tmp_run = fsrun_to_cpu(sb, inode->inode_num);
  81. befs_debug(sb, " inode_num %u, %hu, %hu",
  82. tmp_run.allocation_group, tmp_run.start, tmp_run.len);
  83. befs_debug(sb, " uid %u", fs32_to_cpu(sb, inode->uid));
  84. befs_debug(sb, " gid %u", fs32_to_cpu(sb, inode->gid));
  85. befs_debug(sb, " mode %08x", fs32_to_cpu(sb, inode->mode));
  86. befs_debug(sb, " flags %08x", fs32_to_cpu(sb, inode->flags));
  87. befs_debug(sb, " create_time %Lu",
  88. fs64_to_cpu(sb, inode->create_time));
  89. befs_debug(sb, " last_modified_time %Lu",
  90. fs64_to_cpu(sb, inode->last_modified_time));
  91. tmp_run = fsrun_to_cpu(sb, inode->parent);
  92. befs_debug(sb, " parent [%u, %hu, %hu]",
  93. tmp_run.allocation_group, tmp_run.start, tmp_run.len);
  94. tmp_run = fsrun_to_cpu(sb, inode->attributes);
  95. befs_debug(sb, " attributes [%u, %hu, %hu]",
  96. tmp_run.allocation_group, tmp_run.start, tmp_run.len);
  97. befs_debug(sb, " type %08x", fs32_to_cpu(sb, inode->type));
  98. befs_debug(sb, " inode_size %u", fs32_to_cpu(sb, inode->inode_size));
  99. if (S_ISLNK(fs32_to_cpu(sb, inode->mode))) {
  100. befs_debug(sb, " Symbolic link [%s]", inode->data.symlink);
  101. } else {
  102. int i;
  103. for (i = 0; i < BEFS_NUM_DIRECT_BLOCKS; i++) {
  104. tmp_run =
  105. fsrun_to_cpu(sb, inode->data.datastream.direct[i]);
  106. befs_debug(sb, " direct %d [%u, %hu, %hu]", i,
  107. tmp_run.allocation_group, tmp_run.start,
  108. tmp_run.len);
  109. }
  110. befs_debug(sb, " max_direct_range %Lu",
  111. fs64_to_cpu(sb,
  112. inode->data.datastream.
  113. max_direct_range));
  114. tmp_run = fsrun_to_cpu(sb, inode->data.datastream.indirect);
  115. befs_debug(sb, " indirect [%u, %hu, %hu]",
  116. tmp_run.allocation_group,
  117. tmp_run.start, tmp_run.len);
  118. befs_debug(sb, " max_indirect_range %Lu",
  119. fs64_to_cpu(sb,
  120. inode->data.datastream.
  121. max_indirect_range));
  122. tmp_run =
  123. fsrun_to_cpu(sb, inode->data.datastream.double_indirect);
  124. befs_debug(sb, " double indirect [%u, %hu, %hu]",
  125. tmp_run.allocation_group, tmp_run.start,
  126. tmp_run.len);
  127. befs_debug(sb, " max_double_indirect_range %Lu",
  128. fs64_to_cpu(sb,
  129. inode->data.datastream.
  130. max_double_indirect_range));
  131. befs_debug(sb, " size %Lu",
  132. fs64_to_cpu(sb, inode->data.datastream.size));
  133. }
  134. #endif //CONFIG_BEFS_DEBUG
  135. }
  136. /*
  137. * Display super block structure for debug.
  138. */
  139. void
  140. befs_dump_super_block(const struct super_block *sb, befs_super_block * sup)
  141. {
  142. #ifdef CONFIG_BEFS_DEBUG
  143. befs_block_run tmp_run;
  144. befs_debug(sb, "befs_super_block information");
  145. befs_debug(sb, " name %s", sup->name);
  146. befs_debug(sb, " magic1 %08x", fs32_to_cpu(sb, sup->magic1));
  147. befs_debug(sb, " fs_byte_order %08x",
  148. fs32_to_cpu(sb, sup->fs_byte_order));
  149. befs_debug(sb, " block_size %u", fs32_to_cpu(sb, sup->block_size));
  150. befs_debug(sb, " block_shift %u", fs32_to_cpu(sb, sup->block_shift));
  151. befs_debug(sb, " num_blocks %Lu", fs64_to_cpu(sb, sup->num_blocks));
  152. befs_debug(sb, " used_blocks %Lu", fs64_to_cpu(sb, sup->used_blocks));
  153. befs_debug(sb, " magic2 %08x", fs32_to_cpu(sb, sup->magic2));
  154. befs_debug(sb, " blocks_per_ag %u",
  155. fs32_to_cpu(sb, sup->blocks_per_ag));
  156. befs_debug(sb, " ag_shift %u", fs32_to_cpu(sb, sup->ag_shift));
  157. befs_debug(sb, " num_ags %u", fs32_to_cpu(sb, sup->num_ags));
  158. befs_debug(sb, " flags %08x", fs32_to_cpu(sb, sup->flags));
  159. tmp_run = fsrun_to_cpu(sb, sup->log_blocks);
  160. befs_debug(sb, " log_blocks %u, %hu, %hu",
  161. tmp_run.allocation_group, tmp_run.start, tmp_run.len);
  162. befs_debug(sb, " log_start %Ld", fs64_to_cpu(sb, sup->log_start));
  163. befs_debug(sb, " log_end %Ld", fs64_to_cpu(sb, sup->log_end));
  164. befs_debug(sb, " magic3 %08x", fs32_to_cpu(sb, sup->magic3));
  165. tmp_run = fsrun_to_cpu(sb, sup->root_dir);
  166. befs_debug(sb, " root_dir %u, %hu, %hu",
  167. tmp_run.allocation_group, tmp_run.start, tmp_run.len);
  168. tmp_run = fsrun_to_cpu(sb, sup->indices);
  169. befs_debug(sb, " indices %u, %hu, %hu",
  170. tmp_run.allocation_group, tmp_run.start, tmp_run.len);
  171. #endif //CONFIG_BEFS_DEBUG
  172. }
  173. #if 0
  174. /* unused */
  175. void
  176. befs_dump_small_data(const struct super_block *sb, befs_small_data * sd)
  177. {
  178. }
  179. /* unused */
  180. void
  181. befs_dump_run(const struct super_block *sb, befs_disk_block_run run)
  182. {
  183. #ifdef CONFIG_BEFS_DEBUG
  184. befs_block_run n = fsrun_to_cpu(sb, run);
  185. befs_debug(sb, "[%u, %hu, %hu]", n.allocation_group, n.start, n.len);
  186. #endif //CONFIG_BEFS_DEBUG
  187. }
  188. #endif /* 0 */
  189. void
  190. befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super * super)
  191. {
  192. #ifdef CONFIG_BEFS_DEBUG
  193. befs_debug(sb, "Btree super structure");
  194. befs_debug(sb, " magic %08x", fs32_to_cpu(sb, super->magic));
  195. befs_debug(sb, " node_size %u", fs32_to_cpu(sb, super->node_size));
  196. befs_debug(sb, " max_depth %08x", fs32_to_cpu(sb, super->max_depth));
  197. befs_debug(sb, " data_type %08x", fs32_to_cpu(sb, super->data_type));
  198. befs_debug(sb, " root_node_pointer %016LX",
  199. fs64_to_cpu(sb, super->root_node_ptr));
  200. befs_debug(sb, " free_node_pointer %016LX",
  201. fs64_to_cpu(sb, super->free_node_ptr));
  202. befs_debug(sb, " maximum size %016LX",
  203. fs64_to_cpu(sb, super->max_size));
  204. #endif //CONFIG_BEFS_DEBUG
  205. }
  206. void
  207. befs_dump_index_node(const struct super_block *sb, befs_btree_nodehead * node)
  208. {
  209. #ifdef CONFIG_BEFS_DEBUG
  210. befs_debug(sb, "Btree node structure");
  211. befs_debug(sb, " left %016LX", fs64_to_cpu(sb, node->left));
  212. befs_debug(sb, " right %016LX", fs64_to_cpu(sb, node->right));
  213. befs_debug(sb, " overflow %016LX", fs64_to_cpu(sb, node->overflow));
  214. befs_debug(sb, " all_key_count %hu",
  215. fs16_to_cpu(sb, node->all_key_count));
  216. befs_debug(sb, " all_key_length %hu",
  217. fs16_to_cpu(sb, node->all_key_length));
  218. #endif //CONFIG_BEFS_DEBUG
  219. }