image: Improve store locking
image: Improve store locking

This showed up in a recent profile.

Search doesn't need to take a lock on the store, because digestset has
its own locking.

Some other methods can get by with a read lock instead of an exclusive
lock.

Signed-off-by: Aaron Lehmann <8ecfc6017a87905413dcd7d63696a2a4c351b604@docker.com>

YuPengZTE/docker,bearstech/moby,jvanz/docker,moby/moby,scotttlin/docker,lixiaobing10051267/docker,moby/moby,whuwxl/docker,naveed-jamil-tenpearls/moby,flavio/docker,tophj-ibm/moby,vdemeester/docker,whuwxl/docker,estesp/docker,rhatdan/docker,unclejack/docker,shishir-a412ed/docker,charleszheng44/moby,thaJeztah/docker,KingEmet/docker,naveed-jamil-tenpearls/moby,nawawi/docker,johnstep/moby-moby,lixiaobing10051267/docker,dmcgowan/docker,cpuguy83/docker,sterchelen/docker,lixiaobing1/docker,rancher/docker,dccurtis/docker,dccurtis/docker,vdemeester/docker,Ramzec/docker,srust/docker,moul/docker,Ramzec/docker,jvanz/docker,tophj-ibm/docker,yummypeng/docker,AkihiroSuda/docker,pradipd/moby,miminar/docker,yongtang/docker,laijs/moby,thaJeztah/docker,shhsu/docker,konstruktoid/docker-upstream,Mokolea/docker,tophj-ibm/moby,pramodhkp/moby,yosifkit/docker,fcrisciani/docker,konstruktoid/docker-1,sterchelen/docker,gnailuy/docker,rancher/docker,bearstech/moby,POLJM242/docker,x1022as/docker,tonistiigi/docker,bonczj/moby-json-file-logger,kolyshkin/moby,dccurtis/docker,haveatry/docker,fcrisciani/docker,jimjag/docker,jvanz/docker,mkumatag/docker,cpuguy83/docker,charleszheng44/moby,yongtang/docker,jimjag/docker,madhanrm/docker,ripcurld0/moby,noironetworks/docker,nalind/docker,moby/moby,paralin/docker,cpuguy83/docker,cyphar/docker,tonistiigi/docker,dims/docker,maxamillion/docker,hqhq/moby,SvenDowideit/docker,ibuildthecloud/docker,Ramzec/docker,ibuildthecloud/docker,PatrickLang/moby,crosbymichael/docker,unclejack/docker,allencloud/docker,jameszhan/docker,laijs/docker,yummypeng/docker,mikebrow/docker,mixja/docker,dperny/docker,laijs/docker,duglin/docker,allencloud/docker,sterchelen/docker,kojiromike/docker,KarthikNayak/docker,Mokolea/docker,Mokolea/docker,rhatdan/docker,PatrickLang/moby,jlhawn/docker,tklauser/docker,liaoqingwei/docker,moby/moby,estesp/docker,coolljt0725/docker,mahak/docker,rhatdan/docker,hqhq/moby,imkin/moby,cpuguy83/docker,JMesser81/docker,Ramzec/docker,naveed-jamil-tenpearls/moby,docker/docker,AkihiroSuda/docker,mixja/docker,tonistiigi/docker,trebonian/docker,haveatry/docker,nalind/docker,johnstep/moby-moby,johnstep/moby-moby,srust/docker,madhanrm/docker,paralin/docker,amatsus/docker,miminar/docker,coolljt0725/docker,unclejack/docker,mkumatag/docker,moul/docker,dsheets/moby,tmp6154/docker,kolyshkin/moby,gnailuy/docker,djs55/docker,noironetworks/docker,srust/docker,ndeloof/docker,mikebrow/docker,danyalKhaliq10p/moby,laijs/moby,pradipd/moby,bonczj/moby-json-file-logger,coolljt0725/docker,yosifkit/docker,hqhq/moby,rancher/docker,trebonian/docker,cyphar/docker,mkumatag/docker,imkin/moby,raja-sami-10p/moby,tophj-ibm/docker,liaoqingwei/docker,jwhonce/docker,duglin/docker,jimjag/docker,YuPengZTE/docker,bonczj/moby-json-file-logger,ibuildthecloud/docker,jameszhan/docker,justincormack/docker,thaJeztah/docker,coreos/docker,konstruktoid/docker-upstream,scotttlin/docker,shhsu/docker,thaJeztah/docker,tklauser/docker,pramodhkp/moby,mahak/docker,ibuildthecloud/docker,PatrickLang/moby,trebonian/docker,tophj-ibm/moby,raja-sami-10p/moby,miminar/docker,ripcurld0/moby,gnailuy/docker,amatsus/docker,AkihiroSuda/docker,docker/docker,konstruktoid/docker-1,imkin/moby,duglin/docker,mikebrow/docker,charleszheng44/moby,kojiromike/docker,dperny/docker,jwhonce/docker,yongtang/docker,JMesser81/docker,ndeloof/docker,ndeloof/docker,resin-io/docker,AkihiroSuda/docker,liaoqingwei/docker,fcrisciani/docker,KarthikNayak/docker,dims/docker,rremer/moby,POLJM242/docker,maxamillion/docker,lixiaobing10051267/docker,lixiaobing1/docker,dperny/docker,flavio/docker,pradipd/moby,ibuildthecloud/docker,moul/docker,dsheets/moby,docker/docker,mixja/docker,nawawi/docker,tophj-ibm/docker,jameszhan/docker,bearstech/moby,danyalKhaliq10p/moby,justincormack/docker,jwhonce/docker,pramodhkp/moby,cyphar/docker,yummypeng/docker,danyalKhaliq10p/moby,dims/docker,tmp6154/docker,madhanrm/docker,kolyshkin/moby,bearstech/moby,konstruktoid/docker-upstream,kojiromike/docker,rremer/moby,amatsus/docker,mahak/docker,mike1729/docker,lixiaobing1/docker,allencloud/docker,konstruktoid/docker-1,crosbymichael/docker,dmcgowan/docker,tklauser/docker,dsheets/moby,flavio/docker,kolyshkin/docker,KingEmet/docker,gnailuy/docker,yosifkit/docker,SvenDowideit/docker,laijs/moby,yosifkit/docker,paralin/docker,JMesser81/docker,resin-io/docker,whuwxl/docker,djs55/docker,nalind/docker,shishir-a412ed/docker,tmp6154/docker,trebonian/docker,coreos/docker,rremer/moby,laijs/docker,crosbymichael/docker,nawawi/docker,mahak/docker,mike1729/docker,maxamillion/docker,x1022as/docker,dmcgowan/docker,moul/docker,ripcurld0/moby,KingEmet/docker,flavio/docker,Mokolea/docker,noironetworks/docker,jlhawn/docker,resin-io/docker,scotttlin/docker,KarthikNayak/docker,haveatry/docker,djs55/docker,SvenDowideit/docker,coreos/docker,paralin/docker,nawawi/docker,estesp/docker,YuPengZTE/docker,jthelin/docker,justincormack/docker,shishir-a412ed/docker,jlhawn/docker,jthelin/docker,raja-sami-10p/moby,mike1729/docker,shhsu/docker,x1022as/docker,kolyshkin/docker,nalind/docker,konstruktoid/docker-upstream,vdemeester/docker,jimjag/docker