Sorry, does anyone know what "/proc" were replaced with? How does ps aux and similar will work?
Phoronix: Linux 2.6.38-rc6 Kernel Released; Lots Of Small Fixes
The Linux 2.6.38-rc6 kernel has been released. The 2.6.38 kernel is getting into shape and will soon be released with the sixth release candidate carrying a variety of small fixes throughout this open-source kernel...
http://www.phoronix.com/vr.php?view=OTEyMA
Sorry, does anyone know what "/proc" were replaced with? How does ps aux and similar will work?
Linux 2.6.38-rc6 (lwn.net article)[SCSI] target: Remove procfs based target_core_mib.c code
Here's the relevant patch on the mailing list: http://www.spinics.net/lists/linux-scsi/msg50177.html
Sounds like they're removing code that is related to (or, relies on) legacy procfs code, not the /proc code itself.
procfs was supposed to store process information, but over the years lots of other odds and ends got tacked into it that were not related to processes. Most of that has since been moved to sysfs or debugfs, but there is still a lot of old deprecated procfs entries that are slowly being removed.
Thanks a lot!
I wonder why they are using goto directive instead of making things simpler (from that link to patch), ie:
and not something this trivial:Code:if (core_dev_setup_virtual_lun0() < 0) goto out; - scsi_target_proc = proc_mkdir("scsi_target", NULL); - if (!(scsi_target_proc)) { - printk(KERN_ERR "proc_mkdir(scsi_target, 0) failed\n"); - goto out; - } - ret = init_scsi_target_mib(); - if (ret < 0) - goto out; - return 0; out:
Is this patch not widely accepted yet..?Code:if (core_dev_setup_virtual_lun0() >= 0) return 0; - scsi_target_proc = proc_mkdir("scsi_target", NULL); - if (!(scsi_target_proc)) { - printk(KERN_ERR "proc_mkdir(scsi_target, 0) failed\n"); - goto out; - } - ret = init_scsi_target_mib(); - if (ret < 0) - goto out; -
There's more code behind the out:, just returning has a different effect. Goto is used quite often in the linux kernel, usually in this structure:
it's a poor man's try {} catch {}Code:void function() { initialize_some_stuff(); if (failure) goto out; initialize_more_stuff(); if (failure) goto out; return success; out: cleanup_any_half_initialized_resources(); return failure; }![]()
Hehe, I understand your point. But why not consider this(not trying to teach anyone..):
I guess the real reason is own preferenceCode:int function(){ do_somestuff(); if (failure) { cleanup(); return failure; } do_morestuff(); if (failure) { cleanup(); return failure; } return success; } ... void cleanup(){... };
I was just taught missuse of goto leads to undebuggable code and highers cache usage.