code: func newStoreFromGraphDriver(root string, driver graphdriver.Driver, os string) (Store, error) {
  	if !system.IsOSSupported(os) {
  		return nil, fmt.Errorf("failed to initialize layer store as operating system '%s' is not supported", os)
  	}
  	caps := graphdriver.Capabilities{}
  	if capDriver, ok := driver.(graphdriver.CapabilityDriver); ok {
  		caps = capDriver.Capabilities()
  	}
  
  	ms, err := newFSMetadataStore(root)
  	if err != nil {
  		return nil, err
  	}
  
  	ls := &layerStore{
  		store:       ms,
  		driver:      driver,
  		layerMap:    map[ChainID]*roLayer{},
  		mounts:      map[string]*mountedLayer{},
  		useTarSplit: !caps.ReproducesExactDiffs,
  		os:          os,
  	}
  
  	ids, mounts, err := ms.List()
  	if err != nil {
  		return nil, err
  	}
  
  	for _, id := range ids {
  		l, err := ls.loadLayer(id)
  		if err != nil {
  			logrus.Debugf("Failed to load layer %s: %s", id, err)
  			continue
  		}
  		if l.parent != nil {
  			l.parent.referenceCount++
  		}
  	}
  
  	for _, mount := range mounts {
  		if err := ls.loadMount(mount); err != nil {
  			logrus.Debugf("Failed to load mount %s: %s", mount, err)
  		}
  	}
  
  	return ls, nil
  }
docs: // newStoreFromGraphDriver creates a new Store instance using the provided
  // metadata store and graph driver. The metadata store will be used to restore
  // the Store.