lkml.org 
[lkml]   [2002]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
SubjectRe: [PATH] Port software to UML.
On Sun, 05 May 2002 19:22:39 -0500
Jeff Dike <jdike@karaya.com> wrote:

> gang_hu@soul.com.cn said:
> > Ther problem in bread.
>
> No, the problem is in not understanding UML.
>
> UML's state is somewhat more complicated than the state of a native kernel.
>
> You also need to recreate
> the host processes
> the ptrace relationships between the tracing thread and the other
> processes
> open file descriptors
> and maybe a few other things that aren't coming to mind
>
> Jeff

Now , I found the Problem. Fix that have two way
--1 after the register disk , We not close it.
--2 at prepare_request , We check the dev->count, it not open , must open it first.

The 1.diff is use the 1 way.
the 2.diff is use the 2 way.

Which is the best?

--
thanks with regards!
hugang.

***********************************
Beijing Soul Technology Co.,Ltd.
Tel:010-68425741/42/43/44
Fax:010-68425745
email:gang_hu@soul.com.cn
web:http://www.soul.com.cn
***********************************

--- ubd.c~ Mon May 6 10:42:56 2002
+++ ubd.c.2 Mon May 6 10:46:06 2002
@@ -720,7 +720,22 @@
end_request(0);
return(1);
}
-
+ if(!dev->count) {
+ if (dev->file) {
+ if(ubd_open_dev(dev) < 0){
+ printk(KERN_ERR "unable to open %s for validation\n",
+ dev->file);
+ return 1;
+ }
+ } else return 1;
+
+ /* have to recompute sizes since we opened it */
+ err = ubd_file_size(dev, &dev->size);
+ if(err) {
+ ubd_close(dev);
+ return 1;
+ }
+ }
req->sector += ubd_part[minor].start_sect;
block = req->sector;
nsect = req->current_nr_sectors;--- ubd.c~ Mon May 6 10:42:56 2002
+++ ubd.c Mon May 6 10:49:11 2002
@@ -888,33 +888,26 @@
/* If it already has been opened we can check the partitions
* directly
*/
- if(dev->count){
- part->start_sect = 0;
- register_disk(&ubd_gendisk, MKDEV(MAJOR_NR, offset), pcount,
- &ubd_blops, part->nr_sects);
- }
- else if(dev->file){
- if(ubd_open_dev(dev) < 0){
- printk(KERN_ERR "unable to open %s for validation\n",
- dev->file);
- return 1;
- }
-
+ part->start_sect = 0;
+ if(!dev->count) {
+ if (dev->file) {
+ if(ubd_open_dev(dev) < 0){
+ printk(KERN_ERR "unable to open %s for validation\n",
+ dev->file);
+ return 1;
+ }
+ } else return 1;
+
/* have to recompute sizes since we opened it */
err = ubd_file_size(dev, &dev->size);
if(err) {
ubd_close(dev);
return 1;
}
- part->start_sect = 0;
part->nr_sects = dev->size / hardsect_sizes[offset];
- register_disk(&ubd_gendisk, MKDEV(MAJOR_NR, offset), pcount,
- &ubd_blops, part->nr_sects);
-
- /* we are done so close it */
- ubd_close(dev);
- }
- else return(1);
+ }
+ register_disk(&ubd_gendisk, MKDEV(MAJOR_NR, offset), pcount,
+ &ubd_blops, part->nr_sects);
return(0);
}
\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.056 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site