From: "Martin K. Petersen" <mkp@mkp.net>
To: linux-lvm@sistina.com
Cc: lvm-devel@sistina.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [linux-lvm] *** ANNOUNCEMENT *** LVM 0.9.1 Beta 7 available at www.sistina.com
Date: 10 Apr 2001 16:01:04 -0400 [thread overview]
Message-ID: <yq1puekr0cf.fsf@jaguar.mkp.net> (raw)
In-Reply-To: <20010410182550.A20569@sistina.com>
In-Reply-To: <20010410182550.A20569@sistina.com>
>>>>> "Heinz" == Heinz J Mauelshagen <Mauelshagen@sistina.com> writes:
Heinz> a tarball of the Linux Logical Volume Manager 0.9.1 Beta 7 is
Heinz> available now at
The following code is baaaad, m'kay...
[...]
down(&_pe_lock);
if((pe_lock_req.lock == LOCK_PE) &&
(rdev_map == pe_lock_req.data.pv_dev) &&
(rsector_map >= pe_lock_req.data.pv_offset) &&
(rsector_map < (pe_lock_req.data.pv_offset + vg_this->pe_size)) &&
((rw == WRITE) || (rw == WRITEA))) {
/* defer this bh until the PE has moved */
if(((int) bh) & 0x3) {
printk(KERN_ERR
"%s -- bh uses low 2 bits of pointer\n",
lvm_name);
up(&_pe_lock);
goto bad;
}
bh->b_reqnext = _pe_requests;
_pe_requests = (struct buffer_head *) ((int) bh | rw);
up(&_pe_lock);
up(&lv->lv_snapshot_sem);
return 0;
}
up(&_pe_lock);
[...]
/* handle all deferred io for this PE */
while(q) {
struct buffer_head *d_bh =
(struct buffer_head *) (q & ~0x3);
int rw = q & 0x3;
q = (uint) d_bh->b_reqnext;
/* resubmit this buffer head */
d_bh->b_reqnext = 0;
generic_make_request(rw, d_bh);
}
Not only is this an evil hack from hell, I don't understand why you go
through such a huge effort of storing rw in the pointer. Afaict, the
only valid value is WRITE. And WRITEA is #defined to WRITE in lvm.c.
--
Martin K. Petersen, Principal Linux Consultant, Linuxcare, Inc.
mkp@linuxcare.com, http://www.linuxcare.com/
SGI XFS for Linux Developer, http://oss.sgi.com/projects/xfs/
prev parent reply other threads:[~2001-04-10 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-10 18:25 Heinz J. Mauelshagen
2001-04-10 20:01 ` Martin K. Petersen [this message]
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=yq1puekr0cf.fsf@jaguar.mkp.net \
--to=mkp@mkp.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-lvm@sistina.com \
--cc=lvm-devel@sistina.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®