Date: Wed, 18 Apr 2001 10:56:01 -0700 (PDT) From: Matt Dillon <dillon@earth.backplane.com> To: Julian Elischer <julian@elischer.org> Cc: Poul-Henning Kamp <phk@critter.freebsd.dk>, Robert Watson <rwatson@FreeBSD.ORG>, Kirk McKusick <mckusick@mckusick.com>, Rik van Riel <riel@conectiva.com.br>, freebsd-hackers@FreeBSD.ORG, David Xu <bsddiy@21cn.com> Subject: Re: vm balance Message-ID: <200104181756.f3IHu1D25098@earth.backplane.com> References: <38778.987605692@critter> <3ADDCDCA.86D1B3BE@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:You can mmap() devices and you can mmap files.. : :you cannot mmap FIFOs or sockets. : :for this reason I think that devices are still well represented by :vnodes. If we merged vnodes and vm objects, :then if devices were not vnodes, how would you represent :a vm area that maps a device? : :-- : __--_|\ Julian Elischer I think the crux of the issue here is that most devices just don't need the baggage of a vnode and many don't need the baggage of a VM object except possibly for mmap(). A fileops interface would be the cleanest way to implement a wide range of devices. Lets compare our various function dispatch structures. It's quite obvious to me that we can merge cdevsw and fileops and remove all vnode references from most of our devices. Ok, maybe not /dev/tty... but most of the rest surely! We would also want to have an optional vnode pointer in the fileops (like we do now) which 'enables' the additional VOP operations on that file descriptor (in this case the fileops for read, write, etc... would point to VOP wrappers like they do now), and of course we would need an opaque pointer for use by the fileops (devices would most likely load their cdev reference into it). cdevsw fileops vfsops VOPs OPEN X - - X CLOSE X X - X READ X X - X WRITE X X - X IOCTL X X - - POLL X X - X MMAP X - - X STRATEGY X - - X DUMP X - - - KQFILTER - X - X STAT - X - - NAME X - - - MAJ X - - - PSIZE X - - - FLAGS X - - - BMAJ X - - - ADVLOCK - - - X BWRITE - - - X FSYNC - - - X ISLOCKED - - - X LEASE - - - X LOCK - - - X PATHCONF - - - X READLINK - - - X REALLOCBLKS - - - X REVOKE - - - X UNLOCK - - - X BMAP - - - X PRINT - - - X BALLOC - - - X GETPAGES - - - X PUTPAGES - - - X FREEBLKS - - - X GETACL - - - X SETACL - - - X ACLCHECK - - - X GETEXTATTR - - - X SETEXTATTR - - - X LOOKUP - - - X CACHEDLOOKUP - - - X CREATE - - - X WHITEOUT - - - X MKNOD - - - X ACCESS - - - X GETATTR - - - X SETATTR - - - X REMOVE - - - X LINK - - - X RENAME - - - X MKDIR - - - X RMDIR - - - X SYMLINK - - - X READDIR - - - X INACTIVE - - - X RECLAIM - - - X MOUNT - - X - START - - X - UNMOUNT - - X - ROOT - - X - QUOTACTL - - X - STATFS - - X - SYNC - - X - VGET - - X - FHTOVP - - X - CHECKEXP - - X - VPTOFH - - X - INIT - - X - UNINIT - - X - EXTATTRCTL - - X - -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104181756.f3IHu1D25098>