home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 6693 < prev    next >
Encoding:
Text File  |  1992-07-25  |  2.1 KB  |  69 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!destroyer!ubc-cs!news.UVic.CA!sanjuan!pmacdona
  3. From: pmacdona@sanjuan (Peter MacDonald)
  4. Subject: auto-detect fs type on mount
  5. Message-ID: <1992Jul25.162011.1956@sol.UVic.CA>
  6. Sender: news@sol.UVic.CA
  7. Nntp-Posting-Host: sanjuan.uvic.ca
  8. Organization: University of Victoria, Victoria, BC, CANADA
  9. Date: Sat, 25 Jul 92 16:20:11 GMT
  10. Lines: 57
  11.  
  12. Here is a simple patch to allow the kernel to try to auto
  13. detect the FS type upon a mount request with no type
  14. specified, or with a type of "-".  Actually, as you can see,
  15. it just changes sys_mount to try the three current types,
  16. minix, ext, and msdos.  We should probably get rid of
  17. the "magic match" msg.  Also, overwriting the dev_name
  18. field with the FS type upon return may not be acceptable?
  19.  
  20. I am sending this to Linus as well, since I am not entirely
  21. sure he can keep up with reading this group anymore :-)
  22.  
  23. Peter (pmacdona@tadpole.bcsc.gov.bc.ca, pmacdona@sanjuan.uvic.ca)
  24. ----------------------------------------------------------------
  25.  
  26. *** super.c.save    Sat Jul 25 07:32:30 1992
  27. --- super.c    Sat Jul 25 08:58:28 1992
  28. ***************
  29. *** 275,288 ****
  30.               i = 4095;
  31.           memcpy_fromfs((void *) page,data,i);
  32.       }
  33. !     if (type) {
  34.           for (i = 0 ; i < 100 ; i++)
  35.               if (!(tmp[i] = get_fs_byte(type++)))
  36.                   break;
  37.           t = tmp;
  38. !     } else
  39. !         t = "minix";
  40. !     retval = do_mount(dev,dir_name,t,flags,(void *) page);
  41.       free_page(page);
  42.       return retval;
  43.   }
  44. --- 275,297 ----
  45.               i = 4095;
  46.           memcpy_fromfs((void *) page,data,i);
  47.       }
  48. !     if (!type || ('-' == get_fs_byte(type))) {
  49. !         if (0 == (retval = do_mount(dev,dir_name,"minix",flags,(void *) page)))
  50. !             put_fs_byte('m', dev_name);
  51. !         else
  52. !         if (0 == (retval = do_mount(dev,dir_name,"ext",flags,(void *) page)))
  53. !             put_fs_byte('e', dev_name);
  54. !         else
  55. !         if (0 == (retval = do_mount(dev,dir_name,"msdos",flags,(void *) page)))
  56. !             put_fs_byte('m', dev_name);
  57. !         
  58. !     } else {
  59.           for (i = 0 ; i < 100 ; i++)
  60.               if (!(tmp[i] = get_fs_byte(type++)))
  61.                   break;
  62.           t = tmp;
  63. !         retval = do_mount(dev,dir_name,t,flags,(void *) page);
  64. !     }
  65.       free_page(page);
  66.       return retval;
  67.   }
  68.  
  69.