summaryrefslogtreecommitdiffstats
path: root/sys/fs/ntfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-05-11 19:55:07 +0000
committerphk <phk@FreeBSD.org>1999-05-11 19:55:07 +0000
commit7e26ca1d1a4bb6507cb6f9241f2d35b1048eaecd (patch)
tree31ecebf331e4a644fafb96ecafe7d2b6b1a24d39 /sys/fs/ntfs
parentc783fdfffac012af2a31c3939b62a23b94680404 (diff)
downloadFreeBSD-src-7e26ca1d1a4bb6507cb6f9241f2d35b1048eaecd.zip
FreeBSD-src-7e26ca1d1a4bb6507cb6f9241f2d35b1048eaecd.tar.gz
Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
Diffstat (limited to 'sys/fs/ntfs')
-rw-r--r--sys/fs/ntfs/ntfs_ihash.c4
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c4
-rw-r--r--sys/fs/ntfs/ntfs_vnops.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/sys/fs/ntfs/ntfs_ihash.c b/sys/fs/ntfs/ntfs_ihash.c
index e75f085..ad461ea 100644
--- a/sys/fs/ntfs/ntfs_ihash.c
+++ b/sys/fs/ntfs/ntfs_ihash.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95
- * $Id: ntfs_ihash.c,v 1.2 1999/01/02 01:17:38 semen Exp $
+ * $Id: ntfs_ihash.c,v 1.3 1999/04/20 21:06:43 semenu Exp $
*/
#include <sys/param.h>
@@ -53,7 +53,7 @@ MALLOC_DEFINE(M_NTFSNTHASH, "NTFS nthash", "NTFS ntnode hash tables");
*/
static LIST_HEAD(nthashhead, ntnode) *ntfs_nthashtbl;
static u_long ntfs_nthash; /* size of hash table - 1 */
-#define NTNOHASH(device, inum) (&ntfs_nthashtbl[((device) + (inum)) & ntfs_nthash])
+#define NTNOHASH(device, inum) (&ntfs_nthashtbl[(minor(device) + (inum)) & ntfs_nthash])
#ifndef NULL_SIMPLELOCKS
static struct simplelock ntfs_nthash_slock;
#endif
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index c22d063..fec2dcf 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ntfs_vfsops.c,v 1.3 1999/04/20 21:06:43 semenu Exp $
+ * $Id: ntfs_vfsops.c,v 1.4 1999/05/06 22:07:34 peter Exp $
*/
@@ -500,7 +500,7 @@ ntfs_mountfs(devvp, mp, argsp, p)
vput(vp);
}
- mp->mnt_stat.f_fsid.val[0] = (long)dev;
+ mp->mnt_stat.f_fsid.val[0] = dev2udev(dev);
#if __FreeBSD_version >= 300000
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
#else
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c
index d22ea5f..5e0c510 100644
--- a/sys/fs/ntfs/ntfs_vnops.c
+++ b/sys/fs/ntfs/ntfs_vnops.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ntfs_vnops.c,v 1.10 1999/02/02 03:15:13 semen Exp $
+ * $Id: ntfs_vnops.c,v 1.3 1999/04/20 21:06:43 semenu Exp $
*
*/
@@ -215,13 +215,13 @@ ntfs_getattr(ap)
dprintf(("ntfs_getattr: %d, flags: %d\n",ip->i_number,ip->i_flag));
- vap->va_fsid = fp->f_dev;
+ vap->va_fsid = dev2udev(fp->f_dev);
vap->va_fileid = ip->i_number;
vap->va_mode = ip->i_mode;
vap->va_nlink = ip->i_nlink;
vap->va_uid = ip->i_uid;
vap->va_gid = ip->i_gid;
- vap->va_rdev = (dev_t)0;
+ vap->va_rdev = 0; /* XXX UNODEV ? */
vap->va_size = fp->f_size;
vap->va_bytes = fp->f_allocated;
vap->va_atime = ntfs_nttimetounix(fp->f_times.t_access);
OpenPOWER on IntegriCloud