Changes by: flatcap
Update of /cvsroot/linux-ntfs/dynamic-disk/test
In directory usw-pr-cvs1:/tmp/cvs-serv23747/test
Modified Files:
compat.c ldminfo.c ldminfo.h
Log Message:
more trivial stuff
Index: compat.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/test/compat.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -U2 -r1.16 -r1.17
--- compat.c 17 Jun 2002 01:28:57 -0000 1.16
+++ compat.c 20 Jun 2002 18:04:55 -0000 1.17
@@ -61,4 +61,6 @@
{
//printf ("free %p in %s\n", objp, fn);
+ if (!objp)
+ return;
ldm_mem_free++;
ldm_mem_count--;
@@ -182,11 +184,13 @@
if (atomic_read (&page->count) < 1) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,8)
- if (page->buffers)
+ if ((page->buffers) && (page->buffers->b_data))
kfree (page->buffers->b_data);
- kfree (page->buffers);
+ if (page->buffers)
+ kfree (page->buffers);
#else
- if (page->private)
+ if ((page->private) && (((struct buffer_head*)(page->private))->b_data))
kfree (((struct buffer_head*)(page->private))->b_data);
- kfree ((void*)(page->private));
+ if (page->private);
+ kfree ((void*)(page->private));
#endif
kfree (page);
Index: ldminfo.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/test/ldminfo.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -U2 -r1.29 -r1.30
--- ldminfo.c 17 Jun 2002 01:28:57 -0000 1.29
+++ ldminfo.c 20 Jun 2002 18:04:55 -0000 1.30
@@ -51,5 +51,5 @@
numeric = isdigit (name[strlen (name) - 1]);
- printf ("Device | Offset Bytes Sectors Mb | Size Bytes Sectors Mb\n"
+ printf ("Device | Offset Bytes Sectors MiB | Size Bytes Sectors MiB\n"
"-------------+--------------------------------+-------------------------------\n");
for (i = 0; i < 256; i++) {
@@ -138,4 +138,5 @@
int ver = 0;
struct block_device bdev;
+ struct stat st;
for (a = 1; a < argc; a++) {
@@ -180,4 +181,14 @@
if (!argv[a][0])
continue;
+
+ if (stat (argv[a], &st)) {
+ printf ("Couldn't open device: %s\n", argv[a]);
+ break;
+ }
+
+ if ((!S_ISBLK (st.st_rdev)) && (!S_ISREG (st.st_rdev))) {
+ printf ("Couldn't open device: %s\n", argv[a]);
+ break;
+ }
device = open64 (argv[a], O_RDONLY);
Index: ldminfo.h
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/test/ldminfo.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -U2 -r1.16 -r1.17
--- ldminfo.h 17 Jun 2002 01:28:57 -0000 1.16
+++ ldminfo.h 20 Jun 2002 18:04:56 -0000 1.17
@@ -9,4 +9,5 @@
#include <linux/genhd.h>
#include <linux/list.h>
+//#include <linux/buffer_head.h>
#include <features.h>
@@ -104,4 +105,5 @@
int isdigit (int c);
char * basename(const char *filename);
+int stat (const char *file_name, struct stat *buf);
#endif // __LDMINFO_H_
|