summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2000-07-04 04:58:34 +0000
committermckusick <mckusick@FreeBSD.org>2000-07-04 04:58:34 +0000
commit5e6b00a0a70c6df314384e61f6db7131308e1add (patch)
tree63aeae2ac4bafff3e2991ec769442667a718abfe /sys
parent2f0e9591fa0ef8bf1039608fd618c45ca89f9ec5 (diff)
downloadFreeBSD-src-5e6b00a0a70c6df314384e61f6db7131308e1add.zip
FreeBSD-src-5e6b00a0a70c6df314384e61f6db7131308e1add.tar.gz
Get userland visible flags added for snapshots to give a few days
advance preparation for them to get migrated into place so that subsequent changes in utilities will not fail to compile for lack of up-to-date header files in /usr/include.
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/mount.h17
-rw-r--r--sys/sys/stat.h1
-rw-r--r--sys/ufs/ffs/fs.h27
3 files changed, 40 insertions, 5 deletions
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 5e3484e..5f963c2 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -114,6 +114,7 @@ struct mount {
struct vnode *mnt_syncer; /* syncer vnode */
struct vnodelst mnt_vnodelist; /* list of vnodes this mount */
struct lock mnt_lock; /* mount structure lock */
+ int mnt_writeopcount; /* write syscalls in progress */
int mnt_flag; /* flags shared with user */
int mnt_kern_flag; /* kernel only flags */
int mnt_maxsymlinklen; /* max size of short symlink */
@@ -165,7 +166,6 @@ struct mount {
* Mask of flags that are visible to statfs()
* XXX I think that this could now become (~(MNT_CMDFLAGS))
* but the 'mount' program may need changing to handle this.
- * XXX MNT_EXPUBLIC is presently left out. I don't know why.
*/
#define MNT_VISFLAGMASK (MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC | \
MNT_NOSUID | MNT_NODEV | MNT_UNION | \
@@ -174,8 +174,7 @@ struct mount {
MNT_LOCAL | MNT_USER | MNT_QUOTA | \
MNT_ROOTFS | MNT_NOATIME | MNT_NOCLUSTERR| \
MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \
- MNT_IGNORE \
- /* | MNT_EXPUBLIC */)
+ MNT_IGNORE | MNT_EXPUBLIC | MNT_NOSYMFOLLOW)
/*
* External filesystem command modifier flags.
* Unmount can use the MNT_FORCE flag.
@@ -185,7 +184,15 @@ struct mount {
#define MNT_DELEXPORT 0x00020000 /* delete export host lists */
#define MNT_RELOAD 0x00040000 /* reload filesystem data */
#define MNT_FORCE 0x00080000 /* force unmount or readonly change */
-#define MNT_CMDFLAGS (MNT_UPDATE|MNT_DELEXPORT|MNT_RELOAD|MNT_FORCE)
+#define MNT_SNAPSHOT 0x01000000 /* snapshot the filesystem */
+#define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \
+ MNT_FORCE | MNT_SNAPSHOT)
+/*
+ * Still available
+ */
+#define MNT_SPARE1 0x02000000
+#define MNT_SPARE2 0x04000000
+#define MNT_SPARE3 0x08000000
/*
* Internal filesystem control flags stored in mnt_kern_flag.
*
@@ -196,6 +203,8 @@ struct mount {
#define MNTK_UNMOUNT 0x01000000 /* unmount in progress */
#define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */
#define MNTK_WANTRDWR 0x04000000 /* upgrade to read/write requested */
+#define MNTK_SUSPEND 0x08000000 /* request write suspension */
+#define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */
/*
* Sysctl CTL_VFS definitions.
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index 21cfbc4..15367b3 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -222,6 +222,7 @@ struct nstat {
#define SF_IMMUTABLE 0x00020000 /* file may not be changed */
#define SF_APPEND 0x00040000 /* writes to file may only append */
#define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */
+#define SF_SNAPSHOT 0x00200000 /* snapshot inode */
#ifdef _KERNEL
/*
diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h
index d93f2a7..5d76aee 100644
--- a/sys/ufs/ffs/fs.h
+++ b/sys/ufs/ffs/fs.h
@@ -139,6 +139,30 @@
#define DEFAULTOPT FS_OPTTIME
/*
+ * The maximum number of snapshot nodes that can be associated
+ * with each filesystem. This limit affects only the number of
+ * snapshot files that can be recorded within the superblock so
+ * that they can be found when the filesystem is mounted. However,
+ * maintaining too many will slow the filesystem performance, so
+ * having this limit is a good idea.
+ */
+#define FSMAXSNAP 20
+
+/*
+ * Used to identify special blocks in snapshots:
+ *
+ * BLK_NOCOPY - A block that was unallocated at the time the snapshot
+ * was taken, hence does not need to be copied when written.
+ * BLK_SNAP - A block held by another snapshot that is not needed by this
+ * snapshot. When the other snapshot is freed, the BLK_SNAP entries
+ * are converted to BLK_NOCOPY. These are needed to allow fsck to
+ * identify blocks that are in use by other snapshots (which are
+ * expunged from this snapshot).
+ */
+#define BLK_NOCOPY ((ufs_daddr_t)(1))
+#define BLK_SNAP ((ufs_daddr_t)(2))
+
+/*
* Per cylinder group information; summarized in blocks allocated
* from first cylinder group data blocks. These blocks have to be
* read in from fs_csaddr (size fs_cssize) in addition to the
@@ -230,7 +254,8 @@ struct fs {
int32_t *fs_maxcluster; /* max cluster in each cyl group */
int32_t fs_cpc; /* cyl per cycle in postbl */
int16_t fs_opostbl[16][8]; /* old rotation block list head */
- int32_t fs_sparecon[50]; /* reserved for future constants */
+ int32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */
+ int32_t fs_sparecon[30]; /* reserved for future constants */
int32_t fs_contigsumsize; /* size of cluster summary array */
int32_t fs_maxsymlinklen; /* max length of an internal symlink */
int32_t fs_inodefmt; /* format of on-disk inodes */
OpenPOWER on IntegriCloud