You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
ia64: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
c293819a3c
commit
e23637681b
@@ -550,11 +550,12 @@ static int __init sn2_ptc_init(void)
|
||||
if (!ia64_platform_is("sn2"))
|
||||
return 0;
|
||||
|
||||
if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) {
|
||||
proc_sn2_ptc = proc_create(PTC_BASENAME, 0444,
|
||||
NULL, &proc_sn2_ptc_operations);
|
||||
if (!&proc_sn2_ptc_operations) {
|
||||
printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
|
||||
return -EINVAL;
|
||||
}
|
||||
proc_sn2_ptc->proc_fops = &proc_sn2_ptc_operations;
|
||||
spin_lock_init(&sn2_global_ptc_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -139,30 +139,21 @@ static const struct file_operations proc_sn_topo_fops = {
|
||||
void register_sn_procfs(void)
|
||||
{
|
||||
static struct proc_dir_entry *sgi_proc_dir = NULL;
|
||||
struct proc_dir_entry *pde;
|
||||
|
||||
BUG_ON(sgi_proc_dir != NULL);
|
||||
if (!(sgi_proc_dir = proc_mkdir("sgi_sn", NULL)))
|
||||
return;
|
||||
|
||||
pde = create_proc_entry("partition_id", 0444, sgi_proc_dir);
|
||||
if (pde)
|
||||
pde->proc_fops = &proc_partition_id_fops;
|
||||
pde = create_proc_entry("system_serial_number", 0444, sgi_proc_dir);
|
||||
if (pde)
|
||||
pde->proc_fops = &proc_system_sn_fops;
|
||||
pde = create_proc_entry("licenseID", 0444, sgi_proc_dir);
|
||||
if (pde)
|
||||
pde->proc_fops = &proc_license_id_fops;
|
||||
pde = create_proc_entry("sn_force_interrupt", 0644, sgi_proc_dir);
|
||||
if (pde)
|
||||
pde->proc_fops = &proc_sn_force_intr_fops;
|
||||
pde = create_proc_entry("coherence_id", 0444, sgi_proc_dir);
|
||||
if (pde)
|
||||
pde->proc_fops = &proc_coherence_id_fops;
|
||||
pde = create_proc_entry("sn_topology", 0444, sgi_proc_dir);
|
||||
if (pde)
|
||||
pde->proc_fops = &proc_sn_topo_fops;
|
||||
proc_create("partition_id", 0444, sgi_proc_dir,
|
||||
&proc_partition_id_fops);
|
||||
proc_create("system_serial_number", 0444, sgi_proc_dir,
|
||||
&proc_system_sn_fops);
|
||||
proc_create("licenseID", 0444, sgi_proc_dir, &proc_license_id_fops);
|
||||
proc_create("sn_force_interrupt", 0644, sgi_proc_dir,
|
||||
&proc_sn_force_intr_fops);
|
||||
proc_create("coherence_id", 0444, sgi_proc_dir,
|
||||
&proc_coherence_id_fops);
|
||||
proc_create("sn_topology", 0444, sgi_proc_dir, &proc_sn_topo_fops);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
Reference in New Issue
Block a user