aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-12-13 20:49:55 -0500
committerNeilBrown <neilb@suse.de>2009-12-13 20:51:41 -0500
commit43a705076e51c5af21ec4260a35699775ea298f5 (patch)
treeff8e161d841c41992dbbcca2a844816411941c3c /drivers/md/md.c
parent72e02075a33f739e21430262f71da8e82db9dbb3 (diff)
md: support updating bitmap parameters via sysfs.
A new attribute directory 'bitmap' in 'md' is created which contains files for configuring the bitmap. 'location' identifies where the bitmap is, either 'none', or 'file' or 'sector offset from metadata'. Writing 'location' can create or remove a bitmap. Adding a 'file' bitmap this way is not yet supported. 'chunksize' and 'time_base' must be set before 'location' can be set. 'chunksize' can be set before creating a bitmap, but is currently always over-ridden by the bitmap superblock. 'time_base' and 'backlog' can be updated at any time. Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Andre Noll <maan@systemlinux.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 93287f88f1f4..859edbf8c9b0 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4018,6 +4018,7 @@ static void mddev_delayed_delete(struct work_struct *ws)
4018 mddev->sysfs_action = NULL; 4018 mddev->sysfs_action = NULL;
4019 mddev->private = NULL; 4019 mddev->private = NULL;
4020 } 4020 }
4021 sysfs_remove_group(&mddev->kobj, &md_bitmap_group);
4021 kobject_del(&mddev->kobj); 4022 kobject_del(&mddev->kobj);
4022 kobject_put(&mddev->kobj); 4023 kobject_put(&mddev->kobj);
4023} 4024}
@@ -4109,6 +4110,8 @@ static int md_alloc(dev_t dev, char *name)
4109 disk->disk_name); 4110 disk->disk_name);
4110 error = 0; 4111 error = 0;
4111 } 4112 }
4113 if (sysfs_create_group(&mddev->kobj, &md_bitmap_group))
4114 printk(KERN_DEBUG "pointless warning\n");
4112 abort: 4115 abort:
4113 mutex_unlock(&disks_mutex); 4116 mutex_unlock(&disks_mutex);
4114 if (!error) { 4117 if (!error) {
@@ -4434,7 +4437,7 @@ static int deny_bitmap_write_access(struct file * file)
4434 return 0; 4437 return 0;
4435} 4438}
4436 4439
4437static void restore_bitmap_write_access(struct file *file) 4440void restore_bitmap_write_access(struct file *file)
4438{ 4441{
4439 struct inode *inode = file->f_mapping->host; 4442 struct inode *inode = file->f_mapping->host;
4440 4443