Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ffs/ffs_snapshot.c
Show First 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | restart: | ||||
/* | /* | ||||
* Copy all the cylinder group maps. Although the | * Copy all the cylinder group maps. Although the | ||||
* filesystem is still active, we hope that only a few | * filesystem is still active, we hope that only a few | ||||
* cylinder groups will change between now and when we | * cylinder groups will change between now and when we | ||||
* suspend operations. Thus, we will be able to quickly | * suspend operations. Thus, we will be able to quickly | ||||
* touch up the few cylinder groups that changed during | * touch up the few cylinder groups that changed during | ||||
* the suspension period. | * the suspension period. | ||||
*/ | */ | ||||
len = howmany(fs->fs_ncg, NBBY); | len = roundup2(howmany(fs->fs_ncg, NBBY), sizeof(int)); | ||||
space = malloc(len, M_DEVBUF, M_WAITOK|M_ZERO); | space = malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); | ||||
UFS_LOCK(ump); | UFS_LOCK(ump); | ||||
fs->fs_active = space; | fs->fs_active = space; | ||||
UFS_UNLOCK(ump); | UFS_UNLOCK(ump); | ||||
for (cg = 0; cg < fs->fs_ncg; cg++) { | for (cg = 0; cg < fs->fs_ncg; cg++) { | ||||
error = UFS_BALLOC(vp, lfragtosize(fs, cgtod(fs, cg)), | error = UFS_BALLOC(vp, lfragtosize(fs, cgtod(fs, cg)), | ||||
fs->fs_bsize, KERNCRED, 0, &nbp); | fs->fs_bsize, KERNCRED, 0, &nbp); | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
▲ Show 20 Lines • Show All 2,329 Lines • Show Last 20 Lines |