proc: Add proc_mkdir_data()
Add proc_mkdir_data() to allow procfs directories to be created that are annotated at the time of creation with private data rather than doing this post-creation. This means no access is then required to the proc_dir_entry struct to set this. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Neela Syam Kolli <megaraidlinux@lsi.com> cc: Jerry Chuang <jerry-chuang@realtek.com> cc: linux-scsi@vger.kernel.org cc: devel@driverdev.osuosl.org cc: linux-wireless@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -2818,12 +2818,12 @@ mega_create_proc_entry(int index, struct proc_dir_entry *parent)
|
||||
|
||||
sprintf(string, "hba%d", adapter->host->host_no);
|
||||
|
||||
dir = adapter->controller_proc_dir_entry = proc_mkdir(string, parent);
|
||||
dir = adapter->controller_proc_dir_entry =
|
||||
proc_mkdir_data(string, 0, parent, adapter);
|
||||
if(!dir) {
|
||||
printk(KERN_WARNING "\nmegaraid: proc_mkdir failed\n");
|
||||
return;
|
||||
}
|
||||
dir->data = adapter;
|
||||
|
||||
for (f = mega_proc_files; f->name; f++) {
|
||||
de = proc_create_data(f->name, S_IRUSR, dir, &mega_proc_fops,
|
||||
|
Reference in New Issue
Block a user