From: Mike Snitzer <snitzer@redhat.com>
To: lvm-devel@redhat.com
Subject: Re: [PATCHi v2 1/5] Update 'md_chunk_alignment' to use stripe-width to align PV data
Date: Mon, 6 Jul 2009 13:14:49 -0400 [thread overview]
Message-ID: <20090706171448.GA17118@redhat.com> (raw)
In-Reply-To: <20090706104737.GB11082@agk-dp.fab.redhat.com>
On Mon, Jul 06 2009 at 6:47am -0400,
Alasdair G Kergon <agk@redhat.com> wrote:
> On Sun, Jul 05, 2009 at 10:39:46PM -0400, Mike Snitzer wrote:
> > +static unsigned long dev_md_chunk_size(const char *sysfs_dir,
> > + struct device *dev)
>
> > + if (!(fp = md_sysfs_fopen(sysfs_dir, dev, attribute)))
> > + return 0;
>
> > - log_sys_error("fgets", path);
> > + log_sys_error("fgets", attribute);
>
> Please reinstate the variable contextual information in these messages.
> (sysfs_dir, dev, md are all now missing - return 'path' to the caller
> of the customised fopen, or create the path in a separate fn first
> and pass it in?)
Done.
> > +static int dev_md_level(const char *sysfs_dir, struct device *dev)
> > +static int dev_md_raid_disks(const char *sysfs_dir, struct device *dev)
> > +unsigned long dev_md_stripe_width(const char *sysfs_dir, struct device *dev)
>
> Is there more code that could be shared between these functions?
Yes, I ended up sharing a bit more.
> > + data_disks = raid_disks - (level == 0 ? 0 : (level <= 5 ? 1 : 2));
> Add a comment before that line explaining it.
Turns out the above logic completely mishandled raid1. I reworked the
above into a proper switch statement with comments.
> Ack
Thanks for the review,
Mike
next prev parent reply other threads:[~2009-07-06 17:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 2:39 [PATCH v4 0/5] LVM2 topology support Mike Snitzer
2009-07-06 2:39 ` [PATCHi v2 1/5] Update 'md_chunk_alignment' to use stripe-width to align PV data Mike Snitzer
2009-07-06 10:47 ` Alasdair G Kergon
2009-07-06 17:14 ` Mike Snitzer [this message]
2009-07-06 2:39 ` [PATCH v4 2/5] cmdline: support for bytes and sectors Mike Snitzer
2009-07-06 11:01 ` Alasdair G Kergon
2009-07-06 2:39 ` [PATCH v4 3/5] Add --dataalignmentoffset to pvcreate to pad aligned data area Mike Snitzer
2009-07-06 2:39 ` [PATCH v4 4/5] Add devices/data_alignment_offset_detection to lvm.conf Mike Snitzer
2009-07-06 2:39 ` [PATCH v4 5/5] Add devices/data_alignment_detection " Mike Snitzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090706171448.GA17118@redhat.com \
--to=snitzer@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.