linux/fs/ceph/snap.c
<<
>>
Prefs
   1#include <linux/ceph/ceph_debug.h>
   2
   3#include <linux/sort.h>
   4#include <linux/slab.h>
   5
   6#include "super.h"
   7#include "mds_client.h"
   8
   9#include <linux/ceph/decode.h>
  10
  11/*
  12 * Snapshots in ceph are driven in large part by cooperation from the
  13 * client.  In contrast to local file systems or file servers that
  14 * implement snapshots at a single point in the system, ceph's
  15 * distributed access to storage requires clients to help decide
  16 * whether a write logically occurs before or after a recently created
  17 * snapshot.
  18 *
  19 * This provides a perfect instantanous client-wide snapshot.  Between
  20 * clients, however, snapshots may appear to be applied at slightly
  21 * different points in time, depending on delays in delivering the
  22 * snapshot notification.
  23 *
  24 * Snapshots are _not_ file system-wide.  Instead, each snapshot
  25 * applies to the subdirectory nested beneath some directory.  This
  26 * effectively divides the hierarchy into multiple "realms," where all
  27 * of the files contained by each realm share the same set of
  28 * snapshots.  An individual realm's snap set contains snapshots
  29 * explicitly created on that realm, as well as any snaps in its
  30 * parent's snap set _after_ the point at which the parent became it's
  31 * parent (due to, say, a rename).  Similarly, snaps from prior parents
  32 * during the time intervals during which they were the parent are included.
  33 *
  34 * The client is spared most of this detail, fortunately... it must only
  35 * maintains a hierarchy of realms reflecting the current parent/child
  36 * realm relationship, and for each realm has an explicit list of snaps
  37 * inherited from prior parents.
  38 *
  39 * A snap_realm struct is maintained for realms containing every inode
  40 * with an open cap in the system.  (The needed snap realm information is
  41 * provided by the MDS whenever a cap is issued, i.e., on open.)  A 'seq'
  42 * version number is used to ensure that as realm parameters change (new
  43 * snapshot, new parent, etc.) the client's realm hierarchy is updated.
  44 *
  45 * The realm hierarchy drives the generation of a 'snap context' for each
  46 * realm, which simply lists the resulting set of snaps for the realm.  This
  47 * is attached to any writes sent to OSDs.
  48 */
  49/*
  50 * Unfortunately error handling is a bit mixed here.  If we get a snap
  51 * update, but don't have enough memory to update our realm hierarchy,
  52 * it's not clear what we can do about it (besides complaining to the
  53 * console).
  54 */
  55
  56
  57/*
  58 * increase ref count for the realm
  59 *
  60 * caller must hold snap_rwsem for write.
  61 */
  62void ceph_get_snap_realm(struct ceph_mds_client *mdsc,
  63                         struct ceph_snap_realm *realm)
  64{
  65        dout("get_realm %p %d -> %d\n", realm,
  66             atomic_read(&realm->nref), atomic_read(&realm->nref)+1);
  67        /*
  68         * since we _only_ increment realm refs or empty the empty
  69         * list with snap_rwsem held, adjusting the empty list here is
  70         * safe.  we do need to protect against concurrent empty list
  71         * additions, however.
  72         */
  73        if (atomic_read(&realm->nref) == 0) {
  74                spin_lock(&mdsc->snap_empty_lock);
  75                list_del_init(&realm->empty_item);
  76                spin_unlock(&mdsc->snap_empty_lock);
  77        }
  78
  79        atomic_inc(&realm->nref);
  80}
  81

c_inc(&/*

realm6b_rooa/ceph/snap.c#L64" id="ooass="sref">realm6ooa/cep>  66             ceph_snap_rrrrrrrrealm *realm)
  64{
sp8"L65">  65        list_del_ini>
realm6b_name="eph//snap.c#L64" id=pss="sref">realmp="eph= +code=nref" class="srooass="sref">realm6ooa/cepeph/snap.c#L80" id="6b_namess="sref">realm6b_name="ep>  80}
86list_del_ini>
realm6b_name="eph/snap.c#L64" id=p>
realmp>
realmNULL="ep>  80}
realm)
realm6="eph= snap.c#L64" id=NULLss="sref">realmNULL="ep>  80}
  79        ato8ic_in8(&realmp="ep4">  74                
realmp>
realmp="ep>  80}
(&realm6="eph= snap.c#L64" id=6b_realm6b_realmp>

realm)
realmname="ep">  80}
c_inc(&realm6="epeph/snap.c#L80" id="ino class="line" ninoin_u>  64{
ceph_snap_snap.c#L64" id=pss="sref">realmp="eph= +code(/snap.c#L64" id=pss="sref">realmp="ep4eph/snap.c#L80" id="6b_lefass="sref">realm6b_lefa="ep>  80}
sp9n_lock(&realm6="epeph/snap.c#L80" id="ino class="line" ninoin_u>  64{
list_del_init(&aph_snap_snap.c#L64" id=pss="sref">realmp="eph= +code(/snap.c#L64" id=pss="sref">realmp="ep4eph/snap.c#L80" id="6b_ch">
ss="sref">realm6b_rh">
="ep>  80}
9pin_unlock(&}
realmBUG#37;d">  80}
  78
  79        (&realm6b_link_nameref="+code=nref" class="snew class="line" name="4"eph/snap.c#L80" id="namess="sref">realmname="ep;realmp>
realmp="ep4>  10
/*
realm6b_ref="fscolo"ref="+code=nref" class="snew class="line" name="4"eph/snap.c#L80" id="namess="sref">realmname="ep;realm6ooa/cep4>  10
 * Sna0pshots in ceph are drive02nam n2L81">  81
 * cli0ent.  In contrast to loc03nam n379">  79         * imp0lement snapshots at a si04nam n55" id="L55" class="line" nme="L12">  12 * dis0tributed access to stora05nam nneration of a 'snap contexef="fsf="fslineine" name 6ooass="li@inof="fsbumpname="L59" clae="L18">  18 * whe0ther a write logically o06nam nulting set of snaps for the r="L18">  18 * sna0pshot.
  61 *
  49 * Thi0s provides a perfect ins09nam n9a href="+hr>
realm)
)
realm)
(& *mdsc,
  63                  1nt">/*
  64{
 * Snaapshots in ceph are driveen in1large >  74                 * cliient.  In contrast to loccal f113/a>(& *realm)
  10
 * impplement snapshots at a siingle1point   10
 * disstributed access to storaage r11lass="string">"get_real"L64" class="line" name="L64"h= snap.c#L64" id=kznapo class="line" nakznapo .1izeof(/snap.c#L64" id="L64" class="line" name="L64">;  10
 * wheether a write logically ooccur11pin_unlock  10
 * snaapshot.
  10
 *
  79         * Thiis provides a perfect insstant11(&mdsclm" clase=ref="+code=nref" class="sref">nref);
  49 * cl1ients, however, snapshot1s may12 /a>(&nref);
  10
 * di1fferent points in time, 1depen121/a>(&nref);
realm  10
 * Snappshots in ceph are drivenn in122/a>(&nref);
  10
 * clipan>
nref);
  76                 * Sn1apshots are _not_ file s1ystem124/a>(&nref);
  76                 * displies to the subdirector1y nes12lass="string">"get_realINIT_LIST_HEAD class="line" nINIT_LIST_HEADref="+code=nref" class="sref">nref);
  76                 * whefectively divides the hi1erarc126ass="string">"get_realgt;realmgt;nref);
  76                 * sna the files contained by 1each 127ass="string">"get_real51" id="L51" clasent">/*
snap_empty_lock);
realmgceph0" id=="ep;>  76                 *"get_realm %p %d -> %d\n", ,llxm" clas>  76                 * Thiplicitly created on that1 real12(&  10
 * pa1rent's snap set _aft1er_ t13"L81">  81
 * pa1rent (due to, say, a ren1ame).13tion value="v2.6.22.1"
	span>
<1nt"> * du1ring the time intervals 1durin1 which they were the parent me="L12">  12 *
  61 * Th1e client is spared most 1of th1s detail, fortunately... it mu="L61">  61 * disintains a hierarchy of r1ealms1reflecting the current parent/csnap.c#L61" id="L61" class="line" name="L61">  61 * re1alm relationship, and fo1r eac1 realm has an explicit list ofe="L49">  49 * in1herited from prior paren1ts.
<>
realm)
)
realm)
ent *mdsc,
  63                  1nt"> *
  64{
 * A 1snap_realm struct is mai1ntain1d for >  74                 * wi1th an open cap in the sy1stem.14 /a>(& *realm6b_name="eph/snap.c#L64" id=
  sref">realmsnap_empty_lock);
realmgceph0" id=="ep.> *realm6b_name="ep>  10
 * pr1ovided by the MDS whenev1er a 141/a>(& *realm)
realm6="ep>  10
 * du1rsion number is used to 1ensur14">   3#include < * sn1apshot, new parent, etc.1) the143/a>(&realm  74                 *
realm6="eph= snap.c#L64" id=6b_realm6b_realm
realm)
realmname="ep">  80}
 * Th1e realm hierarchy drives1 the 14>list_del_init(&realm6="epeph/snap.c#L80" id="ino class="line" ninoin_u>  64{
 * re1alm, which simply lists 1the r14pin_unlock(&realmrealmrealm6b_lefa="ep>  80}
 * is1 attached to any writes 1sent 147list_del_init(&aelserealm6="epeph/snap.c#L80" id="ino class="line" ninoin_u>  64{
 */
realmrealm
ss="sref">realm6b_rh">
="ep>  80}
/*
 * Un1fortunately error handli1ng is150in_unlock(&<""""""""ef="+code=mdsc"m %p %d -> %d\n", ,llxm" clasrealm6="epeph/snap.c#L80" id="ino class="line" ninoin_uh/snap.c#L66" id="ss="sref">realm6="ep">  80}
 * up1date, but don't have1 enou151in_unlock(&<<<<<<<<realm6="ep>  10
 * it1's not clear what we1 can 152in_unlock(&<>  81
 * co1nsole).
 *
realmNULL="ep>  80}
>  81
 * re17" id="L57" class="line"1 name1"L57">  57/*
/*
ent *mdsc,
  63                  1nt"> * in1crease ref count for the1 real158ass="string""""""""""""""""""""""ealm *realm)
>  80}
/*
  79         * ca1ller must hold snap_rwse1m for1write.
  12 */
  12 * it1t_snap_realm" class="sre1f">ce16 about it (besides complainine="L49">  49
="+href="fs/ceph/snap.c#L51deealoyL51" clasent">/*
ent *mdsc,
  63                  1/snap.c#L165" id="L65" class="line1" nam16n_lock(& *realm)
  63                  1/nap.c#L51" class="sref">dout(1  74                at166ass="string">"get_realm %p %d -> %d\n", /snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="ino class="line" ninoin_u>>  80}
/*
 * in1    * since we _only_ in1creme168ass="string">"get_real6b_realm6b_nref);
realmname="ep;snap_empty_lock);
realmgceph0" id=="ep>>  80}
/*  79             1    * safe.  we do need 1to pr170in_unlocknref);
realmp>
  74                     1    * additions, however1.(&realm->empty_item);
  10
     1    */
/*
/snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="p>
realmp>
  10
ato173/a>(&  81
s17oint   10
"get_realkfreess="sref">realmkfree.1
realmps="l_p>
  10
"get_realkfreess="sref">realmkfree.1realm51" =="ep4>  10
 * snappshot.
"get_reala>)
realm)
realm * in19" id="L79" class="line"1 name178ass="string">"get_realkfreess="sref">realmkfree.1  10
/*ato1mic_i1c(>  81
  11  12c_inc(&am18 about it (besides complainingsnap.c#id="sef="fs/ceph/(" nam)="L12">  12  49s18"L65">
="+href="fs/ceph/snap.c#L51pu"L51" clasent">/*
ent *mdsc,
  63                  18href="+c18de=list_del_init" class18"sre18>list_del_init(&aph_snap_"""""ealm *realm)
  63                  1/href="+c18de=spin_unlock" class="18ref"186list>  74                "get_realm %p %d -> %d\n", ,llxm" class="sref">realm,
  63                  18t"> *
realm->nref) == 0) {
realm->nref)+1);
  67        ato18ic_i18(&mdsclm" cladec_and_tes=ref="+code=nref" class="sref">nref)+1);
/*
/snap.c#L66" id="L66" class="line" name="L66"">  67          81
c_inc   3#include <  12s19 detail, fortunately... it mussnap.c#s/ce>
  15  49(struct /*
ent *mdsc,
  63                  19fs/ceph/19nap.c#L78" id="L78" cla19s="l197list_del_init(&aph_snap_"ealm *realm)
  63                  19p.c#L9" 19id="L9" class="line" na19name198" na>  74                (&,llxm" class="sref">realm,
  63                  20nap.c#L12"" id="L11" class="line"2n nam200in_unlock(&ama href="+code=realm" class="sref">realm->nref)+1);
realm->nref)+1);
  67        /*
mdsclm" cladec_and_tes=ref="+code=nref" class="sref">nref)+1);
 * Sn20pshots in ceph are driv202nam202in_unlock(&  67         *  79         * im20lement snapshots at a s204nam204/a>(&snap_empty_lock);
realmgceph0cephme="L>">  74                 * di20tributed access to stor205nam20>list_del_init(&/*
/snap.c#L66" id="L66" class="line" name="L66"">  67         * wh20ther a write logically 206nam20pin_unlock(&snap_empty_lock);
realmgceph0cephme="L>  67         * of 0pshot.
aelse<>  74                 *
);
mdsc->snap_empty_lock);
  75                 * Th20s provides a perfect in209nam209list_del_init(&aa href="+code=mde=reads="sref">realmnref)+1);
snap_empty_lock);
  75                (&mdsc->snap_empty_lock);
  77        }
/*
 * Sn2apshots in ceph are driv2en in212L81">  81
 * cl2ient.  In contrast to lo2cal f21379">  79         * im2plement snapshots at a s2ingle2155" id="L55" class="line" nme="L12">  12 * di2stributed access to stor2age r21eflecting the current parent/cCleg tupL="L40" id= whoid="L59" clasef="fsdroppceph/szero.  Note="L53">  53 * wh2ether a write logically 2occur21ulting set of snaps for the reap.c#h/snap"e  71 * sn2apshot.
  61 *
  39 * Th2is provides a perfect in2stant21 for realms containing every iCnap.d  12 * cl2ients, however, snapshot2s may22rite.
  49 * di2fferent points in time, 2depen221/a>(>
="+href="fs/ceph/snap.c#L51>
realm51>
ent *mdsc,
  63                  22t"> * Sn2ppshots in ceph are driv2nn in22arge >  74                 * cl2pan>
realm)
  10
 * Sn2apshots are _not_ file s2ystem22oint   10
 * di2plies to the subdirector2y nes22lass="string">"get_real/class="sref">mdsc->snap_empty_lock);
  75                 * wh2fectively divides the hi2erarc226ass="string"whh/sn(!snap.c#L64" id=de=reine" 5" id="L75" clade=reine" f="+code=snap_empty_lock" class="sref">snap_empty_lock);
">  74                 * sn2 the files contained by 2each 227list_del_init(&asnap.c#L64" id="L64" class="line" name="L64"n= snap.c#L64" id=de=refir=reia ryss="sref">realmde=refir=reia ryf="+code=snap_empty_lock" class="sref">snap_empty_lock);
  63                  2nt"> *
realm)
  76                 * Th2plicitly created on that2 real229list_del_init(&aa href="+code=mde=redelss="sref">realmde=redelref="+code=nref" class="sref">nref)+1);
  76                 * pa2rent's snap set _aft2er_ t230in_unlock(&mdsc->snap_empty_lock);
  77        }
 * pa2rent (due to, say, a ren2ame).231in_unlock(&/*
/snap.c#L66" id="L66" class="line" name="L66"">  67         * du2ring the time intervals 2durin232in_unlock(&mdsc->snap_empty_lock);
  75                 *
 * Th2e client is spared most 2of th234/a>(&mdsc->snap_empty_lock);
  77        }
 * di2intains a hierarchy of r2ealms23L56">>  81
 * re2alm relationship, and fo2r eac23L57">  57 * in2herited from prior paren2ts.
(struct 
realmt 
ent *mdsc,
  63                  2nt"> *
  74                 * A 2snap_realm struct is mai2ntain23(&snap_empty_lock);
realmgceph0cephme="L>  67         * wi2th an open cap in the sy2stem.24 /a>(&realm51>
>  67         * pa2ovided by the MDS whenev2er a 241/a>(&snap_empty_lock);
realmgceph0cephme="L>  67         * du2rsion number is used to 2ensur242L81">  81
 * sn2apshot, new parent, etc.2) the24379">  79         *
  12 * Th2e realm hierarchy drives2 the 24eflecting the current parent/c#L70" eine"p>
  12 * re2alm, which simply lists 2the r24ulting set of snaps for the repointers,f="fs"L59" claseappropriatelye="L61">  61 * is2 attached to any writes 2sent 24 OSDs.
  61 *

  72/*
  72 * Un2fortunately error handli2ng is25rite.
  61 * up2date, but don't have2 enou2562" id="L62" class="line" name="L49">  49 * it2's not clear what we2 can 25
realmeL70" L51" clasen_p>
ent *mdsc,
  63                  2nt"> * co2nsole).

realm)
  63                  2nt"> *

  63                  2snap.c#L526" id="L56" class="line"2 name25lass=>  74                 * re27" id="L57" class="line"2 name256list_del_ini>
realm)

realmp>
  67        /*
 * in2crease ref count for the2 real258ass="string"mp;nref);



  63                  2st">/*
 * ca2ller must hold snap_rwse2m for26L11">  11 */

realmp>
)
realm)
/snap.c#L66" id=p>

>  67         * it2t_snap_realm" class="sre2f">ce262ass="string"mp;
realmp>
  74                realmp>
)
realm)
/snap.c#L66" id=p>

>  67         *(&realmp>
  63                  2/nap.c#L52" class="sref">dout(2list_del_init(&aph_snap_ax_looksnap.c#L64" id=PTR_ERR class="line" nPTR_ERR.1realmp>
  67         * re2=atomic_read" class="sre2f">at266ass="string">  81
/*
"get_realm %p %d -> %d\n", 
,llxm" clas:m,llxm" class>realm,llxm" clas * in2    * since we _only_ in2creme268ass="string""""""a href="+code=r"L66" class="line" name="L66"eph/snap.c#L80" id="ino class="line" ninoin_u;/snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="p>

/snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="p>
realmp>

/*snap.c#L66" id=p>

realmp>
  67             2    * safe.  we do need 2to pr270in_unlocknref);
realmp>
  74                     2    * additions, however2.(&realm->empty_item);
  10
     2    */
/*
/snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="p>
realmp>
  10
ato273/a>(&  81
s274/a>(&nref);

snap.c#L66" id=p>

  10
"get_real"L66" class="line" name="L66"eph/snap.c#L80" id="p>
realmp>
snap.c#L66" id=p>
realmp>
  67        "get_realt /*
/snap.c#L66" id=p>
realmp>
  10

"get_realde=reads="sref">realmnref)+1);

realmp>
realm  10
 * in29" id="L79" class="line"2 name278ass="string"ax_look1>  10
/*ato2mic_i2c(>  81
  11
<2a href="f2s/ceph/sc="L81">c_inc(&am28realmrealme/cep;realmbL63">  63                  28="+code=28tomic_read" class="sref28>ato284" id>  74                s284/a>(&realme/cepnph/d<*aap.c#L63" id="Lu65" id="L65ne" nau="L65" *)snap.c#L64" id=bss="sref">realmbL63">  63                  28nap.c#L528de=list_del_init" class28"sre28>list_del_init(&aax_look1>  10
realme/cepnpg/d<*aap.c#L63" id="Lu65" id="L65ne" nau="L65" *)snap.c#L64" id=bss="sref">realmbL63">  63                  28="commen28nap.c#L78" id="L78" cla28s="l287list_del_init(&aax_look-1>  10
 * in2aan>
  67        ato28ic_i28(>  81
  11  12c_inc  12  49s294a href="+hrintrealment *realm)
  63                  29href="+c29de=list_del_init" class29"sre29lass=>  74                
realm)

realmp>
realmp>
  67        realm)
<51" c46" cla.1 * in29id="L9" class="line" na29name298ass="string"mntrealmer"="eph= 0>  67        (&realmnu"_ps="l_p>
realmnu"_51" =="ep>  67          11/*
  12 * Sn30pshots in ceph are driv302nam30 about it (besides complainiiiiiiiiingbuame p>

  12 *
ebe="L12">  12 *  12 *  49 * wh30ther a write logically 306nam30pin_unlockrealmp>
  74                 * of30pshot.

realmp>
realm  74                 * of30id="L9" class="line" na308nam308ass="string"""""""""&realmer"="eph= a href="+code=rbuameL51" c46" cla="sref">realm
realmp>
  10
 * Th30s provides a perfect in309nam309list_del_init(&anlockrealmer"="ep>  63                  3tnap.c#L131" id="L11" class="line"3 name310in_unlock(&<<<<<<<<<<<<<<<<realmfail="ep>  67        /*
 * Sn3apshots in ceph are driv3en in312in_unlock(&
realmp>
realmrealmnu"_51" =="ep>  67         * cl3ient.  In contrast to lo3cal f313/a>(&  81
 * im3plement snapshots at a s3ingle31oint   10
 * di3stributed access to stor3age r315/a>(&  49 * wh3ether a write logically 3occur31ulting set of snaps for the           mat#L4s" name seq,f="fsmy p>
  15 * sn3apshot.
  15 * of3pan>
  49 * Th3is provides a perfect in3stant31(&nref)+1);
realm * cl3ients, however, snapshot3s may320in_unlock(&aa href="+code=rref">nref)+1);
realmnref)+1);
/*(&a
realmp>
 * Sn3ppshots in ceph are driv3nn in322in_unlock(&ama href="+code=rref">nref)+1);
realm
realmp>
realm">  74                 * cl3pan>
,llxm" clas:m,p seqm,lld (,um51" =) href="fs/cep  74                 * im3apshots are _not_ file s3ystem32n_lock(&, 
 * di3plies to the subdirector3y nes32>list_del_init(&aph_sna href="+code=rref">nref)+1);
/snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="cc#L48c46" cla="sref">realm * wh3fectively divides the hi3erarc32pin_unlock(&nref)+1);
realm * sn3 the files contained by 3each 327list_del_init(&aa>(&anref)+1);
realmrealmnu"_51" =="ep4>  10
 *  67         * Th3plicitly created on that3 real329list_del_ini>  81
 * pa3rent's snap set _aft3er_ t33L11">  11 * pa3rent (due to, say, a ren3ame).331/a>(&  49 * du3ring the time intervals 3durin332in_unlockrealmer"="eph= -href="+code=reaENOMEMss="sref">realmENOMEM="ep>  67         *
"/ sizeof(ap.c#L63" id="Lu65" id="L65ne" nau="L65"4>  63                  3nt"> * Th3e client is spared most 3of th33n_lock(&realmfail="ep>  67         * di3intains a hierarchy of r3ealms33lass="string">"get_real/1"  class="line" na51"  ="eph= a href="+code=rkzallocclass="line" nakzalloc.1izeof(/snap.c#L64" id=51"  class="line" na51"  ="ep"h+ snap.c#L64" id=nu" class="line" nnu"="ep*sizeof(ap.c#L63" id="Lu65" id="L65ne" nau="L65"4>/snap.c#L66" id=GFP_NOFS" id="L65ne" naGFP_NOFS="ep4>  10
 * re3alm relationship, and fo3r eac33pin_unlock
 * sn3herited from prior paren3ts.(&agoto a href="+code=rfailss="sref">realmfail="ep>  67         *
"get_reallm" clase="sref">mdsclm" clasehref="+code=empty_item" cl51"  class="line" na51"  ="eps/ceph/snap.c#L67" id="L67" class="line" name=", 7">  67         * A 3snap_realm struct is mai3ntain33979">  79         * wi3th an open cap in the sy3stem.34 /a>(&  49 * pa3ovided by the MDS whenev3er a 341/a>(& * du3rsion number is used to 3ensur342in_unlocknref)+1);
 *(&realmp>
  74                 *
 * di3e realm hierarchy drives3 the 34eflec  67         * re3alm, which simply lists 3the r34pin_unlock(&  49 * sn3 attached to any writes 3sent 34 OSDs.
  49 *

realmp>
realmrealmnu"_51" =="ep>nhref="+code=reai class="line" ni="_u++"  10
/*
realmp>
realmrealm51" =="ep[href="+code=reai class="line" ni="_u]nk
 * Un3fortunately error handli3ng is350in_unlock(&<<<<<<<<<<<<nref)+1);

realmp>

 * up3date, but don't have3 enou351in_unlock(&realm51" =="ep[href="+code=reanu" class="line" nnu"="ep++] =  10
 * du3's not clear what we3 can 352in_unlock(&<>(&
realmp>
realmrealm51" =="ep[href="+code=reai class="line" ni="_u]>  67         * co3nsole).
realmp>
realm
 *

realmp>
realm * di36" id="L56" class="line"3 name35lass="string">  81
 * re37" id="L57" class="line"3 name356ass="string">"get_realmemcpp5" id="L75" clamemcpp#37;d\nap.c#L64" id=51"  class="line" na51"  ="eps/ceph/snap.c#L67" i/1" =ss="sref">realm51" =="eph+ snap.c#L64" id=nu" class="line" nnu"="ep>/snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="/1" =ss="sref">realm51" =="eph  81
/*
);
realmnu"_51" =="ep4>  10
 * in3crease ref count for the3 real358ass="string">"get_realnu" class="line" nnu"="eph+=>snap.c#L66" id=6L66" class="line" name="L66"eph/snap.c#L80" id="nu"_51" =ss="sref">realmnu"_51" =="ep>  67        /*
realm51" =="eph+ snap.c#L64" id=nu" class="line" nnu"="ep>/snap.c#L66" id="L66" class="line" name="L66"eph/snap.c#L80" id="ps="l_p>
realmps="l_p>

 * ca3ller must hold snap_rwse3m for360in_unlock(&sizeof(ap.c#L63" id="Lu65" id="L65ne" nau="L65"4/snap.c#L64" id="L64" class="line" name="L64"ck);
realmnu"_ps="l_p>
  10
 */
realmnu"_ps="l_p>
  10
 * du3t_snap_realm" class="sre3f">ce36">   3#include <realmrealm51" =="ep>/snap.c#L66" id=nu" class="line" nnu"="ep>/sizeof(ap.c#L63" id="Lu65" id="L65ne" nau="L65"4>/snap.c#L66" id=cmpu64clav  sref">realm/snap.c#L66" id=NULL  sref">realm  10
 *(&a=empty_item" cl51"  class="line" na51"  ="eps/ceph/snap.c#L67" idu"_51" =ss="sref">realmnu"_51" =="epn= snap.c#L64" id=nu" class="line" nnu"="ep>  10
 * di3" class="sref">dout(3"get_realm %p %d -> %d\n", ,llxm" clas:m,p seqm,lld (,um51" =) * re3=atomic_read" class="sre3f">at36pin_unlock(&amsnap.c#L66" id=6L66" class="line" name="L66"eph/snap.c#L80" id="ino class="line" ninoin_u;/snap.c#L66" id=51"  class="line" na51"  ="ep>/snap.c#L66" id=51"  class="line" na51"  ="epck);
/*
realmnu"_51" =="ep4>  10
 * in3    * since we _only_ in3creme368ass=  10
/*(&nref)+1);
realm
     3    * safe.  we do need 3to pr370in_unlock(&realm)
nref)+1);
realm  10
     3    * additions, however3.(&nref)+1);
realm * du3    */
ato37379">  79        s374/a>(snap.c#L64" id=failss="sref">realmfail="ep:  79         * di3ode=list_del_init" class3="sre375/a>(&  49
  49
  49 * in39" id="L79" class="line"3 name379" id="L39" class="line" nammmmmmmmmne="L49">  49/*ato3mic_i37(&nref)+1);
realm  74                (&realm)
nref)+1);
realm  10
(&nref)+1);
realmrealm  10
 * du3s/ceph/sc="L81">c_inc(&am382in_unlock  81
realmpr_er"#37;d\n", ,llxm" clas failm" clad
s38n_lock(&/snap.c#L66" id=er"ss="sref">realmer"="ep>>  10
 * di38de=list_del_init" class38"sre38>list_del_iniax_looksnap.c#L64" id=er"ss="sref">realmer"="ep>  10
  81
 * in3aan>
  49ato38ic_i38 for realms containing every i0"buame"s="c 46" cla"lineine"given  namef="fsall op;its anamer

.="L12">  12  49(>
="+href="fs/ceph/snap.c#L0"buameL51" c0" id= class="line" nambuameL51" c0" id=#37;d>ent *realm)
  63                  39 href="f39/ceph/sc="L81">c_inc  74                realm)
realm  10
s39oint   10
"get_realm %p %d -> %d\n", ,llxm" clas>  10
"get_realbuameL51" c46" cla="sref">realm>  10
 * in39id="L9" class="line" na39name398ass="string">"get_realde=refor_ec#Leia ryss="sref">realmde=refor_ec#Leia ry.1realmnref)+1);
realm/snap.c#L66" id=cname6" id="L76" class="l name6" id/cep4  80}
(&aa href="+code=m0"buameL51" c0" id= class="line" nambuameL51" c0" id=#37;dsnap.c#L66" id=aname="sref">realm>  10
>  81
/*

<4nt"> * Sn40pshots in ceph are driv402nam40">   3#include < *  49 *  49 *
=nce,amp;anye="L61">  61 * wh40ther a write logically 406nam40ulting set of snaps for the re="L49">  49 * of40pshot.
/snap.c#L66" id=__le65" id="L65ne" na__le65/ceph/snap.c#L64" id=sr class="line" na5r ="ep>/snap.c#L66" id=uring the tine" nau32in_unhref="+code=reanu" class="line" nnu"="ep4  80}
 * of40id="L9" class="line" na408nam408" na>  74                 * Th40s provides a perfect in409nam40(&  11/*
>  10
 * Sn4apshots in ceph are driv4en in412in_unlock  74                 * cl4ient.  In contrast to lo4cal f413/a>(&/snap.c#L66" id=GFP_NOFS" id="L65ne" naGFP_NOFS="ep4>  10
 * im4plement snapshots at a s4ingle41n_lock(&  10
 *list_del_init(&aph_snap_ax_look-href="+code=reaENOMEMss="sref">realmENOMEM="ep>  67         * wh4ether a write logically 4occur41pin_unlock(&
 * sn4apshot.
[href="+code=reai class="line" ni="_u]n= a href="+code=rge"Lunalignce_le65" id="L65ne" nage"Lunalignce_le65.1 * of4pan>
  74                 * Th4is provides a perfect in4stant419list_del_init(&a/snap.c#L64" id=ds#37;p %d ->st/ceph= a href="+code=rNULL  sref">realm  10
 * cl4ients, however, snapshot4s may420in_unlock  81
/*  67         * Sn4ppshots in ceph are driv4nn in422in_u>  81
 * cl4pan>
  79         * im4apshots are _not_ file s4ystem42oint   10
 * di4plies to the subdirector4y nes42eflecting the current parenme="L49">  49 * wh4fectively divides the hi4erarc42ulting set of snaps for the r Whe" am51" =hpanis applied, ine"size/mtimerin idemetadatanis queued="L49">  49 * sn4 the files contained by 4each 42 OSDs.
  49 * of4apshots.  An individual 4realm429" id="L39" class="line" namngcompletese="fsine"metadatanc39"be  61 * Th4plicitly created on that4 real42 for realms containing every ="L61">  61 * pa4rent's snap set _aft4er_ t43rite.
  49 * pa4rent (due to, say, a ren4ame).432" id="L12" class="line" naph ine"s="c=hpa, we f="fsh/swait untileine"" namnsucceeds inefaile="L15">  15 * du4ring the time intervals 4durin43 about it (besides complaining(="fsa final"size/mtimeris known).  In h/snacaseeape="L12">  12 *
  12 * im4e client is spared most 4of th43 detail, fortunately... it m* finishas, we __a>)
  61 * di4intains a hierarchy of r4ealms43eflecting the current parente="L61">  61 * wh4alm relationship, and fo4r eac43ulting set of snaps for the r Caller must home"s="c_rwsem
  61 * sn4herited from prior paren4ts.
  61 * of4pan>
  49 * A 4snap_realm struct is mai4ntain43979">ef="fs/ceph/snap.c#La>)
realm)
ent *  10
 * wi4th an open cap in the sy4stem.44 /a>(>  74                 * pa4ovided by the MDS whenev4er a 441/a>(&ent * * du4rsion number is used to 4ensur442in_unlockent *realm)
realm  10
 *(&realm/snap.c#L66" id=dirtL37;p %d ->irtL="ep>  10
 * im4pan>
 * di4e realm hierarchy drives4 the 44lass="string">"get_reala"c=lm"="sref">realmizeof(/snap.c#L64" id=a"c=lm"="sref">realm/snap.c#L66" id=GFP_NOFS" id="L65ne" naGFP_NOFS="ep4>  10
 * re4alm, which simply lists 4the r44pin_unlockrealm  74                 * sn4 attached to any writes 4sent 447list_del_init(&asnap.c#L64" id=pr_er"ss="sref">realmpr_er"#37;d\n",   10
 * of4span>
  10
 * A 4pan>
 * Un4fortunately error handli4ng is45L11">  11 * up4date, but don't have4 enou451/a>(&)
)
  10
 * du4's not clear what we4 can 452in_unlockrealmrealm)
>  10
 *
)
)
>  10
 * im4span>
 * di46" id="L56" class="line"4 name455/a>(&  49 * re47" id="L57" class="line"4 name45ulting set of snaps for the         * If inereris ae" namnin progress, i nateap.c#as aedirtL Fw,="L49">  49 * sn4pan>

  49 * of4crease ref count for the4 real459" id="L39" class="line" nammmmmmmmmn up h/snacac=lm";it willsbee="L61">  61/*
  49 * ca4ller must hold snap_rwse4m for460in_unlockrealmrealm  10
 */
realm  10
 * du4t_snap_realm" class="sre4f">ce46">   3#include <)
realm)
4">  74                 *(&  49 * di4" class="sref">dout(4  49 * re4=atomic_read" class="sre4f">at46ulting set of snaps for the                   " nams in progress now""ererstartad beforeeape previoue="L15">  15/*
  49 * of4    * since we _only_ in4creme468ass="string"""""""""a href="+code=md %p %d -> %d\n",   10
/*(&aa href="+code=mkfree class="line" nkfree#37;dsnap.c#L64" id=a"c=lm"="sref">realm  10
     4    * safe.  we do need 4to pr470in_unlockrealmrealm
 */(&realmrealm4">  74                 * du4    */
realm)
<51" c46" cla.1  10
ato47379">  79        s47n_lock(&  49 * di4ode=list_del_init" class4="sre47eflecting the current parentiiiiiiiiiiiiiiii* mp;we arera sync " nam, we may#s/ceph/sgoph/sine"s="ca href=L49">  49 * re4ode=spin_unlock" class="4sref"47ulting set of snaps for the         iiiiiiii* h/sgetsine"cur,fs/"s="cce="L61">  61
  49 * in49" id="L79" class="line"4 name478ass="string"""""""""mp;
/*ato4mic_i479list_del_init(&a<<<<<<<realm  11(& * du4s/ceph/sc="L81">c_inc(&am482in_unlock(&<>(&amsnap.c#L66" id=in id class="line" ninode/cep>/snap.c#L66" id=c"c=lm"="sref">realm/snap.c#L66" id=51"  class="line" na51"  ="ep>/snap.c#L66" id=a>)
, realm)
,   10
s48oint   10
 * di48de=list_del_init" class48"sre48>list_del_init(&asnap.c#L64" id=lm" clase="sref">mdsclm" clasehref="+code=empty_item" clc"c=lm"="sref">realm  67        (&realm  67        realm  67         * in4aan>
realm  67        /*ato48ic_i48979">  79        realm(&realmrealmrealm)
/snap.c#L66" id=NULL  sref">realm  10
c_inc(&realm  79        s49n_lock(&realm * di49de=list_del_init" class49"sre49>list_del_init(&asnap.c#L64" id=t"c=lm"="sref">realmrealmrealm  10
(&realmrealmrealm  10
 * in49id="L9" class="line" na49name498ass="string"""""""""mp;realm  74                (&a>(&)
realm)
>  10
(&<<<<<<<<realmrealm
(&)
mdsca>)
realmrealm>  10
c_inc(&<>(&realmrealmrealmrealm  10
  74                 *realmrealmrealm  10
 *list_del_init(&aph_snap_aempty_item" clc"c=lm"="sref">realmrealm  67         * wh50ther a write logically 506nam50pin_unlock(&<>  81
 * of50pshot.
 * of50id="L9" class="line" na508nam508ass="string"""""""""a"L12" class="line" name#dirtL page count moved from _hea"ph/sinsnacacealm";="L49">  49 * Th50s provides a perfect in509nam50 for realms containing everymmmmmmmmmmmmmmmmmmall sub5equfs/"" nams page dirtie= occur _after_ insn="L49">  49
  49/*
realmrealmrealm  10
 * Sn5apshots in ceph are driv5en in512in_unlock(&realm  67         * cl5ient.  In contrast to lo5cal f513/a>(&realmrealm * im5plement snapshots at a s5ingle51n_lock(&
 *list_del_init(&aph_snap_snap.c#L64" id=a>)
realm)
realm * wh5ether a write logically 5occur51pin_unlock(&>  10
 * of5apshot.
realmde=readd_tailref="+code=empty_item" clc"c=lm"="sref">realm>  10
 * of5pan>
 * Th5is provides a perfect in5stant519list_del_init(&realmrealm">  74                 * cl5ients, however, snapshot5s may520in_unlock(&<<<<<<<<, /*(&, 
 * Sn5ppshots in ceph are driv5nn in522in_unlock(&<>(&realm/snap.c#L66" id=51"  class="line" na51"  ="ep>/snap.c#L66" id=51"  class="line" na51"  ="epck);
 * cl5pan>
realm);
realm  10
 * im5apshots are _not_ file s5ystem52n_lock(&  74                 * di5plies to the subdirector5y nes52>list_del_init(&aph_snap_s"L12" class="line" name#note mtime>/size NOW.mne="L49">  49 * wh5fectively divides the hi5erarc52pin_unlock(&)
realm)
/snap.c#L66" id=a"c=lm"="sref">realm  10
 * sn5 the files contained by 5each 527list_del_init(&a>  81
 * of5apshots.  An individual 5realm528ass="string"} else">  74                 * Th5plicitly created on that5 real529list_del_init(&aa href="+code=md %p %d -> %d\n",   10
 * pa5rent's snap set _aft5er_ t530in_unlock(&realm  10
 * pa5rent (due to, say, a ren5ame).531in_unlock  81
 * du5ring the time intervals 5durin53">   3#include < *
)
)
  10
 * im5e client is spared most 5of th53 deta>  81
 * di5intains a hierarchy of r5ealms53eflec  81
 * wh5alm relationship, and fo5r eac53ulting set of snaps for theme="L49">  49 * sn5herited from prior paren5ts.
/settle onmfinal"valuen="L49">  49 * of5pan>
  61 * A 5snap_realm struct is mai5ntain53 for realms containing every ="L61">  61 * wi5th an open cap in the sy5stem.54rite.
  61 * pa5ovided by the MDS whenev5er a 542" id="L12" class="line" naph="L61">  61 * du5rsion number is used to 5ensur54 about it (besides complainingCaller must home"i_a>)
  61 *  49 * im5pan>
)
realm)
ent *
 * di5e realm hierarchy drives5 the 54>list_del_init(&aph_snap_____>ent *realm)
realm
 * re5alm, which simply lists 5the r54pin_u>  74                 * sn5 attached to any writes 5sent 547list_del_ini>ent * * of5span>
ent *realm)
)
<5b_to_clie" n"sref">realm)
<5b_to_clie" #37;dsnap.c#L64" id=in id class="line" ninode/ceps/ceph/snap.c#L67" ii_sb="sref">realm * A 5pan>
  79         * Un5fortunately error handli5ng is550in_unlockrealm);
realm  10
 * up5date, but don't have5 enou551/a>(&realm);
 * du5's not clear what we5 can 552in_unlockrealm *
realm * im5span>
realm * di56" id="L56" class="line"5 name555/a>(&realm * re57" id="L57" class="line"5 name55pin_unlockrealmrealm">  74                 * sn5pan>
, ,llu " clas s=,llu "href="fs/cep  74                 * of5crease ref count for the5 real558ass="string"""""""""a>(&ahn", /snap.c#L66" id=c"c=lm"="sref">realm  74                 * A 5pan>
realmrealmrealmrealm * ca5ller must hold snap_rwse5m for560in_unlock(&<<<<<<> *realm)
, realmrealm);
 * up5span>
realmrealm>  10
 * du5t_snap_realm" class="sre5f">ce562in_unlock(&  67         *(&, ,llu " clas s=,llu * di5" class="sref">dout(5list_del_initsnap.c#L66" id=in id class="line" ninode/cep>/snap.c#L66" id=c"c=lm"="sref">realmm=empty_item" clc"c=lm"="sref">realmrealm * re5=atomic_read" class="sre5f">at56pin_unlock(&amsnap.c#L66" id=c"c=lm"="sref">realmrealm, realm)
, realm * sn5t">/*
realm);
 * of5    * since we _only_ in5creme568ass=  10
/*     5    * safe.  we do need 5to pr570in_unlockrealmde=readd_tailref="+code=empty_item" clci class="line" nci/ceps/ceph/snap.c#L67" ii_51" cllush_" id="L76" class="li_51" cllush_" id="_u> * up5    * additions, however5.(& * du5    */
)
  49ato57379">>  81
s57oint   10
 * di5ode=list_del_init" class5="sre57eflecting the current parenme="L49">  49 * re5ode=spin_unlock" class="5sref"57ulting set of snaps for the * Queue cadealm"s linealm"m" namback lineinis" namef="fssts childrene="L61">  61

  61 * of59" id="L79" class="line"5 name579" id="L39" class="line" namne="L49">  49/*ato5mic_i579listef="+href="fs/ceph/snap.c#Lqueue< name_aadealm"sclass="line" naqueue< name_aadealm"s#37;d>ent *
(>  74                (&ent *  10
 * du5s/ceph/sc="L81">c_inc(&am582in_unlockent *realm  10
s58oint   10
 * di58de=list_del_init" class58"sre585/a>(&, ,llxrin ids
>  10
 * of5aan>
/ode=snap_empty_lock"r" idclass="line" nar" id/ceps/ceph/snap.c#L67" iinoids_wit
  81
/*ato58ic_i589list_del_init(&a>(&<snap.c#L66" id=id51" cr" id_" id="L76" class="li_51" cr" id_" id="ep>">  74                realm(&
 * du59/ceph/sc="L81">c_inc(&<<<<<<<<  10
>  10
s59n_lock(& * di59de=list_del_init" class59"sre59>list_del_init(&<snap.c#L66" id=ip%p %d -&gip&##37;dsnap.c#L64" id=asstin id class="line" nasstin id="ep4>  10
(&  10
realm)
  10
 * of59id="L9" class="line" na59name598ass="string"""""""""h/snap.c#L67" i/pin_lockclass="line" na5pin_lock#37;dode=snap_empty_lock"r" idclass="line" nar" id/ceps/ceph/snap.c#L67" iinoids_wit
>  10
  81
>  10
c_inc(&  79         *  74                 *list_del_init(&a=/snap.c#L67" id %p %d -> %d\n", ,llxrqueue childr" clasm,llx * wh60ther a write logically 606nam60pin_unlock(&(&a=/snap.c#L67" ir" idclass="line" nar" id/cephmsnap.c#L66" id=r" idclass="line" nar" id/ceps/ceph/snap.c#L67" iino class="line" nino="ep><> * * of60pshot.
 * of60id="L9" class="line" na608nam608ass="string"""""""""a/snap.c#L67" ide=readdss="sref">realmde=readdref="+code=empty_item" clchildclass="line" nadhild="eps/ceph/snap.c#L67" idirtL_" id="L76" class="ldirtL_" id="ep>/ode=snap_empty_lock"r" idclass="line" nar" id/ceps/ceph/snap.c#L67" idirtL_" id="L76" class="ldirtL_" id="ep>>  10
 * of60/linux/ceph/decode.h" c609nam609list_del_ini>  81
  11/*
 * Sn6apshots in ceph are driv6en in612in_unlock, ,llxrdone * cl6ient.  In contrast to lo6cal f61379">>  81
 * im6plement snapshots at a s6ingle61oint   10
 *  49 * wh6ether a write logically 6occur61ulting set of snaps for the * Parsef="fsapplyra s="cblob "href=alm"mtraceref="+ from ine"MDS.  Tnis"specifien="L49">  49 * of6apshot.
  49 * of6pan>
  61 * Th6is provides a perfect in6stant61 for realms containing every ="L61">  61 * cl6ients, however, snapshot6s may62rite.
  61/*  49 * Sn6ppshots in ceph are driv6nn in622in_umntrealm)
ent *realm)
 * cl6pan>
realmmef="f/snap.c#L64" id=e="sref">realm/snap.c#L66" id=boolss="sref">realmbool/a>(&href="+code=readeletio
  sref">realm
 * im6apshots are _not_ file s6ystem62n_loc>  74                 * di6plies to the subdirector6y nes62>list_del_ini>ent *k  49 * wh6fectively divides the hi6erarc62pin_unlock(&(&a="L12" class="line" name#en" iddphe="L49">  49 * of6 the files contained by 6each 627list_del_inih/snap.c#L67" i__le65" id="L65ine" n__le65/ceph/snap.c#L64" id=prior_pare" ealm"sclass="line" naprior_pare" ealm"s#37;;nlock  49 * of6apshots.  An individual 6realm628ass="string">ent *  10
 * Th6plicitly created on that6 real629list_del_inimnt * pa6rent's snap set _aft6er_ t630in_unlockrealmrealm  10
 * pa6rent (due to, say, a ren6ame).631/a>(&realm * du6ring the time intervals 6durin63">   3#include < *
, ,drealm  10
 * im6e client is spared most 6of th63 detasnap.c#L64" id=moreclass="line" namoredeta:  10
 * di6intains a hierarchy of r6ealms635/a>(&realmmsnap.c#L64" id=e="sref">realm/5izeof(/snap.c#L64" id=ri class="line" nri/cep4>/snap.c#L66" id=ba"="sref">realm  10
 * wh6alm relationship, and fo6r eac63pin_unlockrealm  10
 * of6herited from prior paren6ts.realm  10
 * of6pan>
realmmsnap.c#L64" id=e="sref">realm/5izeof(snap.c#L64" id=u65" id="L65ine" nu65/cep)*dsnap.c#L64" id=ae32_to_cpu37;p %d -&gde32_to_cpuref="h/snap.c#L67" iri class="line" nri/ceps/ceph/snap.c#L67" idumealm"sclass="line" nadumealm"s="ep>"+  10
 * Th6snap_realm struct is mai6ntain639list_del_init(&a>(&<snap.c#L66" id=ae32_to_cpu37;p %d -&gde32_to_cpuref="h/snap.c#L67" iri class="line" nri/ceps/ceph/snap.c#L67" idumeprior_pare" ealm"sclass="line" nadumeprior_pare" ealm"s="ep>4>/snap.c#L66" id=ba"="sref">realm  10
 * wi6th an open cap in the sy6stem.640in_unlockrealm  10
 * pa6ovided by the MDS whenev6er a 641/a>(&realmsnap.c#L66" id=ae32_to_cpu37;p %d -&gde32_to_cpuref="h/snap.c#L67" iri class="line" nri/ceps/ceph/snap.c#L67" idumealm"sclass="line" nadumealm"s="ep>>  10
 * du6rsion number is used to 6ensur642in_unlockrealm  10
 *(&realmsnap.c#L66" id=ae32_to_cpu37;p %d -&gde32_to_cpuref="h/snap.c#L67" iri class="line" nri/ceps/ceph/snap.c#L67" idumeprior_pare" ealm"sclass="line" nadumeprior_pare" ealm"s="ep>>  10
 * im6pan>
 * di6e realm hierarchy drives6 the 645/a>(& * wh6alm, which simply lists 6the r64pin_unlock  74                 * sn6 attached to any writes 6sent 647list_del_init(&ah/snap.c#L67" ir" idclass="line" nar" id/ceph= a href="+code=ra>)
 * of6span>
realm  74                 * Th6pan>
realmrealm  10
 * Un6fortunately error handli6ng is650in_unlock(&<<<<<<<<realmfailref=>  10
 * pa6date, but don't have6 enou651in_unlock(&<>  81
 * du6's not clear what we6 can 652in_unlock  81
 *
  79         * im6span>
  49 * di66" id="L56" class="line"6 name655/a>(&realmrealmrealm>>  10
 * re67" id="L57" class="line"6 name65pin_unlockrealm
 * sn6pan>
realmfailref=>  10
 * of6crease ref count for the6 real658ass="string"h/snap.c#L67" iinvalidate class="line" ninvalidate="eph+= aempty_item" clerr="sref">realm  10
 * Th6pan>
  79         * ca6ller must hold snap_rwse6m for660in_unlock * up6span>
, ,llxr" clasm,lld s/cepm,lld * du6t_snap_realm" class="sre6f">ce662in_unlock(&  49 *(& * di6" class="sref">dout(6list_del_initp; * re6=atomic_read" class="sre6f">at66pin_unlock(&realmrealm * sn6t">/*
 * of6    * since we _only_ in6creme668ass="string"""""""""a/snap.c#L67" ir" idclass="line" nar" id/ceps/ceph/snap.c#L67" idumealm"sclass="line" nadumealm"s="eph= aempty_item" clae32_to_cpu37;p %d -&gde32_to_cpuref="h/snap.c#L67" iri class="line" nri/ceps/ceph/snap.c#L67" idumealm"sclass="line" nadumealm"s="ep>>  10
/*(&a=/snap.c#L67" ierr="sref">realm/snap.c#L66" id=51" sclass="line" naalm"s#37;>/snap.c#L66" id=r" idclass="line" nar" id/ceps/ceph/snap.c#L67" idumealm"sclass="line" nadumealm"s="ep>>  10
     6    * safe.  we do need 6to pr670in_unlock(&realm
 * up6    * additions, however6.(&realmfailref=>  10
 * du6    */
   3#include <ato673/a>(& *s674/a>(& * di6ode=list_del_init" class6="sre67>list_del_initp;realm/snap.c#L66" id=prior_pare" ealm"sclass="line" naprior_pare" ealm"s#37;>  10
 * re6ode=spin_unlock" class="6sref"67pin_unlock(& * sn6ppshot.
realm
 * of69" id="L79" class="line"6 name678ass="string"""""""""a>(&a<<realmfailref=>  10
/*ato6mic_i67979">  79        (&  49(&realmde=readdref="+code=empty_item" clr" idclass="line" nar" id/ceps/ceph/snap.c#L67" idirtL_" id="L76" class="ldirtL_" id="ep>/ode=snap_empty_lock"dirtL_r" ids="sref">realm * du6s/ceph/sc="L81">c_inc(&am68">   3#include <s684/a>(&realm * di68de=list_del_init" class68"sre68>list_del_init(&a=/snap.c#L67" id %p %d -> %d\n", ,llxr" clasmseqm,lld new(&(&a=/snap.c#L67" ir" idclass="line" nar" id/ceps/ceph/snap.c#L67" iino class="line" nino="ep><> * * sn68nap.c#L78" id="L78" cla68s="l687list_del_init(&ah/snap.c#L67" iinvalidate class="line" ninvalidate="eph= 1>  10
 * of6aan>
  74                /*ato68ic_i689list_del_init(&a=/snap.c#L67" id %p %d -> %d\n", ,llxr" clasmseqm,lld un nanged  81
 * du69/ceph/sc="L81">c_inc   3#include <, ,d,r" clasm,ps69n_lock(& *realm>  10
 * di69de=list_del_init" class69"sre69>list  10
realmrealm  10
 * sn69nap.c#L78" id="L78" cla69s="l697list_del_init(&agoto aempty_item" clmoreclass="line" namoredeta>  10
 * of69id="L9" class="line" na69name698ass=  10
  49(&realm  10
c_inc   3#include <  49  49 *  61 * wh70ther a write logically 706nam70ulting set of snaps for the ppppppppee="L49">  49 * wh70nap.c#L78" id="L78" cla707nam707list_del_iniwhile;realm * of70id="L9" class="line" na708nam708ass="string"""""""""a/snap.c#L67" ir" idclass="line" nar" id/ceph= a href="+code=rde=relir=ree" rL37;p %d -&gde=relir=ree" rLref="+code=empty_item" cldirtL_r" ids="sref">realment *3#include < * of70/linux/ceph/decode.h" c709nam709list_del_init(&a>(&<ring"""""""""a/snap.c#L67" idirtL_" id="L76" class="ldirtL_" id="ep>>  10
(&  10
/*
 * Sn7apshots in ceph are driv7en in71">   3#include < * cl7ient.  In contrast to lo7cal f713/a>(&realm  10
 *list  10
 * wh7ether a write logically 7occur71ulting/snap.c#L67" iba"="sref">realm
 * of7apshot.
realmrealm  10
 * of7pan>
realmfailref=:  10
 * of7is provides a perfect in7stant719list_del_inih/snap.c#L67" ipr_err="sref">realm, ,drealm  10
 * cl7ients, however, snapshot7s may720_lock(&aax_looksnap.c#L66" id=err="sref">realm  10
/*  81
 * Sn7ppshots in ceph are driv7nn in72">   3#include < * cl7pan>
  79         * im7apshots are _not_ file s7ystem724/a>(="L12" class="line" name="L49">  49 * di7plies to the subdirector7y nes72eflecting the current parenp* Se"fsany cadealm"s inat are#queuedflineflush.  Tryph/saarrLreL49">  49 * wh7fectively divides the hi7erarc72ulting set of snaps for the * s_mu cl across multiple"alm";flushesph/saef="flock   61 * of7 the files contained by 7each 72 OSDs.
  61 * of7apshots.  An individual 7realm729" id="L39" class="line" namnpCaller homes noflockse="L61">  61 * of7plicitly created on that7 real72 for realms containing every e="L49">  49 * pa7rent's snap set _aft7er_ t730in_uef="+href="fs/ceph/snap.c#Lflush_alm"sss="sref">realmflush_alm"s#37;d>ent *realm)
 * pa7rent (due to, say, a ren7ame).731/a>(>  74                 * du7ring the time intervals 7durin732in_unlockent *  10
 *
  10
 * im7e client is spared most 7of th734in_unlockent *realm)
realmrealm  10
 * di7intains a hierarchy of r7ealms73>list  10
 * wh7alm relationship, and fo7r eac73pin_unlock,   10
 * of7herited from prior paren7ts.);
 * of7pan>
 * Th7snap_realm struct is mai7ntain739list_del_init(&asnap.c#L64" id=ai class="line" nci/ceph= a href="+code=rde=relir=ree" rL37;p %d -&gde=relir=ree" rLref="+code=empty_item" clmds class="line" namds ="epck);
 * wi7th an open cap in the sy7stem.740in_unlock(&<<<<<<<<ent * * pa7ovided by the MDS whenev7er a 741in_unlock(& * du7rsion number is used to 7ensur742in_unlock(&  10
 *(& * im7pan>
>  10
 * di7e realm hierarchy drives7 the 74>list_del_init(&a=/snap.c#L67" i__de=mdflush_alm"sss="sref">realm__de=mdflush_alm"s#37;dh/snap.c#L67" iti class="line" nci/cep>/ode=snap_empty_lock"5essio
  sref">realm>  10
 * wh7alm, which simply lists 7the r74pin_unlock(&>  10
 * of7 attached to any writes 7sent 747list_del_init(&ah/snap.c#L67" iip%p %d -&gip&##37;dsnap.c#L64" id=in id class="line" ninode/cep4>  10
 * of7span>
 * Th7pan>
 * Un7fortunately error handli7ng is750in_unlock * pa7date, but don't have7 enou751in_u  10
 * du7's not clear what we7 can 752in_unlockrealm >  74                 *
realm);
realm>  10
 * im7span>
realm)
realm>  10
 * di76" id="L56" class="line"7 name755/a>(&  81
 * wh77" id="L57" class="line"7 name75pin_unlock,  * of7pan>
 * of7crease ref count for the7 real758ass=  10
 * Th7pan>
  79         * ca7ller must hold snap_rwse7m for76rite.
  49 * up7span>
  49 * du7t_snap_realm" class="sre7f">ce762in_u.
  61(="L12" class="line" naph Tnis"can take two basicflinms:gine"aimples ris justra s="c dr" tion="L61">  61 * im765" id="L65" class="line7" nam764/a>(="L12" class="line" nap* or deletio
 notific tionaona12"exist   61 * di7" class="sref">dout(7  49 * wh7=atomic_read" class="sre7f">at76ulting set of snaps for the *="L49">  49 * of7t">/*
  49 * of7    * since we _only_ in7creme769" id="L39" class="line" namnpnew"pomnt  49 * Th7    * list with snap_rws7em he76 for realms containing every  directoryamnt/sanother#r" id.="L49">  49     7    * safe.  we do need 7to pr77rite.
  49 * up7    * additions, however7.)
realm)
ent *realm)
 * du7    */
)
realm)
realm3#include <ato773/a>(&ent *realm)
realm  10
 *s77n_loc>  74                 * di7ode=list_del_init" class7="sre77>list_del_ini>ent *  10
 * re7ode=spin_unlock" class="7sref"77pin_unlockrealm);
  10
 * of7ppshot.
  10
 * of79" id="L79" class="line"7 name778ass="string"mntrealm  10
/*ato7mic_i779list_del_inimntrealm  10
ent *realm  10
realmrealm);
realm * du7s/ceph/sc="L81">c_inc(&am782in_unlockrealmrealmrealm);
realmrealm  10
)
realm)
realm  10
 *s784/a>(&realm * di78de=list_del_init" class78"sre78>list_del_ini=/snap.c#L67" i__le65" id="L65ine" n__le65/ceph/snap.c#L64" id=apli#_in sclass="line" naapli#_in s/ceph= a href="+code=rNULL  sref">realmrealmrealm  10
 * re78de=spin_unlock" class="78ref"78pin_unlock  10
 * sn78nap.c#L78" id="L78" cla78s="l787list_del_inimnt  67         * of7aan>
/*ato78ic_i789list_del_inia"L12" class="line" name#de67" phe="L49">  49realm);
realmrealmrealm  10
(&realm  67         * du79/ceph/sc="L81">c_increalmrealm  10
realmrealm);
realm>  10
s79n_lock(&ah/snap.c#L67" ispli#37;p %d -&gspli#/ceph= aempty_item" clae64_to_cpu37;p %d -&gde64_to_cpuref="h/snap.c#L67" ih  sref">realm);
  61 * di79de=list_del_init" class79"sre79eflecting the current parenpppppppppppppppppppppppppppppppppppppppppp*"exist   49 * re79de=spin_unlock" class="79ref"79pin_unlockrealm);
>  10
 * sn79nap.c#L78" id="L78" cla79s="l797list_del_inih/snap.c#L67" idumeapli#_r" ids="sref">realmrealm);
realm * of79id="L9" class="line" na79name798ass="string"h/snap.c#L67" itrace_le
  sref">realmrealm);
realm>  10
/*realmrealm  10

(&,d osm,s#spli# ,llxrtracele
 ,d3#include <c_inc(&am> *realm>/snap.c#L66" id=5pli#37;p %d -&gspli#/cep>/snap.c#L66" id=trace_le
  sref">realm>  10
  79        realm);
realm>  10
 *list_del_ini=/snap.c#L67" i5essio
  sref">realm);
 *realm);
realm>  10
 * wh80nap.c#L78" id="L78" cla807nam807list  10
 * of80id="L9" class="line" na808nam808ass="string"h/snap.c#L67" idown_write class="line" ndown_writeref="+code=empty_item" clmds class="line" namds ="epck);
 * of80/linux/ceph/decode.h" c809nam809list_del_inih/snap.c#L67" ilockedcrwsem37;p %d -&gdockedcrwsem="eph= 1>  10

/*
realmrealm >  74                 * Sn8apshots in ceph are driv8en in812in_unlock(&<>ent *  10
  79          49 *  49 *  49 * wh8apshot.
  49 * of8pan>
  49 * of8is provides a perfect in8stant81 for realms containing everypppppppppppppppp*e="L49">  49 * cl8ients, however, snapshot8s may820in_unlock(&realm  10
/*(&realm);
  10
 * Sn8ppshots in ceph are driv8nn in822in_unlock(&realmrealm  10
(&realm);
realm * im8apshots are _not_ file s8ystem824/a>(&realm>/snap.c#L66" id=ba"="sref">realm>  10
 * di8plies to the subdirector8y nes82>list_del_init(&a="L12" class="line" name#we will peekaat r" id info here, but will _not_="L49">  49 *  49 * wh8 the files contained by 8each 82 OSDs.
  49 * of8apshots.  An individual 8realm828ass="string"""""""""a/snap.c#L67" iri class="line" nri/ceph= a href="+code=r"="sref">realm  10
 * of8plicitly created on that8 real82979">  79         * pa8rent's snap set _aft8er_ t830in_unlock(&        /*(& >  74                 * du8ring the time intervals 8durin832in_unlock(&        (&>  10
 * im8e client is spared most 8of th834/a>(&         * di8intains a hierarchy of r8ealms83>list_del_init(&a>  81
 * wh8alm relationship, and fo8r eac83pin_unlock(&  10
 * of8herited from prior paren8ts.
 * of8pan>
, ,llxr" clas  10
 * of8snap_realm struct is mai8ntain839list_del_init(&alinedsnap.c#L64" id=i class="line" ni/ceph= 0; snap.c#L66" id=i class="line" ni/ceph< snap.c#L66" id=dumeapli#_in sclass="line" nadumeapli#_in s/cep> snap.c#L66" id=i class="line" ni/cep++> >  74                 * wi8th an open cap in the sy8stem.840in_unlock(&<<<<<<<<<>ent *)
 *  74                /*(&<<<<<<<<<<<<<<<<<.snap.c#L64" id=ino class="line" nino="eph= aempty_item" clae64_to_cpu37;p %d -&gde64_to_cpuref="h/snap.c#L67" iapli#_in sclass="line" naapli#_in s/cep[snap.c#L66" id=i class="line" ni/cep])>3#include < * du8rsion number is used to 8ensur842in_unlock(&<<<<<<<<<<<<<<<<<.snap.c#L64" id=alm"  sref">realmrealm3#include < *(&  10
 * im8pan>
>snap.c#L66" id=vino class="line" nvinoin_u">  10
 * di8e realm hierarchy drives8 the 84>list_del_init(&a<<<<<<<<>ent *  10
 * wh8alm, which simply lists 8the r84pin_unlock(&<<<<<<<<<>ent *  10
 * of8 attached to any writes 8sent 847list  10
 * of8span>

 * of8pan>
  10
 * Un8fortunately error handli8ng is850in_unlock(&<<<<<<<<  10
 * pa8date, but don't have8 enou851in_u  10
 * du8's not clear what we8 can 852in_unlock(&>  10
 *

 * im8span>
  10
 * di86" id="L56" class="line"8 name85>list_del_init(&a<<<<<<<
  49 * wh87" id="L57" class="line"8 name85ulting set of snaps for the pppppppppppppppppppppppp* Ifsinissinode belo  49 * of8pan>
  49 * of8crease ref count for the8 real859" id="L39" class="line" nampppppppppppppppppppppppp* a  ace (dueph/sanother#spli# notific tions="L49">  49 * of8pan>
  49 * ca8ller must hold snap_rwse8m for86rite.
  49 * up8span>
  49 * du8t_snap_realm" class="sre8f">ce862in_unlock(& *> >  74                 * im865" id="L65" class="line8" nam864/a>(&, ,llxr" clas * di8" class="sref">dout(8list_del_init(&a<<<<<<<<<<<<<<<<<<<<>snap.c#L66" id=ci class="line" nci/ceps/ceph/snap.c#L67" ii_51" cr" idclass="line" naid51" cr" id/ceps/ceph/snap.c#L67" iino class="line" nino="ep>3#include < * wh8=atomic_read" class="sre8f">at86pin_unlock(&<<<<<<<<<<<<<<<<<<<<< * of8t">/*
  10
 * of8    * since we _only_ in8creme868ass="string""""""""""""""""">  81
 * Th8    * list with snap_rws8em he869list_del_init(&a>(&, ,llxr" clas     8    * safe.  we do need 8to pr870in_unlock(&<<<<<<<<>snap.c#L66" id=r" idclass="line" nar" id/ceps/ceph/snap.c#L67" iino class="line" nino="ep>>snap.c#L66" id=r" idclass="line" nar" id/cep">  10
 * up8    * additions, however8.(&<<<<<<<<
  49 * du8    */
  49 *ato873/a>(="L12" class="line" napeeeeeeeeeeeeeeeeeeeeeeee*e="L49">  49 *s874/a>(&  10
 * di8ode=list_del_init" class8="sre87>list_del_init(&a<<<<<<<  10
 * wh8ode=spin_unlock" class="8sref"87pin_unlock(&<<<<<<<<                 * of8ppshot.
  10
 * of89" id="L79" class="line"8 name878ass="string"""""""""""""""""snap.c#L64" id=oldre idclass="line" naoldre id/ceph= a href="+code=rdi class="line" nci/ceps/ceph/snap.c#L67" ii_51" cr" idclass="line" naid51" cr" id/cep>  10
 * Th8ic_inc" class="sref">ato8mic_i879list_del_init(&a>(&  10
(&<<<<<<<<  10
(&<<<<<<<<>  10
 * du8s/ceph/sc="L81">c_inc(&am88">   3#include <  10
 *s884/a>(&  10
 * di88de=list_del_init" class88"sre88>list  10
 * re88de=spin_unlock" class="88ref"88pin_unlock(&<<<<<<<<  10
 * sn88nap.c#L78" id="L78" cla88s="l887list_del_init(&aaaaaaaaac6" inue>  10
 * of8aan>
/*ato88ic_i889listaempty_item" clskipdin id class="line" nskipdin id/cep:  10
>  10
(&<<<<<<<<  10
 * du89/ceph/sc="L81">c_inc(&<>  81
  79        s894/a>(&
  49 * di89de=list_del_init" class89"sre89>list_del_init(&alinedsnap.c#L64" id=i class="line" ni/ceph= 0; snap.c#L66" id=i class="line" ni/ceph< snap.c#L66" id=dumeapli#_r" ids="sref">realm >  74                 * re89de=spin_unlock" class="89ref"89pin_unlock(&<<<<<<<<<>ent *                 * sn89nap.c#L78" id="L78" cla89s="l897list_del_init(&aaaaaaaaaaaaaaaaa> * * of89id="L9" class="line" na89name898ass="string"""""""""""""""""(&aaaaaaaaaaaaaaaaa> *realm  10
/*(&a>(&
(&<<<<<<<<  10
(&<<<<<<<<realm>snap.c#L66" id=r" idclass="line" nar" id/ceps/ceph/snap.c#L67" iino class="line" nino="ep4>  10
c_inc(&am ;<>  81
list_del_ini=/span>
  49 *  49 *
  49 * of90id="L9" class="line" na908nam909" id="L39" class="line" nampppppppp*e="L49">  49 * of90/linux/ceph/decode.h" c909nam909list_del_inih/snap.c#L67" ide=mdupdate_51" ctraceclass="line" nade=mdupdate_51" ctraceref="h/snap.c#L67" imds class="line" namds ="eph>snap.c#L66" id=pclass="line" nap="ep>/snap.c#L66" id=e="sref">realm(&<<<<<<<<realmrealm  10
/*
 * Sn9apshots in ceph are driv9en in912in_unlockrealmrealm  10

  49  10
 *list  10
 *realm  10
 *
 * of9pan>
 * of9is provides a perfect in9stant91979">  79         * cl9ients, however, snapshot9s may920in_unlock);
realmflush_alm"s#37;dh/snap.c#L67" imds class="line" namds ="ep">  10
/*  10
 * Sn9ppshots in ceph are driv9nn in92">   3#include <
realm
 * im9apshots are _not_ file s9ystem924/a>(&, ,d  10
 *list_del_inih/snap.c#L67" ide=mdmsg_dum"  sref">realm)
realm>  10
 * *  10
 * of9apshots.  An individual 9realm928ass="string"""""""""a/snap.c#L67" iup_write class="line" nup_writeref="+code=empty_item" clmds class="line" namds ="epck);
 * of9plicitly created on that9 real929in_unlock  10
 * pa9rent's snap set _aft9er_ t930in_u>  81
/*
 * du9ring the time intervals 9durin93">   3#include <
  79         * im9e client is spared most 9of th934/a>(


Tne"original LXR software#by ine" 79 http://sourceforge.net/projects/lxr">LXR ef="unity="eph>inissexperi"fs/al versio #by 79 mailto:lxr@ spux.no&gdxr@ spux.no="ep.
dxr. spux.no kindly hosted by 79 http://www.redpill- sppro.no&gRedpill Lsppro AS="eph>provider ofsLspuxac6"sult