The following fixes were required for me to compile 2.3.47 with LVM. -- Michael Marxmeier mike@msede.com --- linux/fs/partitions/check.c.orig Wed Feb 23 01:46:02 2000 +++ linux/fs/partitions/check.c Wed Feb 23 01:47:22 2000 @@ -71,6 +71,11 @@ NULL }; +#if defined CONFIG_BLK_DEV_LVM || defined CONFIG_BLK_DEV_LVM_MODULE +#include +void ( *lvm_hd_name_ptr) ( char *, int) = NULL; +#endif + /* * disk_name() is used by genhd.c and blkpg.c. * It formats the devicename of the indicated disk into @@ -97,6 +102,13 @@ * This requires special handling here. */ switch (hd->major) { +#if defined CONFIG_BLK_DEV_LVM || defined CONFIG_BLK_DEV_LVM_MODULE + case LVM_BLK_MAJOR: + *buf = 0; + if ( lvm_hd_name_ptr != NULL) + ( lvm_hd_name_ptr) ( buf, minor); + return buf; +#endif case IDE9_MAJOR: unit += 2; case IDE8_MAJOR: --- linux/fs/block_dev.c.orig Wed Feb 23 01:45:02 2000 +++ linux/fs/block_dev.c Wed Feb 23 01:45:27 2000 @@ -313,7 +313,7 @@ * since the vma has no handle. */ -static int block_fsync(struct file *filp, struct dentry *dentry) +int block_fsync(struct file *filp, struct dentry *dentry) { return fsync_dev(dentry->d_inode->i_rdev); } @@ -650,7 +650,7 @@ return ret; } -static int blkdev_close(struct inode * inode, struct file * filp) +int blkdev_close(struct inode * inode, struct file * filp) { return blkdev_put(inode->i_bdev, BDEV_FILE); } --- linux/kernel/ksyms.c.orig Wed Feb 23 01:49:22 2000 +++ linux/kernel/ksyms.c Wed Feb 23 01:50:48 2000 @@ -71,6 +71,10 @@ }; #endif +#ifdef CONFIG_BLK_DEV_LVM_MODULE +extern void (*lvm_hd_name_ptr) ( char*, int); +EXPORT_SYMBOL(lvm_hd_name_ptr); +#endif #ifdef CONFIG_KMOD EXPORT_SYMBOL(request_module); @@ -159,6 +163,8 @@ EXPORT_SYMBOL(free_kiovec); EXPORT_SYMBOL(brw_kiovec); EXPORT_SYMBOL(alloc_kiovec); +EXPORT_SYMBOL(expand_kiobuf); +EXPORT_SYMBOL(unmap_kiobuf); EXPORT_SYMBOL(get_empty_filp); EXPORT_SYMBOL(init_private_file); EXPORT_SYMBOL(filp_open); @@ -228,6 +234,7 @@ EXPORT_SYMBOL(page_follow_link); EXPORT_SYMBOL(page_symlink_inode_operations); EXPORT_SYMBOL(block_symlink); +EXPORT_SYMBOL(block_fsync); /* for stackable file systems (lofs, wrapfs, etc.) */ EXPORT_SYMBOL(add_to_page_cache); @@ -263,6 +270,7 @@ EXPORT_SYMBOL(sync_dev); EXPORT_SYMBOL(devfs_register_partitions); EXPORT_SYMBOL(blkdev_open); +EXPORT_SYMBOL(blkdev_close); EXPORT_SYMBOL(blkdev_get); EXPORT_SYMBOL(blkdev_put); EXPORT_SYMBOL(ioctl_by_bdev); --- linux/include/linux/fs.h.orig Wed Feb 23 01:43:30 2000 +++ linux/include/linux/fs.h Wed Feb 23 01:44:16 2000 @@ -795,6 +795,8 @@ extern struct block_device *bdget(dev_t); extern void bdput(struct block_device *); extern int blkdev_open(struct inode *, struct file *); +extern int blkdev_close(struct inode * inode, struct file * filp); +extern int block_fsync(struct file *filp, struct dentry *dentry); extern struct file_operations def_blk_fops; extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); extern int blkdev_get(struct block_device *, mode_t, unsigned, int); --- linux/include/linux/blk.h.orig Wed Feb 23 02:01:19 2000 +++ linux/include/linux/blk.h Wed Feb 23 02:01:45 2000 @@ -51,6 +51,7 @@ extern int xd_init(void); extern int mfm_init(void); extern int loop_init(void); +extern int lvm_init(void); extern int md_init(void); extern int ap_init(void); extern int ddv_init(void); --- linux/drivers/block/Config.in.orig Mon Feb 21 07:00:16 2000 +++ linux/drivers/block/Config.in Mon Feb 21 07:00:55 2000 @@ -202,6 +202,12 @@ if [ "$CONFIG_NET" = "y" ]; then tristate 'Network block device support' CONFIG_BLK_DEV_NBD fi + +tristate 'Logical volume manager (LVM) support' CONFIG_BLK_DEV_LVM N +if [ "$CONFIG_BLK_DEV_LVM" != "n" ]; then + bool ' LVM information in proc filesystem' CONFIG_LVM_PROC_FS Y +fi + bool 'Multiple devices driver support' CONFIG_BLK_DEV_MD if [ "$CONFIG_BLK_DEV_MD" = "y" ]; then tristate ' Linear (append) mode' CONFIG_MD_LINEAR --- linux/drivers/block/ll_rw_blk.c.orig Mon Feb 21 07:18:02 2000 +++ linux/drivers/block/ll_rw_blk.c Wed Feb 23 02:03:58 2000 @@ -1214,6 +1214,9 @@ #ifdef CONFIG_SJCD sjcd_init(); #endif CONFIG_SJCD +#ifdef CONFIG_BLK_DEV_LVM + lvm_init(); +#endif #ifdef CONFIG_BLK_DEV_MD md_init(); #endif CONFIG_BLK_DEV_MD @@ -1233,8 +1236,8 @@ EXPORT_SYMBOL(end_that_request_first); EXPORT_SYMBOL(end_that_request_last); EXPORT_SYMBOL(blk_init_queue); +EXPORT_SYMBOL(blk_queue_make_request); EXPORT_SYMBOL(blk_cleanup_queue); EXPORT_SYMBOL(blk_queue_headactive); EXPORT_SYMBOL(blk_queue_pluggable); -EXPORT_SYMBOL(blk_queue_make_request); EXPORT_SYMBOL(generic_make_request); --- linux/drivers/block/lvm.c.orig Wed Feb 23 02:14:28 2000 +++ linux/drivers/block/lvm.c Wed Feb 23 02:14:42 2000 @@ -287,7 +287,7 @@ static char pv_name[NAME_LEN]; /* static char rootvg[NAME_LEN] = { 0, }; */ static uint lv_open = 0; -static const char *const lvm_name = LVM_NAME; +const char *const lvm_name = LVM_NAME; static int lock = 0; static int loadtime = 0; static uint vg_count = 0; --- linux/arch/i386/kernel/mtrr.c.orig Wed Feb 23 02:10:27 2000 +++ linux/arch/i386/kernel/mtrr.c Wed Feb 23 02:11:13 2000 @@ -1838,7 +1838,7 @@ proc_root_mtrr = create_proc_entry ("mtrr", S_IWUSR | S_IRUGO, &proc_root); proc_root_mtrr->ops = &proc_mtrr_inode_operations; #endif -#ifdev CONFIG_DEVFS_FS +#ifdef CONFIG_DEVFS_FS devfs_handle = devfs_register (NULL, "cpu/mtrr", 0, DEVFS_FL_DEFAULT, 0, 0, S_IFREG | S_IRUGO | S_IWUSR, 0, 0, &mtrr_fops, NULL);