diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2012-04-26 17:12:57 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-04-30 01:56:22 +0200 |
commit | 012a8641290e566f87f1d52f54022752c39ee326 (patch) | |
tree | ec9a3d136040545090965e29516425738ebf198d /sysfs.c | |
parent | Fix sign extension of bitmap_offset in super1.c (diff) | |
download | mdadm-012a8641290e566f87f1d52f54022752c39ee326.tar.xz mdadm-012a8641290e566f87f1d52f54022752c39ee326.zip |
Introduce sysfs_set_num_signed() and use it to set bitmap/offset
mdinfo->bitmap_offset is a signed long and needs to be treated as
such when passed to the kernel.
This resolves the problem with adding internal bitmaps to a 1.0 array.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'sysfs.c')
-rw-r--r-- | sysfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -428,6 +428,14 @@ int sysfs_set_num(struct mdinfo *sra, struct mdinfo *dev, return sysfs_set_str(sra, dev, name, valstr); } +int sysfs_set_num_signed(struct mdinfo *sra, struct mdinfo *dev, + char *name, long long val) +{ + char valstr[50]; + sprintf(valstr, "%lli", val); + return sysfs_set_str(sra, dev, name, valstr); +} + int sysfs_uevent(struct mdinfo *sra, char *event) { char fname[50]; |