Skip to content

Commit 47af61f

Browse files
committed
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/[email protected]/ Signed-off-by: Kees Cook <[email protected]>
1 parent cab12fd commit 47af61f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

fs/pstore/inode.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
#define PSTORE_NAMELEN 64
3131

32-
static DEFINE_SPINLOCK(allpstore_lock);
33-
static LIST_HEAD(allpstore);
32+
static DEFINE_SPINLOCK(records_list_lock);
33+
static LIST_HEAD(records_list);
3434

3535
struct pstore_private {
3636
struct list_head list;
@@ -196,9 +196,9 @@ static void pstore_evict_inode(struct inode *inode)
196196

197197
clear_inode(inode);
198198
if (p) {
199-
spin_lock_irqsave(&allpstore_lock, flags);
199+
spin_lock_irqsave(&records_list_lock, flags);
200200
list_del(&p->list);
201-
spin_unlock_irqrestore(&allpstore_lock, flags);
201+
spin_unlock_irqrestore(&records_list_lock, flags);
202202
free_pstore_private(p);
203203
}
204204
}
@@ -302,16 +302,16 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
302302

303303
WARN_ON(!inode_is_locked(d_inode(root)));
304304

305-
spin_lock_irqsave(&allpstore_lock, flags);
306-
list_for_each_entry(pos, &allpstore, list) {
305+
spin_lock_irqsave(&records_list_lock, flags);
306+
list_for_each_entry(pos, &records_list, list) {
307307
if (pos->record->type == record->type &&
308308
pos->record->id == record->id &&
309309
pos->record->psi == record->psi) {
310310
rc = -EEXIST;
311311
break;
312312
}
313313
}
314-
spin_unlock_irqrestore(&allpstore_lock, flags);
314+
spin_unlock_irqrestore(&records_list_lock, flags);
315315
if (rc)
316316
return rc;
317317

@@ -343,9 +343,9 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
343343

344344
d_add(dentry, inode);
345345

346-
spin_lock_irqsave(&allpstore_lock, flags);
347-
list_add(&private->list, &allpstore);
348-
spin_unlock_irqrestore(&allpstore_lock, flags);
346+
spin_lock_irqsave(&records_list_lock, flags);
347+
list_add(&private->list, &records_list);
348+
spin_unlock_irqrestore(&records_list_lock, flags);
349349

350350
return 0;
351351

0 commit comments

Comments
 (0)