Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16569
b: refs/heads/master
c: 93c8cad
h: refs/heads/master
i:
  16567: b513f71
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jan 6, 2006
1 parent d46bd2f commit 968b513
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 014236d2b8ec6faea2a6134ab8e019d84d67b524
refs/heads/master: 93c8cad03f02dbd1532a5413bdced25f000d5728
6 changes: 6 additions & 0 deletions trunk/Documentation/md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ Each directory contains:
it currently fills. This can only be set while assembling an
array. A device for which this is set is assumed to be working.

offset
This gives the location in the device (in sectors from the
start) where data from the array will be stored. Any part of
the device before this offset us not touched, unless it is
used for storing metadata (Formats 1.1 and 1.2).


An active md device will also contain and entry for each active device
in the array. These are named
Expand Down
23 changes: 23 additions & 0 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,11 +1664,34 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
static struct rdev_sysfs_entry rdev_slot =
__ATTR(slot, 0644, slot_show, slot_store);

static ssize_t
offset_show(mdk_rdev_t *rdev, char *page)
{
return sprintf(page, "%llu\n", rdev->data_offset);
}

static ssize_t
offset_store(mdk_rdev_t *rdev, const char *buf, size_t len)
{
char *e;
unsigned long long offset = simple_strtoull(buf, &e, 10);
if (e==buf || (*e && *e != '\n'))
return -EINVAL;
if (rdev->mddev->pers)
return -EBUSY;
rdev->data_offset = offset;
return len;
}

static struct rdev_sysfs_entry rdev_offset =
__ATTR(offset, 0644, offset_show, offset_store);

static struct attribute *rdev_default_attrs[] = {
&rdev_state.attr,
&rdev_super.attr,
&rdev_errors.attr,
&rdev_slot.attr,
&rdev_offset.attr,
NULL,
};
static ssize_t
Expand Down

0 comments on commit 968b513

Please sign in to comment.