a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps. this is
required now, since I've removed the globals that expose the address range.
pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
no longer any need to special-case it.
- eliminate struct uvm_vnode by moving its fields into struct vnode.
- rewrite the pageout path. the pager is now responsible for handling the
high-level requests instead of only getting control after a bunch of work
has already been done on its behalf. this will allow us to UBCify LFS,
which needs tighter control over its pages than other filesystems do.
writing a page to disk no longer requires making it read-only, which
allows us to write wired pages without causing all kinds of havoc.
- use a new PG_PAGEOUT flag to indicate that a page should be freed
on behalf of the pagedaemon when it's unlocked. this flag is very similar
to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
pageout fails due to eg. an indirect-block buffer being locked.
this allows us to remove the "version" field from struct vm_page,
and together with shrinking "loan_count" from 32 bits to 16,
struct vm_page is now 4 bytes smaller.
- no longer use PG_RELEASED for swap-backed pages. if the page is busy
because it's being paged out, we can't release the swap slot to be
reallocated until that write is complete, but unlike with vnodes we
don't keep a count of in-progress writes so there's no good way to
know when the write is done. instead, when we need to free a busy
swap-backed page, just sleep until we can get it busy ourselves.
- implement a fast-path for extending writes which allows us to avoid
zeroing new pages. this substantially reduces cpu usage.
- encapsulate the data used by the genfs code in a struct genfs_node,
which must be the first element of the filesystem-specific vnode data
for filesystems which use genfs_{get,put}pages().
- eliminate many of the UVM pagerops, since they aren't needed anymore
now that the pager "put" operation is a higher-level operation.
- enhance the genfs code to allow NFS to use the genfs_{get,put}pages
instead of a modified copy.
- clean up struct vnode by removing all the fields that used to be used by
the vfs_cluster.c code (which we don't use anymore with UBC).
- remove kmem_object and mb_object since they were useless.
instead of allocating pages to these objects, we now just allocate
pages with no object. such pages are mapped in the kernel until they
are freed, so we can use the mapping to find the page to free it.
this allows us to remove splvm() protection in several places.
The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
|
|
|
/* $NetBSD: denode.h,v 1.34 2001/09/15 20:36:39 chs Exp $ */
|
1994-06-29 10:29:24 +04:00
|
|
|
|
1994-07-19 01:38:08 +04:00
|
|
|
/*-
|
1997-10-17 15:23:29 +04:00
|
|
|
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
|
|
|
* Copyright (C) 1994, 1995, 1997 TooLs GmbH.
|
1994-07-19 01:38:08 +04:00
|
|
|
* All rights reserved.
|
1994-08-21 22:43:49 +04:00
|
|
|
* Original code by Paul Popelka (paulp@uts.amdahl.com) (see below).
|
1994-07-19 01:38:08 +04:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by TooLs GmbH.
|
|
|
|
* 4. The name of TooLs GmbH may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
1993-08-13 15:35:13 +04:00
|
|
|
/*
|
|
|
|
* Written by Paul Popelka (paulp@uts.amdahl.com)
|
1997-11-17 18:36:17 +03:00
|
|
|
*
|
1993-08-13 15:35:13 +04:00
|
|
|
* You can do anything you want with this software, just don't say you wrote
|
|
|
|
* it, and don't remove this notice.
|
1997-11-17 18:36:17 +03:00
|
|
|
*
|
1993-08-13 15:35:13 +04:00
|
|
|
* This software is provided "as is".
|
1997-11-17 18:36:17 +03:00
|
|
|
*
|
1993-08-13 15:35:13 +04:00
|
|
|
* The author supplies this software to be publicly redistributed on the
|
|
|
|
* understanding that the author is not responsible for the correct
|
|
|
|
* functioning of this software in any circumstances and is not liable for
|
|
|
|
* any damages caused by this software.
|
1997-11-17 18:36:17 +03:00
|
|
|
*
|
1993-08-13 15:35:13 +04:00
|
|
|
* October 1992
|
|
|
|
*/
|
|
|
|
|
a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps. this is
required now, since I've removed the globals that expose the address range.
pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
no longer any need to special-case it.
- eliminate struct uvm_vnode by moving its fields into struct vnode.
- rewrite the pageout path. the pager is now responsible for handling the
high-level requests instead of only getting control after a bunch of work
has already been done on its behalf. this will allow us to UBCify LFS,
which needs tighter control over its pages than other filesystems do.
writing a page to disk no longer requires making it read-only, which
allows us to write wired pages without causing all kinds of havoc.
- use a new PG_PAGEOUT flag to indicate that a page should be freed
on behalf of the pagedaemon when it's unlocked. this flag is very similar
to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
pageout fails due to eg. an indirect-block buffer being locked.
this allows us to remove the "version" field from struct vm_page,
and together with shrinking "loan_count" from 32 bits to 16,
struct vm_page is now 4 bytes smaller.
- no longer use PG_RELEASED for swap-backed pages. if the page is busy
because it's being paged out, we can't release the swap slot to be
reallocated until that write is complete, but unlike with vnodes we
don't keep a count of in-progress writes so there's no good way to
know when the write is done. instead, when we need to free a busy
swap-backed page, just sleep until we can get it busy ourselves.
- implement a fast-path for extending writes which allows us to avoid
zeroing new pages. this substantially reduces cpu usage.
- encapsulate the data used by the genfs code in a struct genfs_node,
which must be the first element of the filesystem-specific vnode data
for filesystems which use genfs_{get,put}pages().
- eliminate many of the UVM pagerops, since they aren't needed anymore
now that the pager "put" operation is a higher-level operation.
- enhance the genfs code to allow NFS to use the genfs_{get,put}pages
instead of a modified copy.
- clean up struct vnode by removing all the fields that used to be used by
the vfs_cluster.c code (which we don't use anymore with UBC).
- remove kmem_object and mb_object since they were useless.
instead of allocating pages to these objects, we now just allocate
pages with no object. such pages are mapped in the kernel until they
are freed, so we can use the mapping to find the page to free it.
this allows us to remove splvm() protection in several places.
The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
|
|
|
#include <miscfs/genfs/genfs_node.h>
|
|
|
|
|
1993-08-13 15:35:13 +04:00
|
|
|
/*
|
1994-07-17 01:32:06 +04:00
|
|
|
* This is the pc filesystem specific portion of the vnode structure.
|
|
|
|
*
|
|
|
|
* To describe a file uniquely the de_dirclust, de_diroffset, and
|
|
|
|
* de_StartCluster fields are used.
|
|
|
|
*
|
|
|
|
* de_dirclust contains the cluster number of the directory cluster
|
|
|
|
* containing the entry for a file or directory.
|
|
|
|
* de_diroffset is the index into the cluster for the entry describing
|
|
|
|
* a file or directory.
|
|
|
|
* de_StartCluster is the number of the first cluster of the file or directory.
|
|
|
|
*
|
|
|
|
* Now to describe the quirks of the pc filesystem.
|
|
|
|
* - Clusters 0 and 1 are reserved.
|
|
|
|
* - The first allocatable cluster is 2.
|
|
|
|
* - The root directory is of fixed size and all blocks that make it up
|
|
|
|
* are contiguous.
|
|
|
|
* - Cluster 0 refers to the root directory when it is found in the
|
|
|
|
* startcluster field of a directory entry that points to another directory.
|
|
|
|
* - Cluster 0 implies a 0 length file when found in the start cluster field
|
|
|
|
* of a directory entry that points to a file.
|
|
|
|
* - You can't use the cluster number 0 to derive the address of the root
|
|
|
|
* directory.
|
|
|
|
* - Multiple directory entries can point to a directory. The entry in the
|
|
|
|
* parent directory points to a child directory. Any directories in the
|
|
|
|
* child directory contain a ".." entry that points back to the parent.
|
|
|
|
* The child directory itself contains a "." entry that points to itself.
|
|
|
|
* - The root directory does not contain a "." or ".." entry.
|
|
|
|
* - Directory entries for directories are never changed once they are created
|
|
|
|
* (except when removed). The size stays 0, and the last modification time
|
|
|
|
* is never changed. This is because so many directory entries can point to
|
|
|
|
* the physical clusters that make up a directory. It would lead to an
|
|
|
|
* update nightmare.
|
|
|
|
* - The length field in a directory entry pointing to a directory contains 0
|
|
|
|
* (always). The only way to find the end of a directory is to follow the
|
|
|
|
* cluster chain until the "last cluster" marker is found.
|
|
|
|
*
|
|
|
|
* My extensions to make this house of cards work. These apply only to the in
|
|
|
|
* memory copy of the directory entry.
|
|
|
|
* - A reference count for each denode will be kept since dos doesn't keep such
|
|
|
|
* things.
|
1993-08-13 15:35:13 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal pseudo-offset for (nonexistent) directory entry for the root
|
|
|
|
* dir in the root dir
|
|
|
|
*/
|
|
|
|
#define MSDOSFSROOT_OFS 0x1fffffff
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The fat cache structure. fc_fsrcn is the filesystem relative cluster
|
|
|
|
* number that corresponds to the file relative cluster number in this
|
|
|
|
* structure (fc_frcn).
|
|
|
|
*/
|
|
|
|
struct fatcache {
|
1997-10-17 15:23:29 +04:00
|
|
|
u_long fc_frcn; /* file relative cluster number */
|
|
|
|
u_long fc_fsrcn; /* filesystem relative cluster number */
|
1993-08-13 15:35:13 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The fat entry cache as it stands helps make extending files a "quick"
|
|
|
|
* operation by avoiding having to scan the fat to discover the last
|
|
|
|
* cluster of the file. The cache also helps sequential reads by
|
|
|
|
* remembering the last cluster read from the file. This also prevents us
|
|
|
|
* from having to rescan the fat to find the next cluster to read. This
|
|
|
|
* cache is probably pretty worthless if a file is opened by multiple
|
|
|
|
* processes.
|
|
|
|
*/
|
|
|
|
#define FC_SIZE 2 /* number of entries in the cache */
|
|
|
|
#define FC_LASTMAP 0 /* entry the last call to pcbmap() resolved
|
|
|
|
* to */
|
|
|
|
#define FC_LASTFC 1 /* entry for the last cluster in the file */
|
|
|
|
|
1997-10-17 15:23:29 +04:00
|
|
|
#define FCE_EMPTY 0xffffffff /* doesn't represent an actual cluster # */
|
1993-08-13 15:35:13 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set a slot in the fat cache.
|
|
|
|
*/
|
|
|
|
#define fc_setcache(dep, slot, frcn, fsrcn) \
|
|
|
|
(dep)->de_fc[slot].fc_frcn = frcn; \
|
|
|
|
(dep)->de_fc[slot].fc_fsrcn = fsrcn;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the in memory variant of a dos directory entry. It is usually
|
|
|
|
* contained within a vnode.
|
|
|
|
*/
|
|
|
|
struct denode {
|
a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps. this is
required now, since I've removed the globals that expose the address range.
pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
no longer any need to special-case it.
- eliminate struct uvm_vnode by moving its fields into struct vnode.
- rewrite the pageout path. the pager is now responsible for handling the
high-level requests instead of only getting control after a bunch of work
has already been done on its behalf. this will allow us to UBCify LFS,
which needs tighter control over its pages than other filesystems do.
writing a page to disk no longer requires making it read-only, which
allows us to write wired pages without causing all kinds of havoc.
- use a new PG_PAGEOUT flag to indicate that a page should be freed
on behalf of the pagedaemon when it's unlocked. this flag is very similar
to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
pageout fails due to eg. an indirect-block buffer being locked.
this allows us to remove the "version" field from struct vm_page,
and together with shrinking "loan_count" from 32 bits to 16,
struct vm_page is now 4 bytes smaller.
- no longer use PG_RELEASED for swap-backed pages. if the page is busy
because it's being paged out, we can't release the swap slot to be
reallocated until that write is complete, but unlike with vnodes we
don't keep a count of in-progress writes so there's no good way to
know when the write is done. instead, when we need to free a busy
swap-backed page, just sleep until we can get it busy ourselves.
- implement a fast-path for extending writes which allows us to avoid
zeroing new pages. this substantially reduces cpu usage.
- encapsulate the data used by the genfs code in a struct genfs_node,
which must be the first element of the filesystem-specific vnode data
for filesystems which use genfs_{get,put}pages().
- eliminate many of the UVM pagerops, since they aren't needed anymore
now that the pager "put" operation is a higher-level operation.
- enhance the genfs code to allow NFS to use the genfs_{get,put}pages
instead of a modified copy.
- clean up struct vnode by removing all the fields that used to be used by
the vfs_cluster.c code (which we don't use anymore with UBC).
- remove kmem_object and mb_object since they were useless.
instead of allocating pages to these objects, we now just allocate
pages with no object. such pages are mapped in the kernel until they
are freed, so we can use the mapping to find the page to free it.
this allows us to remove splvm() protection in several places.
The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
|
|
|
struct genfs_node de_gnode;
|
2001-09-15 20:12:54 +04:00
|
|
|
LIST_ENTRY(denode) de_hash;
|
1993-08-13 15:35:13 +04:00
|
|
|
struct vnode *de_vnode; /* addr of vnode we are part of */
|
|
|
|
struct vnode *de_devvp; /* vnode of blk dev we live on */
|
|
|
|
u_long de_flag; /* flag bits */
|
|
|
|
dev_t de_dev; /* device where direntry lives */
|
|
|
|
u_long de_dirclust; /* cluster of the directory file containing this entry */
|
1995-10-15 18:34:19 +03:00
|
|
|
u_long de_diroffset; /* offset of this entry in the directory cluster */
|
1994-07-17 01:32:06 +04:00
|
|
|
u_long de_fndoffset; /* offset of found dir entry */
|
1995-10-15 18:34:19 +03:00
|
|
|
int de_fndcnt; /* number of slots before de_fndoffset */
|
1993-08-13 15:35:13 +04:00
|
|
|
long de_refcnt; /* reference count */
|
|
|
|
struct msdosfsmount *de_pmp; /* addr of our mount struct */
|
|
|
|
struct lockf *de_lockf; /* byte level lock list */
|
1995-10-15 18:34:19 +03:00
|
|
|
u_char de_Name[12]; /* name, from DOS directory entry */
|
1994-03-03 03:51:30 +03:00
|
|
|
u_char de_Attributes; /* attributes, from directory entry */
|
1997-10-17 15:23:29 +04:00
|
|
|
u_char de_CHun; /* Hundredth of second of CTime*/
|
1995-11-29 18:08:32 +03:00
|
|
|
u_short de_CTime; /* creation time */
|
|
|
|
u_short de_CDate; /* creation date */
|
|
|
|
u_short de_ADate; /* access date */
|
|
|
|
u_short de_MTime; /* modification time */
|
|
|
|
u_short de_MDate; /* modification date */
|
1997-10-17 15:23:29 +04:00
|
|
|
u_long de_StartCluster; /* starting cluster of file */
|
1994-03-03 03:51:30 +03:00
|
|
|
u_long de_FileSize; /* size of file in bytes */
|
1993-08-13 15:35:13 +04:00
|
|
|
struct fatcache de_fc[FC_SIZE]; /* fat cache */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Values for the de_flag field of the denode.
|
|
|
|
*/
|
1998-03-01 05:20:01 +03:00
|
|
|
#define DE_UPDATE 0x0001 /* Modification time update request. */
|
|
|
|
#define DE_CREATE 0x0002 /* Creation time update */
|
|
|
|
#define DE_ACCESS 0x0004 /* Access time update */
|
|
|
|
#define DE_MODIFIED 0x0008 /* Denode has been modified. */
|
|
|
|
#define DE_RENAME 0x0010 /* Denode is in the process of being renamed */
|
1993-08-13 15:35:13 +04:00
|
|
|
|
1995-10-15 18:34:19 +03:00
|
|
|
/*
|
|
|
|
* Maximum filename length in Win95
|
|
|
|
* Note: Must be < sizeof(dirent.d_name)
|
|
|
|
*/
|
|
|
|
#define WIN_MAXLEN 255
|
|
|
|
|
1993-08-13 15:35:13 +04:00
|
|
|
/*
|
1994-03-03 03:51:30 +03:00
|
|
|
* Transfer directory entries between internal and external form.
|
|
|
|
* dep is a struct denode * (internal form),
|
|
|
|
* dp is a struct direntry * (external form).
|
1993-08-13 15:35:13 +04:00
|
|
|
*/
|
1997-10-17 15:23:29 +04:00
|
|
|
#define DE_INTERNALIZE32(dep, dp) \
|
|
|
|
((dep)->de_StartCluster |= getushort((dp)->deHighClust) << 16)
|
|
|
|
#define DE_INTERNALIZE(dep, dp) \
|
1998-08-10 00:51:08 +04:00
|
|
|
(memcpy((dep)->de_Name, (dp)->deName, 11), \
|
1994-03-03 03:51:30 +03:00
|
|
|
(dep)->de_Attributes = (dp)->deAttributes, \
|
1997-10-17 15:23:29 +04:00
|
|
|
(dep)->de_CHun = (dp)->deCHundredth, \
|
1995-11-29 18:08:32 +03:00
|
|
|
(dep)->de_CTime = getushort((dp)->deCTime), \
|
|
|
|
(dep)->de_CDate = getushort((dp)->deCDate), \
|
|
|
|
(dep)->de_ADate = getushort((dp)->deADate), \
|
|
|
|
(dep)->de_MTime = getushort((dp)->deMTime), \
|
|
|
|
(dep)->de_MDate = getushort((dp)->deMDate), \
|
1994-03-03 03:51:30 +03:00
|
|
|
(dep)->de_StartCluster = getushort((dp)->deStartCluster), \
|
1997-10-17 15:23:29 +04:00
|
|
|
(dep)->de_FileSize = getulong((dp)->deFileSize), \
|
|
|
|
(FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0))
|
1994-03-03 03:51:30 +03:00
|
|
|
|
1997-10-17 15:23:29 +04:00
|
|
|
#define DE_EXTERNALIZE32(dp, dep) \
|
|
|
|
putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)
|
1994-03-03 03:51:30 +03:00
|
|
|
#define DE_EXTERNALIZE(dp, dep) \
|
1998-08-10 00:51:08 +04:00
|
|
|
(memcpy((dp)->deName, (dep)->de_Name, 11), \
|
1994-03-03 03:51:30 +03:00
|
|
|
(dp)->deAttributes = (dep)->de_Attributes, \
|
1997-10-17 15:23:29 +04:00
|
|
|
(dp)->deCHundredth = (dep)->de_CHun, \
|
1995-11-29 18:08:32 +03:00
|
|
|
putushort((dp)->deCTime, (dep)->de_CTime), \
|
|
|
|
putushort((dp)->deCDate, (dep)->de_CDate), \
|
|
|
|
putushort((dp)->deADate, (dep)->de_ADate), \
|
|
|
|
putushort((dp)->deMTime, (dep)->de_MTime), \
|
|
|
|
putushort((dp)->deMDate, (dep)->de_MDate), \
|
1994-03-03 03:51:30 +03:00
|
|
|
putushort((dp)->deStartCluster, (dep)->de_StartCluster), \
|
1997-10-17 15:23:29 +04:00
|
|
|
putulong((dp)->deFileSize, \
|
|
|
|
((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
|
|
|
|
(FAT32((dep)->de_pmp) ? DE_EXTERNALIZE32((dp), (dep)) : 0))
|
1994-03-03 03:51:30 +03:00
|
|
|
|
1993-08-13 15:35:13 +04:00
|
|
|
#define de_forw de_chain[0]
|
|
|
|
#define de_back de_chain[1]
|
|
|
|
|
1995-03-30 01:57:43 +04:00
|
|
|
#ifdef _KERNEL
|
1993-08-13 15:35:13 +04:00
|
|
|
|
|
|
|
#define VTODE(vp) ((struct denode *)(vp)->v_data)
|
|
|
|
#define DETOV(de) ((de)->de_vnode)
|
|
|
|
|
1996-09-02 03:47:48 +04:00
|
|
|
#define DETIMES(dep, acc, mod, cre) \
|
1995-11-29 18:08:32 +03:00
|
|
|
if ((dep)->de_flag & (DE_UPDATE | DE_CREATE | DE_ACCESS)) { \
|
1996-09-02 03:47:48 +04:00
|
|
|
(dep)->de_flag |= DE_MODIFIED; \
|
|
|
|
if ((dep)->de_flag & DE_UPDATE) { \
|
1997-10-17 15:23:29 +04:00
|
|
|
unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, NULL); \
|
1996-09-02 03:47:48 +04:00
|
|
|
(dep)->de_Attributes |= ATTR_ARCHIVE; \
|
|
|
|
} \
|
|
|
|
if (!((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95)) { \
|
|
|
|
if ((dep)->de_flag & DE_ACCESS) \
|
1997-10-17 15:23:29 +04:00
|
|
|
unix2dostime((acc), &(dep)->de_ADate, NULL, NULL); \
|
1996-09-02 03:47:48 +04:00
|
|
|
if ((dep)->de_flag & DE_CREATE) \
|
1997-10-17 15:23:29 +04:00
|
|
|
unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, &(dep)->de_CHun); \
|
1995-06-02 19:33:22 +04:00
|
|
|
} \
|
1995-11-29 18:08:32 +03:00
|
|
|
(dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
|
1993-08-13 15:35:13 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
1995-01-04 09:32:19 +03:00
|
|
|
* This overlays the fid structure (see mount.h)
|
1993-08-13 15:35:13 +04:00
|
|
|
*/
|
|
|
|
struct defid {
|
1999-07-27 09:39:10 +04:00
|
|
|
u_int16_t defid_len; /* length of structure */
|
|
|
|
u_int16_t defid_pad; /* force 4-byte alignment */
|
1993-08-13 15:35:13 +04:00
|
|
|
|
1999-07-27 09:39:10 +04:00
|
|
|
u_int32_t defid_dirclust; /* cluster this dir entry came from */
|
|
|
|
u_int32_t defid_dirofs; /* offset of entry within the cluster */
|
1996-02-09 22:13:39 +03:00
|
|
|
#if 0
|
1999-07-27 09:39:10 +04:00
|
|
|
u_int32_t defid_gen; /* generation number */
|
1996-02-09 22:13:39 +03:00
|
|
|
#endif
|
1993-08-13 15:35:13 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Prototypes for MSDOSFS vnode operations
|
|
|
|
*/
|
1996-02-09 22:13:39 +03:00
|
|
|
int msdosfs_lookup __P((void *));
|
|
|
|
int msdosfs_create __P((void *));
|
|
|
|
int msdosfs_mknod __P((void *));
|
|
|
|
int msdosfs_open __P((void *));
|
|
|
|
int msdosfs_close __P((void *));
|
|
|
|
int msdosfs_access __P((void *));
|
|
|
|
int msdosfs_getattr __P((void *));
|
|
|
|
int msdosfs_setattr __P((void *));
|
|
|
|
int msdosfs_read __P((void *));
|
|
|
|
int msdosfs_write __P((void *));
|
1998-06-26 02:20:39 +04:00
|
|
|
#define msdosfs_lease_check genfs_lease_check
|
1998-08-10 12:11:10 +04:00
|
|
|
#define msdosfs_ioctl genfs_enoioctl
|
1996-09-07 16:40:22 +04:00
|
|
|
#define msdosfs_poll genfs_poll
|
1998-03-01 05:20:01 +03:00
|
|
|
#define msdosfs_revoke genfs_revoke
|
2001-05-28 06:50:51 +04:00
|
|
|
#define msdosfs_mmap genfs_mmap
|
1996-09-02 03:47:48 +04:00
|
|
|
#define msdosfs_fsync genfs_fsync
|
1997-04-12 01:52:00 +04:00
|
|
|
#define msdosfs_seek genfs_seek
|
1996-02-09 22:13:39 +03:00
|
|
|
int msdosfs_remove __P((void *));
|
|
|
|
int msdosfs_link __P((void *));
|
|
|
|
int msdosfs_rename __P((void *));
|
|
|
|
int msdosfs_mkdir __P((void *));
|
|
|
|
int msdosfs_rmdir __P((void *));
|
|
|
|
int msdosfs_symlink __P((void *));
|
|
|
|
int msdosfs_readdir __P((void *));
|
|
|
|
int msdosfs_readlink __P((void *));
|
1996-09-02 03:47:48 +04:00
|
|
|
#define msdosfs_abortop genfs_abortop
|
1996-02-09 22:13:39 +03:00
|
|
|
int msdosfs_inactive __P((void *));
|
|
|
|
int msdosfs_reclaim __P((void *));
|
|
|
|
int msdosfs_bmap __P((void *));
|
|
|
|
int msdosfs_strategy __P((void *));
|
|
|
|
int msdosfs_print __P((void *));
|
|
|
|
int msdosfs_advlock __P((void *));
|
|
|
|
int msdosfs_reallocblks __P((void *));
|
|
|
|
int msdosfs_pathconf __P((void *));
|
1996-09-02 03:47:48 +04:00
|
|
|
int msdosfs_update __P((void *));
|
1993-08-13 15:35:13 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal service routine prototypes.
|
|
|
|
*/
|
1995-10-15 18:34:19 +03:00
|
|
|
int createde __P((struct denode *, struct denode *, struct denode **, struct componentname *));
|
1994-09-28 14:31:23 +03:00
|
|
|
int deextend __P((struct denode *, u_long, struct ucred *));
|
1995-11-05 21:47:48 +03:00
|
|
|
int deget __P((struct msdosfsmount *, u_long, u_long, struct denode **));
|
1994-09-28 14:31:23 +03:00
|
|
|
int detrunc __P((struct denode *, u_long, int, struct ucred *, struct proc *));
|
1995-06-02 19:33:22 +04:00
|
|
|
int deupdat __P((struct denode *, int));
|
1994-09-28 14:31:23 +03:00
|
|
|
int doscheckpath __P((struct denode *, struct denode *));
|
|
|
|
int dosdirempty __P((struct denode *));
|
|
|
|
int readde __P((struct denode *, struct buf **, struct direntry **));
|
|
|
|
int readep __P((struct msdosfsmount *, u_long, u_long, struct buf **, struct direntry **));
|
|
|
|
void reinsert __P((struct denode *));
|
|
|
|
int removede __P((struct denode *, struct denode *));
|
1995-10-15 18:34:19 +03:00
|
|
|
int uniqdosname __P((struct denode *, struct componentname *, u_char *));
|
1996-02-09 22:13:39 +03:00
|
|
|
int findwin95 __P((struct denode *));
|
a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps. this is
required now, since I've removed the globals that expose the address range.
pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
no longer any need to special-case it.
- eliminate struct uvm_vnode by moving its fields into struct vnode.
- rewrite the pageout path. the pager is now responsible for handling the
high-level requests instead of only getting control after a bunch of work
has already been done on its behalf. this will allow us to UBCify LFS,
which needs tighter control over its pages than other filesystems do.
writing a page to disk no longer requires making it read-only, which
allows us to write wired pages without causing all kinds of havoc.
- use a new PG_PAGEOUT flag to indicate that a page should be freed
on behalf of the pagedaemon when it's unlocked. this flag is very similar
to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
pageout fails due to eg. an indirect-block buffer being locked.
this allows us to remove the "version" field from struct vm_page,
and together with shrinking "loan_count" from 32 bits to 16,
struct vm_page is now 4 bytes smaller.
- no longer use PG_RELEASED for swap-backed pages. if the page is busy
because it's being paged out, we can't release the swap slot to be
reallocated until that write is complete, but unlike with vnodes we
don't keep a count of in-progress writes so there's no good way to
know when the write is done. instead, when we need to free a busy
swap-backed page, just sleep until we can get it busy ourselves.
- implement a fast-path for extending writes which allows us to avoid
zeroing new pages. this substantially reduces cpu usage.
- encapsulate the data used by the genfs code in a struct genfs_node,
which must be the first element of the filesystem-specific vnode data
for filesystems which use genfs_{get,put}pages().
- eliminate many of the UVM pagerops, since they aren't needed anymore
now that the pager "put" operation is a higher-level operation.
- enhance the genfs code to allow NFS to use the genfs_{get,put}pages
instead of a modified copy.
- clean up struct vnode by removing all the fields that used to be used by
the vfs_cluster.c code (which we don't use anymore with UBC).
- remove kmem_object and mb_object since they were useless.
instead of allocating pages to these objects, we now just allocate
pages with no object. such pages are mapped in the kernel until they
are freed, so we can use the mapping to find the page to free it.
this allows us to remove splvm() protection in several places.
The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-16 00:36:31 +04:00
|
|
|
int msdosfs_gop_alloc __P((struct vnode *, off_t, off_t, int, struct ucred *));
|
1995-03-30 01:57:43 +04:00
|
|
|
#endif /* _KERNEL */
|