Changeset View
Changeset View
Standalone View
Standalone View
head/sys/ufs/ffs/ffs_softdep.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 13,765 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* If requested, try removing inode or removal dependencies. | * If requested, try removing inode or removal dependencies. | ||||
*/ | */ | ||||
static void | static void | ||||
check_clear_deps(mp) | check_clear_deps(mp) | ||||
struct mount *mp; | struct mount *mp; | ||||
{ | { | ||||
struct ufsmount *ump; | struct ufsmount *ump; | ||||
bool suj_susp; | |||||
/* | /* | ||||
* Tell the lower layers that any TRIM or WRITE transactions | * Tell the lower layers that any TRIM or WRITE transactions that have | ||||
* that have been delayed for performance reasons should | * been delayed for performance reasons should proceed to help alleviate | ||||
* proceed to help alleviate the shortage faster. | * the shortage faster. The race between checking req_* and the softdep | ||||
* mutex (lk) is fine since this is an advisory operation that at most | |||||
* causes deferred work to be done sooner. | |||||
*/ | */ | ||||
ump = VFSTOUFS(mp); | ump = VFSTOUFS(mp); | ||||
suj_susp = MOUNTEDSUJ(mp) && ump->softdep_jblocks->jb_suspended; | |||||
if (req_clear_remove || req_clear_inodedeps || suj_susp) { | |||||
FREE_LOCK(ump); | FREE_LOCK(ump); | ||||
softdep_send_speedup(ump, 0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE); | softdep_send_speedup(ump, 0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE); | ||||
ACQUIRE_LOCK(ump); | ACQUIRE_LOCK(ump); | ||||
} | |||||
/* | /* | ||||
* If we are suspended, it may be because of our using | * If we are suspended, it may be because of our using | ||||
* too many inodedeps, so help clear them out. | * too many inodedeps, so help clear them out. | ||||
*/ | */ | ||||
if (MOUNTEDSUJ(mp) && VFSTOUFS(mp)->softdep_jblocks->jb_suspended) | if (suj_susp) | ||||
clear_inodedeps(mp); | clear_inodedeps(mp); | ||||
/* | /* | ||||
* General requests for cleanup of backed up dependencies | * General requests for cleanup of backed up dependencies | ||||
*/ | */ | ||||
ACQUIRE_GBLLOCK(&lk); | ACQUIRE_GBLLOCK(&lk); | ||||
if (req_clear_inodedeps) { | if (req_clear_inodedeps) { | ||||
req_clear_inodedeps -= 1; | req_clear_inodedeps -= 1; | ||||
▲ Show 20 Lines • Show All 940 Lines • Show Last 20 Lines |