diff options
author | des <des@FreeBSD.org> | 2007-03-12 12:16:52 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2007-03-12 12:16:52 +0000 |
commit | 3d3e50beaf534ec30b151614f684eccd85ef5782 (patch) | |
tree | bf90ea580c06ca59d01616d80a1764d6c48580d1 /sys/compat | |
parent | a3cbd559395af5e36b0ce853ee5218ddc911ff25 (diff) | |
download | FreeBSD-src-3d3e50beaf534ec30b151614f684eccd85ef5782.zip FreeBSD-src-3d3e50beaf534ec30b151614f684eccd85ef5782.tar.gz |
Add a pn_destroy field to pfs_node. This field points to a destructor
function which is called from pfs_destroy() before the node is reclaimed.
Modify pfs_create_{dir,file,link}() to accept a pointer to a destructor
function in addition to the usual attr / fill / vis pointers.
This breaks both the programming and binary interfaces between pseudofs
and its consumers. It is believed that there are no pseudofs consumers
outside the source tree, so that the impact of this change is minimal.
Submitted by: Aniruddha Bohra <bohra@cs.rutgers.edu>
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 72 | ||||
-rw-r--r-- | sys/compat/linsysfs/linsysfs.c | 18 |
2 files changed, 45 insertions, 45 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index f1640de..318689f 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1172,83 +1172,83 @@ linprocfs_init(PFS_INIT_ARGS) /* /proc/... */ pfs_create_file(root, "cmdline", &linprocfs_docmdline, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "cpuinfo", &linprocfs_docpuinfo, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "devices", &linprocfs_dodevices, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "loadavg", &linprocfs_doloadavg, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "meminfo", &linprocfs_domeminfo, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); #if 0 pfs_create_file(root, "modules", &linprocfs_domodules, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); #endif pfs_create_file(root, "mounts", &linprocfs_domtab, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "mtab", &linprocfs_domtab, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_link(root, "self", &procfs_docurproc, - NULL, NULL, 0); + NULL, NULL, NULL, 0); pfs_create_file(root, "stat", &linprocfs_dostat, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "uptime", &linprocfs_douptime, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "version", &linprocfs_doversion, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); /* /proc/net/... */ - dir = pfs_create_dir(root, "net", NULL, NULL, 0); + dir = pfs_create_dir(root, "net", NULL, NULL, NULL, 0); pfs_create_file(dir, "dev", &linprocfs_donetdev, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); /* /proc/<pid>/... */ - dir = pfs_create_dir(root, "pid", NULL, NULL, PFS_PROCDEP); + dir = pfs_create_dir(root, "pid", NULL, NULL, NULL, PFS_PROCDEP); pfs_create_file(dir, "cmdline", &linprocfs_doproccmdline, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_link(dir, "cwd", &linprocfs_doproccwd, - NULL, NULL, 0); + NULL, NULL, NULL, 0); pfs_create_file(dir, "environ", &linprocfs_doprocenviron, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_link(dir, "exe", &procfs_doprocfile, - NULL, &procfs_notsystem, 0); + NULL, &procfs_notsystem, NULL, 0); pfs_create_file(dir, "maps", &linprocfs_doprocmaps, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "mem", &procfs_doprocmem, - &procfs_attr, &procfs_candebug, PFS_RDWR|PFS_RAW); + &procfs_attr, &procfs_candebug, NULL, PFS_RDWR|PFS_RAW); pfs_create_link(dir, "root", &linprocfs_doprocroot, - NULL, NULL, 0); + NULL, NULL, NULL, 0); pfs_create_file(dir, "stat", &linprocfs_doprocstat, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "statm", &linprocfs_doprocstatm, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "status", &linprocfs_doprocstatus, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); /* /proc/scsi/... */ - dir = pfs_create_dir(root, "scsi", NULL, NULL, 0); + dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); pfs_create_file(dir, "device_info", &linprocfs_doscsidevinfo, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "scsi", &linprocfs_doscsiscsi, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); /* /proc/sys/... */ - dir = pfs_create_dir(root, "sys", NULL, NULL, 0); + dir = pfs_create_dir(root, "sys", NULL, NULL, NULL, 0); /* /proc/sys/kernel/... */ - dir = pfs_create_dir(dir, "kernel", NULL, NULL, 0); + dir = pfs_create_dir(dir, "kernel", NULL, NULL, NULL, 0); pfs_create_file(dir, "osrelease", &linprocfs_doosrelease, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "ostype", &linprocfs_doostype, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "version", &linprocfs_doosbuild, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "msgmni", &linprocfs_domsgmni, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "pid_max", &linprocfs_dopid_max, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "sem", &linprocfs_dosem, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); return (0); } diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c index cce49f7..2247d29 100644 --- a/sys/compat/linsysfs/linsysfs.c +++ b/sys/compat/linsysfs/linsysfs.c @@ -175,7 +175,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, char strcat(new_path, "/"); strcat(new_path, device); dir = pfs_create_dir(dir, device, - NULL, NULL, 0); + NULL, NULL, NULL, 0); if (dinfo->cfg.baseclass == PCIC_STORAGE) { /* DJA only make this if needed */ @@ -183,7 +183,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, char strcat(new_path, "/"); strcat(new_path, host); sub_dir = pfs_create_dir(dir, - host, NULL, NULL, 0); + host, NULL, NULL, NULL, 0); scsi_host = malloc(sizeof( struct scsi_host_queue), M_DEVBUF, M_NOWAIT); @@ -196,13 +196,13 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, char scsi_host->name = "unknown"; sub_dir = pfs_create_dir(scsi, host, - NULL, NULL, 0); + NULL, NULL, NULL, 0); pfs_create_link(sub_dir, "device", &linsysfs_link_scsi_host, - NULL, NULL, 0); + NULL, NULL, NULL, 0); pfs_create_file(sub_dir, "proc_name", &linsysfs_scsiname, - NULL, NULL, PFS_RD); + NULL, NULL, NULL, PFS_RD); scsi_host->name = linux_driver_get_name_dev(dev); TAILQ_INSERT_TAIL(&scsi_host_q, @@ -243,14 +243,14 @@ linsysfs_init(PFS_INIT_ARGS) root = pi->pi_root; /* /sys/class/... */ - scsi = pfs_create_dir(root, "class", NULL, NULL, 0); - scsi = pfs_create_dir(scsi, "scsi_host", NULL, NULL, 0); + scsi = pfs_create_dir(root, "class", NULL, NULL, NULL, 0); + scsi = pfs_create_dir(scsi, "scsi_host", NULL, NULL, NULL, 0); /* /sys/device */ - dir = pfs_create_dir(root, "devices", NULL, NULL, 0); + dir = pfs_create_dir(root, "devices", NULL, NULL, NULL, 0); /* /sys/device/pci0000:00 */ - pci = pfs_create_dir(dir, "pci0000:00", NULL, NULL, 0); + pci = pfs_create_dir(dir, "pci0000:00", NULL, NULL, NULL, 0); devclass = devclass_find("root"); if (devclass == NULL) { |