• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/IOStorageFamily-182.1.1/

Lines Matching refs:media

64 #define kMsgNoWhole    "%s: No whole media found for media \"%s\".\n", getName()
65 #define kMsgNoLocation "%s: No location is found for media \"%s\".\n", getName()
171 IOMediaBSDClient * client; // (minor's media bsd client object)
172 IOMedia * media; // (minor's media object)
208 UInt32 insert( IOMedia * media,
213 UInt32 update( IOMedia * media,
218 UInt32 locate(IOMedia * media);
323 IOMedia * media = (IOMedia *) provider;
333 // Create bdevsw and cdevsw nodes for the new media object.
335 createNodes(media);
367 // Find the minor assigned to this media.
398 IOMedia * IOMediaBSDClient::getWholeMedia( IOMedia * media,
403 // Find the whole media that roots this media tree. A null return value
404 // indicates no whole media was found or a malformed tree was detected.
423 // Search the registry for the parent whole media for this media.
425 for ( service = media; service; service = service->getProvider() )
427 if ( OSDynamicCast(IOMedia, service) ) // (is it a media?)
429 if ( ((IOMedia *)service)->isWhole() ) // (is it a whole media?)
447 return (IOMedia *)service; // (return the whole media)
450 // Determine whether this non-whole media has a location value. It
451 // must, by definition of a non-whole media, but if it does not, we
456 if ( location == 0 ) // (no location on non-whole media?)
458 if ( service == media ) IOLog(kMsgNoLocation, media->getName());
462 // Otherwise, it's a valid non-whole media: we compute the required
483 // If we've fallen through, then the whole media was never found.
485 if ( depth == 1 ) IOLog(kMsgNoWhole, media->getName());
490 bool IOMediaBSDClient::createNodes(IOMedia * media)
493 // Create bdevsw and cdevsw nodes for the given media object.
510 // Find the anchor that roots this media tree. The anchor is defined as the
511 // parent of the whole media that roots this media tree. It is an important
512 // object to us because this object stays in place when media is ejected, so
514 // media is re-inserted, it will show up under the same "unit number". You
519 whole = getWholeMedia(media, &slicePathSize);
560 whole = getWholeMedia(media, &slicePathSize, slicePath);
564 // Insert the new media into our minor table (we're almost done :-).
567 minorID = minors->update(media, anchorID, this, slicePath);
571 minorID = minors->insert(media, anchorID, this, slicePath);
576 // Create the required properties on the media.
579 media->setProperty(kIOBSDNameKey, minors->getMinor(minorID)->name);
580 media->setProperty(kIOBSDUnitKey, anchorID, 32); // ("BSD Unit" )
581 media->setProperty(kIOBSDMajorKey, majorID, 32); // ("BSD Major")
582 media->setProperty(kIOBSDMinorKey, minorID, 32); // ("BSD Minor")
768 UInt64 _IOMediaBSDClientGetThrottleMask(IOMedia * media)
774 if ( media )
790 devices = IORegistryIterator::iterateOver( media, gIOServicePlane, kIORegistryIterateParents );
907 IOMedia * media;
921 media = 0;
946 if ( minor->media->isWritable() )
962 if ( minor->media->isWritable() == false )
992 media = minor->media;
993 minor->media->retain();
995 success = minor->media->open(minor->client, 0, levelOut); // (go)
1034 // or terminate storage drivers, should the media object have been re-
1039 if ( media )
1041 media->waitQuiet();
1042 media->release();
1056 IOMedia * media;
1064 media = 0;
1071 minor->bdevBlockSize = minor->media->getPreferredBlockSize();
1090 // means we are in a state where the media object has been closed, only
1098 // media's termination notification, but the minor is yet to be removed
1114 // We communicate the close down to the media object once all opens are
1123 media = minor->media;
1124 minor->media->retain();
1127 // media's termination notification, but the minor is yet to be removed
1137 media->close(client); // (go)
1144 // We communicate the downgrade down to the media object.
1147 media = minor->media;
1148 minor->media->retain();
1152 minor->media->open(minor->client, 0, levelOut); // (go)
1163 // should the media object have been re-registered as a result of this
1167 if ( media )
1169 media->waitQuiet();
1170 media->release();
1229 // This ioctl returns the preferred block size of the media object.
1232 *(uint32_t *)data = minor->media->getPreferredBlockSize();
1240 // This ioctl returns the size of the media object in blocks. The
1244 if ( minor->media->getPreferredBlockSize() )
1245 *(uint32_t *)data = ( minor->media->getSize() /
1246 minor->media->getPreferredBlockSize() );
1256 // This ioctl returns the size of the media object in blocks. The
1260 if ( minor->media->getPreferredBlockSize() )
1261 *(uint64_t *)data = ( minor->media->getSize() /
1262 minor->media->getPreferredBlockSize() );
1276 /* object */ minor->media->getProperty(
1294 /* object */ minor->media->getProperty(
1312 /* object */ minor->media->getProperty(
1330 /* object */ minor->media->getProperty(
1348 /* object */ minor->media->getProperty(
1366 /* object */ minor->media->getProperty(
1384 /* object */ minor->media->getProperty(
1402 /* object */ minor->media->getProperty(
1420 /* object */ minor->media->getProperty(
1438 /* object */ minor->media->getProperty(
1456 /* object */ minor->media->getProperty(
1462 *(uint32_t *)data = minor->media->getPreferredBlockSize();
1474 /* object */ minor->media->getProperty(
1487 // This ioctl returns truth if the media object is formatted.
1490 *(uint32_t *)data = minor->media->isFormatted();
1497 // This ioctl returns truth if the media object is writable.
1500 *(uint32_t *)data = minor->media->isWritable();
1507 // This ioctl asks that the media object be ejected from the device.
1516 driver = (IOBlockStorageDriver *) minor->media->getProvider();
1520 // Determine whether this media has an IOBlockStorageDriver parent.
1538 // a state where the media object has been closed but the device
1550 // Close the media object before the ejection request is made.
1552 minor->media->close(client);
1554 // Retain the media's BSD client object, as it is about
1559 // Eject the media from the drive.
1568 // Release the media's BSD client object.
1587 // This ioctl asks that the media object be formatted.
1597 driver = (IOBlockStorageDriver *) minor->media->getProvider();
1604 // Determine whether this media has an IOBlockStorageDriver parent.
1624 // a state where the media object has been closed but the device
1636 // Close the media object before the formatting request is made.
1638 minor->media->close(client);
1640 // Retain the media's BSD client object, as it is about
1645 // Format the media in the drive.
1651 // drivers, since the media object will have been re-published.
1654 // correctly in case the media object doesn't get re-published,
1663 // Release the media's BSD client object.
1682 // This ioctl returns the feasible format capacities for this media
1695 driver = (IOBlockStorageDriver *) minor->media->getProvider();
1715 // Determine whether this media has an IOBlockStorageDriver parent.
1735 blockSize = minor->media->getPreferredBlockSize();
1782 // This ioctl asks that the media object be flushed onto the device.
1787 // Flush the media onto the drive.
1789 status = minor->media->synchronizeCache(minor->client);
1790 error = minor->media->errnoFromReturn(status);
1797 // This ioctl asks that the media object delete unused data.
1826 // Delete unused data from the media.
1849 status = minor->media->unmap( /* client */ minor->client,
1854 error = minor->media->errnoFromReturn(status);
1870 driver = (IOBlockStorageDriver *) minor->media->getProvider();
1873 // Determine whether this media has an IOBlockStorageDriver parent.
1880 error = minor->media->errnoFromReturn(status);
1887 // This ioctl returns the BSD unit of the media object.
1892 /* object */ minor->media->getProperty(
1904 // This ioctl returns the open firmware path for this media object.
1910 if ( minor->media->getPath(p, &l, gIODTPlane) && strchr(p, ':') )
1925 /* object */ minor->media->getProperty(
1952 /* object */ minor->media->getProperty(
1974 // This ioctl returns the base of the media object.
1977 *(uint64_t *)data = minor->media->getBase();
1984 // This ioctl returns the features of the media object.
1989 /* object */ minor->media->getProperty(
2029 // This ioctl returns the throttle mask for the media object.
2032 *( ( uint64_t * ) data ) = _IOMediaBSDClientGetThrottleMask( minor->media );
2044 /* object */ minor->media->getProperty(
2078 /* object */ minor->media->getProperty(
2133 // media object.
2143 // This ioctl overrides the block size for the media object, for the
2158 // This ioctl returns the size of the media object in blocks. The
2163 *(uint32_t *)data = ( minor->media->getSize() /
2174 // This ioctl returns the size of the media object in blocks. The
2179 *(uint64_t *)data = ( minor->media->getSize() /
2190 success = minor->media->lockPhysicalExtents( minor->client );
2207 IOStorage * media;
2209 media = minor->media->copyPhysicalExtent( minor->client, &request->offset, &request->length );
2211 if ( media )
2215 majorID = OSDynamicCast( OSNumber, media->getProperty( kIOBSDMajorKey ) );
2221 minorID = OSDynamicCast( OSNumber, media->getProperty( kIOBSDMinorKey ) );
2237 media->release( );
2253 minor->media->unlockPhysicalExtents( minor->client );
2260 // This ioctl asks that the media object reprioritize a read or
2315 status = minor->media->setPriority( /* client */ minor->client,
2320 error = minor->media->errnoFromReturn(status);
2384 // dksize returns the block size of the media.
2486 buf_seterror(bp, minor->media->errnoFromReturn(status)); // (error?)
2621 if ( minor->media->isFormatted() == false ) // (is media unformatted?)
2629 mediaSize = minor->media->getSize(); // (get media size)
2632 // Reads that start at (or perhaps past) the end-of-media are not considered
2634 // end-of-media do indeed return errors under BSD semantics.
2637 if ( byteStart >= mediaSize ) // (is start at or past the end-of-media?)
2645 // media block boundary are considered errors under BSD semantics.
2650 UInt64 mediaBlockSize = minor->media->getPreferredBlockSize();
2672 // Reads and writes that extend beyond the end-of-media are not considered
2676 // single byte should it include something past the end-of-media. We must
2682 if ( byteCount > mediaSize - byteStart ) // (clip at end-of-media)
2767 minor->media->read( /* client */ minor->client,
2775 minor->media->write( /* client */ minor->client,
2788 status = minor->media->read(
2797 status = minor->media->write(
2808 return minor->media->errnoFromReturn(status); // (return error status)
2814 return minor->media->errnoFromReturn(status); // (return error status)
2844 IOLog("%s: %s.\n", minor->name, minor->media->stringFromReturn(status));
3194 UInt32 MinorTable::insert( IOMedia * media,
3200 // This method inserts the specified media/anchorID pair into an unassigned
3249 // Create a block and character device node in BSD for this media.
3292 _table[minorID].media = media;
3294 _table[minorID].bdevBlockSize = media->getPreferredBlockSize();
3306 _table[minorID].media->retain(); // (retain media)
3334 _table[minorID].media->release(); // (release media)
3349 UInt32 MinorTable::update( IOMedia * media,
3357 // as new anchors are assigned when two media trees are found to share the
3361 // media objects terminated, the minor slot marked obsolete, and the media
3366 // it with the new media object and media bsd client object, and clear its
3367 // obsolete state and "open flux" state, once the new media object arrives.
3407 _table[minorID].media->release(); // (release media)
3412 _table[minorID].media = media;
3415 _table[minorID].media->retain(); // (retain media)
3420 UInt32 MinorTable::locate(IOMedia * media)
3423 // This method searches for the specified media in the minor table and
3432 _table[minorID].media == media ) return minorID;