Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Linux 2.6.38-rc6 Kernel Released; Lots Of Small Fixes

  1. #1
    Join Date
    Jan 2007
    Posts
    14,378

    Default Linux 2.6.38-rc6 Kernel Released; Lots Of Small Fixes

    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

  2. #2
    Join Date
    Apr 2010
    Posts
    1,946

    Default

    Sorry, does anyone know what "/proc" were replaced with? How does ps aux and similar will work?

  3. #3
    Join Date
    Nov 2007
    Posts
    297

    Default

    Quote Originally Posted by crazycheese View Post
    Sorry, does anyone know what "/proc" were replaced with? How does ps aux and similar will work?
    /proc isn't getting removed

  4. #4
    Join Date
    Jan 2009
    Location
    Vienna, Austria; Germany; hello world :)
    Posts
    624

    Default

    Quote Originally Posted by crazycheese View Post
    Sorry, does anyone know what "/proc" were replaced with? How does ps aux and similar will work?
    [SCSI] target: Remove procfs based target_core_mib.c code
    Linux 2.6.38-rc6 (lwn.net article)

  5. #5
    Join Date
    Oct 2010
    Posts
    418

    Default

    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.

  6. #6
    Join Date
    Dec 2007
    Posts
    2,329

    Default

    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.

  7. #7
    Join Date
    Apr 2010
    Posts
    1,946

    Default

    Thanks a lot!

    I wonder why they are using goto directive instead of making things simpler (from that link to patch), ie:

    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:
    and not something this trivial:

    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;
    -
    Is this patch not widely accepted yet..?

  8. #8
    Join Date
    Nov 2008
    Posts
    762

    Default

    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:

    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;
    }
    it's a poor man's try {} catch {}

  9. #9
    Join Date
    Apr 2010
    Posts
    1,946

    Default

    Quote Originally Posted by rohcQaH View Post
    There's more
    Hehe, I understand your point. But why not consider this(not trying to teach anyone..):
    Code:
    int function(){
       do_somestuff();
       if (failure) { cleanup(); return failure; }
       do_morestuff();
       if (failure) { cleanup(); return failure; }
    return success;
    }
    ...
    void cleanup(){... };
    I guess the real reason is own preference

    I was just taught missuse of goto leads to undebuggable code and highers cache usage.

  10. #10
    Join Date
    Oct 2009
    Posts
    845

    Default

    Quote Originally Posted by crazycheese View Post
    I was just taught missuse of goto leads to undebuggable code and highers cache usage.
    Well, I find both solutions quite readable but I'd likely not use goto myself due to habit. I don't understand why 'goto' would lead to 'higher' cache usage than calling an outside function?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •