Re: Oddity in libufs.

From: Giorgos Keramidas (keramida_at_linux.gr)
Date: 09/25/05

  • Next message: Robert Watson: "Re: freebsd-5.4-stable panics"
    Date: Sun, 25 Sep 2005 14:00:05 +0300
    To: Frank Mayhar <frank@exit.com>
    
    

    On 2005-09-24 20:26, Frank Mayhar <frank@exit.com> wrote:
    > I've been using libufs as the I/O mechanism for my (heavy) modification
    > of sysutils/ffsrecov. It's working to my needs and now I'm poking at
    > other bits and pieces to maybe get it suitable for release into the
    > wild. I just looked at cgread() to see what it does and noticed that
    > there seems to be a redundant line:
    >
    > .
    > .
    > if (c >= fs->fs_ncg) {
    > return (0);
    > }
    > ccg = fsbtodb(fs, cgtod(fs, c)) * disk->d_bsize;
    > if (bread(disk, fsbtodb(fs, cgtod(fs, c)), disk->d_cgunion.d_buf,
    > .
    > .
    >
    > That assignment up there looks redundant, as ccg is never used. I
    > suspect that it's a relic of an old lseek()/read() pair that's long
    > gone.

    It's probably easy to verify that without this assignment 'ccg' is an
    unused var:

            - Comment it out
            - Rebuild with an elevated WARNS level

    if a warning about 'unused ccg var' is printed, then you are certain
    that ccg was only used for the assignment.

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Robert Watson: "Re: freebsd-5.4-stable panics"

    Relevant Pages

    • Re: Oddity in libufs.
      ... I just looked at cgread() to see what it does and noticed that ... >> That assignment up there looks redundant, as ccg is never used. ... > if a warning about 'unused ccg var' is printed, ...
      (freebsd-hackers)
    • Re: Oddity in libufs.
      ... On Sun, 2005-09-25 at 14:00 +0300, Giorgos Keramidas wrote: ... >> That assignment up there looks redundant, as ccg is never used. ...
      (freebsd-hackers)
    • Re: Oddity in libufs.
      ... > I've been using libufs as the I/O mechanism for my modification ... > of sysutils/ffsrecov. ... > That assignment up there looks redundant, ... it looks like it shouldn't cause any harm to just remove ccg. ...
      (freebsd-hackers)