mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 01:04:08 +08:00
pstore: Rename "allpstore" to "records_list"
The name "allpstore" doesn't carry much meaning, so rename it to what it actually is: the list of all records present in the filesystem. The lock is also renamed accordingly. Link: https://lore.kernel.org/lkml/20200506152114.50375-5-keescook@chromium.org/ Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
cab12fd049
commit
47af61ffb1
@ -29,8 +29,8 @@
|
|||||||
|
|
||||||
#define PSTORE_NAMELEN 64
|
#define PSTORE_NAMELEN 64
|
||||||
|
|
||||||
static DEFINE_SPINLOCK(allpstore_lock);
|
static DEFINE_SPINLOCK(records_list_lock);
|
||||||
static LIST_HEAD(allpstore);
|
static LIST_HEAD(records_list);
|
||||||
|
|
||||||
struct pstore_private {
|
struct pstore_private {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
@ -196,9 +196,9 @@ static void pstore_evict_inode(struct inode *inode)
|
|||||||
|
|
||||||
clear_inode(inode);
|
clear_inode(inode);
|
||||||
if (p) {
|
if (p) {
|
||||||
spin_lock_irqsave(&allpstore_lock, flags);
|
spin_lock_irqsave(&records_list_lock, flags);
|
||||||
list_del(&p->list);
|
list_del(&p->list);
|
||||||
spin_unlock_irqrestore(&allpstore_lock, flags);
|
spin_unlock_irqrestore(&records_list_lock, flags);
|
||||||
free_pstore_private(p);
|
free_pstore_private(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,8 +302,8 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
|||||||
|
|
||||||
WARN_ON(!inode_is_locked(d_inode(root)));
|
WARN_ON(!inode_is_locked(d_inode(root)));
|
||||||
|
|
||||||
spin_lock_irqsave(&allpstore_lock, flags);
|
spin_lock_irqsave(&records_list_lock, flags);
|
||||||
list_for_each_entry(pos, &allpstore, list) {
|
list_for_each_entry(pos, &records_list, list) {
|
||||||
if (pos->record->type == record->type &&
|
if (pos->record->type == record->type &&
|
||||||
pos->record->id == record->id &&
|
pos->record->id == record->id &&
|
||||||
pos->record->psi == record->psi) {
|
pos->record->psi == record->psi) {
|
||||||
@ -311,7 +311,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&allpstore_lock, flags);
|
spin_unlock_irqrestore(&records_list_lock, flags);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
@ -343,9 +343,9 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
|||||||
|
|
||||||
d_add(dentry, inode);
|
d_add(dentry, inode);
|
||||||
|
|
||||||
spin_lock_irqsave(&allpstore_lock, flags);
|
spin_lock_irqsave(&records_list_lock, flags);
|
||||||
list_add(&private->list, &allpstore);
|
list_add(&private->list, &records_list);
|
||||||
spin_unlock_irqrestore(&allpstore_lock, flags);
|
spin_unlock_irqrestore(&records_list_lock, flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user