1/* 2 * Copyright (c) 2001-2007 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * The contents of this file constitute Original Code as defined in and 7 * are subject to the Apple Public Source License Version 1.1 (the 8 * "License"). You may not use this file except in compliance with the 9 * License. Please obtain a copy of the License at 10 * http://www.apple.com/publicsource and read it before using this file. 11 * 12 * This Original Code and all software distributed under the License are 13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the 17 * License for the specific language governing rights and limitations 18 * under the License. 19 * 20 * @APPLE_LICENSE_HEADER_END@ 21 */ 22 23 24#ifndef _APPLERAIDCONCATSET_H 25#define _APPLERAIDCONCATSET_H 26 27#define kAppleRAIDLevelNameConcat "Concat" 28 29#ifdef KERNEL 30 31class AppleRAIDConcatSet : public AppleRAIDSet 32{ 33 OSDeclareDefaultStructors(AppleRAIDConcatSet); 34 35 private: 36 UInt64 * arMemberBlockCounts; 37 UInt32 arExpectingLiveAdd; 38 39 protected: 40 virtual bool init(); 41 virtual void free(); 42 43 virtual void unpauseSet(void); 44 45 public: 46 static AppleRAIDSet * createRAIDSet(AppleRAIDMember * firstMember); 47 virtual bool addSpare(AppleRAIDMember * member); 48 virtual bool addMember(AppleRAIDMember * member); 49 virtual bool removeMember(AppleRAIDMember * member, IOOptionBits options); 50 51 virtual bool resizeSet(UInt32 newMemberCount); 52 virtual bool startSet(void); 53 virtual bool publishSet(void); 54 55 virtual UInt64 getMemberSize(UInt32 memberIndex) const; 56 57 virtual AppleRAIDMemoryDescriptor * allocateMemoryDescriptor(AppleRAIDStorageRequest *storageRequest, UInt32 memberIndex); 58}; 59 60 61 62class AppleRAIDConcatMemoryDescriptor : public AppleRAIDMemoryDescriptor 63{ 64 OSDeclareDefaultStructors(AppleRAIDConcatMemoryDescriptor); 65 66private: 67 UInt64 mdMemberOffset; 68 UInt64 mdMemberStart; 69 UInt64 mdMemberEnd; 70 71protected: 72 virtual bool initWithStorageRequest(AppleRAIDStorageRequest *storageRequest, UInt32 memberIndex); 73 virtual bool configureForMemoryDescriptor(IOMemoryDescriptor *memoryDescriptor, UInt64 byteStart, UInt32 activeIndex); 74 75 public: 76 static AppleRAIDMemoryDescriptor *withStorageRequest(AppleRAIDStorageRequest *storageRequest, UInt32 memberIndex); 77 virtual addr64_t getPhysicalSegment(IOByteCount offset, IOByteCount * length, IOOptionBits options = 0); 78}; 79 80#endif KERNEL 81 82#endif /* ! _APPLERAIDCONCATSET_H */ 83