MFC: Add NO_FFS_SNAPSHOT kernel option.

This commit is contained in:
tegge 2006-05-13 23:40:44 +00:00
parent b536883ca3
commit 2b650394a3
2 changed files with 63 additions and 0 deletions

View File

@ -212,6 +212,11 @@ UDF_ICONV opt_dontuse.h
# otherwise a STUB module will be compiled in.
SOFTUPDATES opt_ffs.h
# On small, embedded systems, it can be useful to turn off support for
# snapshots. It saves about 30-40k for a feature that would be lightly
# used, if it is used at all.
NO_FFS_SNAPSHOT opt_ffs.h
# Enabling this option turns on support for Access Control Lists in UFS,
# which can be used to support high security configurations. Depends on
# UFS_EXTATTR.

View File

@ -66,6 +66,62 @@ __FBSDID("$FreeBSD$");
#define KERNCRED thread0.td_ucred
#define DEBUG 1
#include "opt_ffs.h"
#ifdef NO_FFS_SNAPSHOT
int
ffs_snapshot(mp, snapfile)
struct mount *mp;
char *snapfile;
{
return (EINVAL);
}
int
ffs_snapblkfree(fs, devvp, bno, size, inum)
struct fs *fs;
struct vnode *devvp;
ufs2_daddr_t bno;
long size;
ino_t inum;
{
return (EINVAL);
}
void
ffs_snapremove(vp)
struct vnode *vp;
{
}
void
ffs_snapshot_mount(mp)
struct mount *mp;
{
}
void
ffs_snapshot_unmount(mp)
struct mount *mp;
{
}
void
ffs_snapgone(ip)
struct inode *ip;
{
}
int
ffs_copyonwrite(devvp, bp)
struct vnode *devvp;
struct buf *bp;
{
return (EINVAL);
}
#else
TAILQ_HEAD(snaphead, inode);
struct snapdata {
@ -2195,6 +2251,7 @@ readblock(vp, bp, lbn)
return (bp->b_error);
}
/*
* Process file deletes that were deferred by ufs_inactive() due to
* the file system being suspended.
@ -2259,3 +2316,4 @@ process_deferred_inactive(struct mount *mp)
MNT_IUNLOCK(mp);
vn_finished_secondary_write(mp);
}
#endif