pstore: Replace arguments for erase() API

This removes the argument list for the erase() callback and replaces it
with a pointer to the backend record details to be removed.

Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
Kees Cook
2017-03-04 23:31:19 -08:00
parent 83f70f0769
commit a61072aae6
5 changed files with 31 additions and 46 deletions

View File

@@ -210,14 +210,12 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
if (err)
return err;
if (record->psi->erase) {
mutex_lock(&record->psi->read_mutex);
record->psi->erase(record->type, record->id, record->count,
d_inode(dentry)->i_ctime, record->psi);
mutex_unlock(&record->psi->read_mutex);
} else {
if (!record->psi->erase)
return -EPERM;
}
mutex_lock(&record->psi->read_mutex);
record->psi->erase(record);
mutex_unlock(&record->psi->read_mutex);
return simple_unlink(dir, dentry);
}