Commit graph

399 commits

Author SHA1 Message Date
Philip Homburg d9a9b727e2 Added dmap_async_driver and dmap_sel_filp fields. Support for asynch character
drivers (needs cleaning up).
2008-02-22 15:01:00 +00:00
Philip Homburg 9df94c5ee8 Use dev_t instead of Dev_t in structures. 2008-02-22 14:54:00 +00:00
Philip Homburg 097d8fee66 Use nonblocking send for reply. Support for asynchronous message passing
(needs cleaning up).
2008-02-22 14:53:02 +00:00
Philip Homburg 66c930ef8b Higher NCALLS requires bigger table. New calls are in PM. 2008-02-22 14:51:38 +00:00
Philip Homburg 93ff4c327f Added XDOPEN. 2008-02-22 14:50:41 +00:00
Philip Homburg 9388a27070 Support for O_REOPEN flag and pass the filp numbet to dev_open. 2008-02-22 14:49:02 +00:00
Philip Homburg 7387449b23 Support for suspending on character device open and on drivers that need to
be restarted.
2008-02-22 14:47:40 +00:00
Philip Homburg ca91b3b5be New fp_flags. Currently used to signal that is process should be suspended
a driver is restarted.
2008-02-22 14:32:23 +00:00
Philip Homburg 6ef71b8198 Pass suspend_reopen flag to dev_io. 2008-02-22 14:26:41 +00:00
Philip Homburg 047cc090e4 Added filp_state for driver recovery and filp_select_flags to store select
state for character specials that use asynch I/O.
2008-02-22 14:19:23 +00:00
Philip Homburg 1d7d5aa629 dev_close needs the filp number for asynch I/O, dev_io gets suspend_reopen
flag to suspend a process until the filedescriptor is re-opened. Added 
dev_reopen, asyn_io, suspended_ep, reopen_reply, asynsend, diag_repl, 
close_filp, close_reply, unpause, select_reply1, select_reply2.
2008-02-22 14:03:14 +00:00
Philip Homburg e5df351245 Support for blocking open on char specials (due to asynch message passing),
asynch. close, added close_filp function.
2008-02-22 13:57:11 +00:00
Ben Gras 67d1b67805 exit prototype 2007-10-23 14:19:16 +00:00
Ben Gras e8aec69c7b tweak to panic functions of mfs and vfs.
. print newline
  . when recursive panic detected, don't simply return, confusing
    the caller, but print a diagnostic and exit
  . don't call sys_exit as this may confuse PM; it should be OK
    to call PM exit() nowadays.
2007-10-23 14:17:51 +00:00
Ben Gras 21ae963cf1 Fixes two wrong grant return checks and one 'grant leak'. 2007-10-17 10:46:20 +00:00
Ben Gras 38604e4e3a Don't truncate read requests based on v_size; v_size can be stale in the
case of directories extended by subfilesystem. Rely on subfilesystem to
do read size truncating and return actual i/o size. This fixes bug 81 in
gforge, and unbreaks test 23.
2007-09-11 15:52:22 +00:00
Philip Homburg ab3062c8c0 REQ_FSTATFS now operates on the root inode (the inode parameter has been
removed)
2007-08-17 11:20:59 +00:00
Philip Homburg 4b1cd8c0ec Return EIO if a filedescriptor cannot be re-opened after a driver restart.
Select now returns such a filedescriptor as ready (instead of EBADF). 
Reply before dev_up in FSSIGNON to avoid the problem that a DEV_OPEN
request is received by a driver that expects a reply from the FSSIGNON.
2007-08-15 12:53:52 +00:00
Philip Homburg 90fde6e97d cleanup 2007-08-10 13:02:39 +00:00
Philip Homburg 06e1f0da61 Better recovery when req_readsuper fails. 2007-08-10 13:01:38 +00:00
Philip Homburg e2f06e7c89 Directory check before access check. 2007-08-08 15:26:47 +00:00
Philip Homburg a116b3aa55 To return the right error, check first is an object is a directory (for
mkdir, rmdir/unlink, mknod), simply pipe code by using v_pipe_rd_pos and
v_pipe_wr_pos directly. Some cleanup work in open.c
2007-08-08 14:01:36 +00:00
Philip Homburg c2bf536a55 Disable POSIX-required behavior wrt trailing slashes. 2007-08-08 11:40:47 +00:00
Philip Homburg d232b2ef42 Removed invalid consistency check. 2007-08-07 14:27:19 +00:00
Philip Homburg 9c51f0b92a O_EXCL check went missing. 2007-08-07 14:26:56 +00:00
Philip Homburg a318cd291f Somehow request.c got garbled. 2007-08-07 13:12:27 +00:00
Philip Homburg f46319037b New VFS interface 2007-08-07 12:52:47 +00:00
Ben Gras 8eb09f6ddc . readall: use lseek64() to read more than 4GB of a device
. vfs: 64-bit offset support for character device i/o
   (also remove unused dev_bio function)
 . memory: /dev/null and /dev/zero are infinitely large, don't stop
   reading/writing at 4GB
2007-04-24 13:27:33 +00:00
Philip Homburg b5e6319ae7 Removed some indentation. 2007-04-23 14:33:42 +00:00
Ben Gras dc67b37a10 more removing of warning and debug messages. 2007-04-13 14:00:31 +00:00
Ben Gras 6b2ad6fdfd verbose message out 2007-04-12 17:01:54 +00:00
Ben Gras a2b1a5134b . leave out hardware-fp code from library
. minor packman usage tweaks
 . kernel feature for printing version number
 . removed some verbose debug messages from vfs/mfs
2007-04-12 16:45:00 +00:00
Ben Gras 2958815463 leave out debug message 2007-04-12 15:24:45 +00:00
Ben Gras bd27c5240b Typo's. 2007-02-12 12:27:43 +00:00
Ben Gras 9f2f3dd488 don't call mkdep with an absolute path 2007-02-08 16:26:20 +00:00
Ben Gras 8ea438ae93 Retired DEV_{READ,WRITE,GATHER,SCATTER,IOCTL} (safe versions *_S are to
be used and drivers should never receieve these 'unsafe' variants
any more).
2007-02-07 16:22:19 +00:00
Ben Gras 41e9fedf87 Mostly bugfixes of bugs triggered by the test set.
bugfixes:
 SYSTEM:
 . removed
        rc->p_priv->s_flags = 0;
   for the priv struct shared by all user processes in get_priv(). this
   should only be done once. doing a SYS_PRIV_USER in sys_privctl()
   caused the flags of all user processes to be reset, so they were no
   longer PREEMPTIBLE. this happened when RS executed a policy script.
   (this broke test1 in the test set)

 VFS/MFS:
 . chown can change the mode of a file, and chmod arguments are only
   part of the full file mode so the full filemode is slightly magic.
   changed these calls so that the final modes are returned to VFS, so
   that the vnode can be kept up-to-date.
   (this broke test11 in the test set)

 MFS:
 . lookup() checked for sizeof(string) instead of sizeof(user_path),
   truncating long path names
   (caught by test 23)
 . truncate functions neglected to update ctime
   (this broke test16)

 VFS:
 . corner case of an empty filename lookup caused fields of a request
   not to be filled in in the lookup functions, not making it clear
   that the lookup had failed, causing messages to garbage processes,
   causing strange failures.
   (caught by test 30)
 . trust v_size in vnode when doing reads or writes on non-special
   files, truncating i/o where necessary; this is necessary for pipes,
   as MFS can't tell when a pipe has been truncated without it being
   told explicitly each time.
   when the last reader/writer on a pipe closes, tell FS about
   the new size using truncate_vn().
   (this broke test 25, among others)
 . permission check for chdir() had disappeared; added a
   forbidden() call
   (caught by test 23)

new code, shouldn't change anything:
 . introduced RTS_SET, RTS_UNSET, and RTS_ISSET macro's, and their
   LOCK variants. These macros set and clear the p_rts_flags field,
   causing a lot of duplicated logic like

       old_flags = rp->p_rts_flags;            /* save value of the flags */
       rp->p_rts_flags &= ~NO_PRIV;
       if (old_flags != 0 && rp->p_rts_flags == 0) lock_enqueue(rp);

   to change into the simpler

       RTS_LOCK_UNSET(rp, NO_PRIV);

   so the macros take care of calling dequeue() and enqueue() (or lock_*()),
   as the case may be). This makes the code a bit more readable and a
   bit less fragile.
 . removed return code from do_clocktick in CLOCK as it currently
   never replies
 . removed some debug code from VFS
 . fixed grant debug message in device.c
 
preemptive checks, tests, changes:
 . added return code checks of receive() to SYSTEM and CLOCK
 . O_TRUNC should never arrive at MFS (added sanity check and removed
   O_TRUNC code)
 . user_path declared with PATH_MAX+1 to let it be null-terminated
 . checks in MFS to see if strings passed by VFS are null-terminated
 
 IS:
 . static irq name table thrown out
2007-02-01 17:50:02 +00:00
Ben Gras 2194bc0310 vfs/mount/rs/service changes:
. changed umount() and mount() to call 'service', so that it can include
   a custom label, so that umount() works again (RS slot gets freed now).
   merged umount() and mount() into one file to encode keep this label
   knowledge in one file.
 . removed obsolete RS_PID field and RS_RESCUE rescue command
 . added label to RS_START struct
 . vfs no longer does kill of fs process on unmount (which was failing
   due to RS_PID request not working)
 . don't assume that if error wasn't one of three errors, that no error
   occured in vfs/request.c
mfs changes:
 . added checks to copy statements to truncate copies at buffer sizes
   (left in debug code for now)
 . added checks for null-terminatedness, if less than NAME_MAX was copied
 . added checks for copy function success
is changes: 
 . dump rs label
drivers.conf changes:
 . added acl for mfs so that mfs can be started with 'service start',
   so that a custom label can be provided
2007-01-22 15:25:41 +00:00
Ben Gras 722f1b2b9f . added checks for buffer sizes in sys_datacopy() functions in mfs,
print debug message if copy is truncated
. increased buffer in lookup() to be PATH_MAX instead of NAME_MAX
. sanity check in fetch_name() in vfs to see if name fits, and
  is null-terminated
. first check i < NAME_MAX, then string[i] in search_dir, as we're
  not supposed to look at string[NAME_MAX]
2007-01-16 14:50:10 +00:00
Ben Gras 94b936d7c1 . added super-user check for mount
. corrected device match for unmount (otherwise unmount would
  proceed with bogus mount slot, often sending messages to 0 (PM))
. added some sanity checking to fs process number
. made fs_sendrec PRIVATE to request.c
2007-01-16 13:57:35 +00:00
Ben Gras bcbac65a07 Don't panic if opening a block device fails. 2007-01-12 17:16:51 +00:00
Philip Homburg 9092146be7 VFS cleanup (mostly open). 2007-01-05 16:36:55 +00:00
Ben Gras da42185e1c Removed verbose statements from vfs and mfs 2006-12-22 11:54:42 +00:00
Philip Homburg 8a2a957d49 Some 64-bit file offset changes that were left out accidentally in the first
commit.
2006-12-06 15:21:27 +00:00
Philip Homburg bafc45a309 First cut at 64-bit file offsets in block devices for mkfs/fsck. 2006-11-27 14:21:43 +00:00
Philip Homburg ca448f0b0f Getdents implementation in library/vfs/mfs.
Changed readdir, etc. to use getdents
2006-11-09 16:22:54 +00:00
Ben Gras 86303b3024 Explicit conversion from O_ACCMODE to minix [RW]_BIT is clearer
and catches bogus values (such as 3).
2006-11-01 14:17:47 +00:00
Ben Gras 7195fe3325 System statistical and call profiling
support by Rogier Meurs <rogier@meurs.org>.
2006-10-30 15:53:38 +00:00
Ben Gras fa0ba56bc9 Merge of VFS by Balasz Gerofi with Minix trunk. 2006-10-25 13:40:36 +00:00