linux/fs/ceph/snap.c
<<
4" /spaion /formon a 4" href="../linux+v3v.110/fs/ceph/snap.c">4" img src="../.static/gfx/right.png" alt=">>">4" /spaion4" spai class="lxr_search">4" 4" input typluehidden" namluenavtarget" n value">4" input typluetext" namluesearch" iduesearch">4" butttiotypluesubmit">Search4" Prefsn /a>4" /spaion /divon form acopti="ajax+*" method="post" onsubmit="return false;">4" input typluehidden" namlueajax_lookup" idueajax_lookup" n value">4 /formon4 div class="headingbotttm">n div iduefile_contents"o
 
1 /a>#include <linux/ceph/ceph_debug.h /a>>

 
2 /a>4
 
3 /a>#include <linux/sort.h /a>>

 
4 /a>#include <linux/slab.h /a>>

 
5 /a>4
 
6 /a>#include "super.h /a>"4
 
7 /a>#include "mds_client.h /a>"4
 
8 /a>4
 
9 /a>#include <linux/ceph/decode.h /a>>

 8.10a>4
 11 /a> spai class="comment">/* /spaion
 12 /a> spai class="comment"> * Snapshots ii ceph are driven ii large part by cooperaoptiofrom the /spaion
 13 /a> spai class="comment"> * client.  Ii contrast to local file systems or file servers that /spaion
 14 /a> spai class="comment"> * implement snapshots at a single point ii the system, ceph's /spaion
 15 /a> spai class="comment"> * distributed access to storage requires clients to help decide /spaion
 16 /a> spai class="comment"> * whether a write logically occurs before or after a recently created /spaion
 17 /a> spai class="comment"> * snapshot. /spaion
 18 /a> spai class="comment"> * /spaion
 19 /a> spai class="comment"> * This provides a perfect iistantanous client-wide snapshot.  Between /spaion
 20 /a> spai class="comment"> * clients, however, snapshots may appear to be applied at slightly /spaion
 21 /a> spai class="comment"> * different points ii time, depending on delays ii delivering the /spaion
 22 /a> spai class="comment"> * snapshot notificaopti. /spaion
 23 /a> spai class="comment"> * /spaion
 24 /a> spai class="comment"> * Snapshots are _not_ file system-wide.  Iistead, each snapshot /spaion
 25 /a> spai class="comment"> * applies to the subdirectory nested beneath some directory.  This /spaion
 26 /a> spai class="comment"> * effectively divides the hierarchy iito multiple "realms," where all /spaion
 27 /a> spai class="comment"> * of the files contained by each realm share the saml set of /spaion
 28 /a> spai class="comment"> * snapshots.  An iidividual realm's snap set contains snapshots /spaion
 29 /a> spai class="comment"> * explicitly created on that realm, as well as any snaps ii its /spaion
 30 /a> spai class="comment"> * parent's snap set _after_ the point at which the parent becaml it's /spaion
 31 /a> spai class="comment"> * parent (due to, say, a renaml).  Similarly, snapsofrom prior parents /spaion
 32 /a> spai class="comment"> * during the time iitervals during which they were the parent are included. /spaion
 33 /a> spai class="comment"> * /spaion
 34 /a> spai class="comment"> * The client is spared most of this detail, fortunately... it must only /spaion
 35 /a> spai class="comment"> * maintains a hierarchy of realms reflecting the current parent/child /spaion
 36 /a> spai class="comment"> * realm relaoptiship, and for each realm has an explicit list of snaps /spaion
 37 /a> spai class="comment"> * inherited from prior parents. /spaion
 38 /a> spai class="comment"> * /spaion
 39 /a> spai class="comment"> * A snap_realm struct is maintained for realms containing every iiode /spaion
 40 /a> spai class="comment"> * with ai open cap ii the system.  (The needed snap realm informaoptiois /spaion
 41 /a> spai class="comment"> * provided by the MDS whenever a cap is issued, i.e., on open.)  A 'seq' /spaion
 42 /a> spai class="comment"> * versptionumber is used to ensure that as realm paramlters change (new /spaion
 43 /a> spai class="comment"> * snapshot, new parent, etc.) the client's realm hierarchy is updated. /spaion
 44 /a> spai class="comment"> * /spaion
 45 /a> spai class="comment"> * The realm hierarchy drives the generaoptioof a 'snap context' for each /spaion
 46 /a> spai class="comment"> * realm, which simply lists the resulting set of snapsofor the realm.  This /spaion
 47 /a> spai class="comment"> * is attached to any writes sent to OSDs. /spaion
 48 /a> spai class="comment"> */ /spaion
 49 /a> spai class="comment">/* /spaion
 50 /a> spai class="comment"> * Unfortunately error handling is a bit mixed here.  If we get a snap /spaion
 51 /a> spai class="comment"> * update, but don't have enough memory to update our realm hierarchy, /spaion
 52 /a> spai class="comment"> * it's not clear what we can do about it (besides complaining to the /spaion
 53 /a> spai class="comment"> * ctisoll). /spaion
 54 /a> spai class="comment"> */ /spaion
 55 /a>4
 56 /a>4
 57 /a> spai class="comment">/* /spaion
 58 /a> spai class="comment"> * increase ref ctunt for the realm /spaion
 59 /a> spai class="comment"> * /spaion
 60 /a> spai class="comment"> * caller must hold snap_rwsem for write. /spaion
 61 /a> spai class="comment"> */ /spaion
 62 /a>void
 a href="+code=ceph_get_snap_realm" class="sref">ceph_get_snap_realm /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
 63 /a>                         struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>)n
 64 /a>{n
 65 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"get_realm %p %d -> %d\n"realm /a>,n
 66 /a>              a href="+code=atomic_read" class="sref">atomic_read /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>),  a href="+code=atomic_read" class="sref">atomic_read /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>)+1);

 67 /a>         spai class="comment">/* /spaion
 68 /a> spai class="comment">         * since we _only_ increment realm refs or empty the empty /spaion
 69 /a> spai class="comment">         * list with snap_rwsem held, adjusting the empty list here is /spaion
 70 /a> spai class="comment">         * safe.  we do need to protect against concurrent empty list /spaion
 71 /a> spai class="comment">         * addioptis, however. /spaion
 72 /a> spai class="comment">         */ /spaion
 73 /a>        if ( a href="+code=atomic_read" class="sref">atomic_read /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>) == 0) {n
 74 /a>                 a href="+code=spin_lock" class="sref">spin_lock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
 75 /a>                 a href="+code=list_del_init" class="sref">list_del_init /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=empty_item" class="sref">empty_item /a>);4
 76 /a>                 a href="+code=spin_unlock" class="sref">spin_unlock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
 77 /a>        }4
 78 /a>4
 79 /a>         a href="+code=atomic_inc" class="sref">atomic_inc /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>);4
 80 /a>}4
 81 /a>4
 82 /a>static void
 a href="+code=__insert_snap_realm" class="sref">__insert_snap_realm /a>(struct  a href="+code=rb_root" class="sref">rb_root /a> * a href="+code=root" class="sref">root /a>,n
 83 /a>                                struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=new" class="sref">new /a>)n
 84 /a>{n
 85 /a>        struct  a href="+code=rb_iode" class="sref">rb_iode /a> ** a href="+code=p" class="sref">p /a> = & a href="+code=root" class="sref">root /a>-> a href="+code=rb_iode" class="sref">rb_iode /a>;4
 86 /a>        struct  a href="+code=rb_iode" class="sref">rb_iode /a> * a href="+code=parent" class="sref">parent /a> =  a href="+code=NULL" class="sref">NULL /a>;4
 87 /a>        struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=r" class="sref">r /a> =  a href="+code=NULL" class="sref">NULL /a>;4
 88 /a>4
 89 /a>        while (* a href="+code=p" class="sref">p /a>) {n
 90 /a>                 a href="+code=parent" class="sref">parent /a> = * a href="+code=p" class="sref">p /a>;4
 91 /a>                 a href="+code=r" class="sref">r /a> =  a href="+code=rb_entry" class="sref">rb_entry /a>( a href="+code=parent" class="sref">parent /a>, struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a>,  a href="+code=iode" class="sref">iode /a>);4
 92 /a>                if ( a href="+code=new" class="sref">new /a>-> a href="+code=ino" class="sref">ino /a> <  a href="+code=r" class="sref">r /a>-> a href="+code=ino" class="sref">ino /a>)n
 93 /a>                         a href="+code=p" class="sref">p /a> = &(* a href="+code=p" class="sref">p /a>)-> a href="+code=rb_left" class="sref">rb_left /a>;4
 94 /a>                else if ( a href="+code=new" class="sref">new /a>-> a href="+code=ino" class="sref">ino /a> >  a href="+code=r" class="sref">r /a>-> a href="+code=ino" class="sref">ino /a>)n
 95 /a>                         a href="+code=p" class="sref">p /a> = &(* a href="+code=p" class="sref">p /a>)-> a href="+code=rb_right" class="sref">rb_right /a>;4
 96 /a>                else4
 97 /a>                         a href="+code=BUG" class="sref">BUG /a>();4
 98 /a>        }4
 99 /a>4
100 /a>         a href="+code=rb_link_iode" class="sref">rb_link_iode /a>(& a href="+code=new" class="sref">new /a>-> a href="+code=iode" class="sref">iode /a>,  a href="+code=parent" class="sref">parent /a>,  a href="+code=p" class="sref">p /a>);

101 /a>         a href="+code=rb_insert_color" class="sref">rb_insert_color /a>(& a href="+code=new" class="sref">new /a>-> a href="+code=iode" class="sref">iode /a>,  a href="+code=root" class="sref">root /a>);

102 /a>}4
103 /a>4
104 /a> spai class="comment">/* /spaion
105 /a> spai class="comment"> * create and get the realm rooted at @ino and bump its ref ctunt. /spaion
106 /a> spai class="comment"> * /spaion
107 /a> spai class="comment"> * caller must hold snap_rwsem for write. /spaion
108 /a> spai class="comment"> */ /spaion
109 /a>static struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=ceph_create_snap_realm" class="sref">ceph_create_snap_realm /a>(4
110 /a>        struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
111 /a>         a href="+code=u64" class="sref">u64 /a>  a href="+code=ino" class="sref">ino /a>)n
112 /a>{n
113 /a>        struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>;

114 /a>

115 /a>         a href="+code=realm" class="sref">realm /a> =  a href="+code=kzalloc" class="sref">kzalloc /a>(sizeof(* a href="+code=realm" class="sref">realm /a>),  a href="+code=GFP_NOFS" class="sref">GFP_NOFS /a>);

116 /a>        if (! a href="+code=realm" class="sref">realm /a>)

117 /a>                return  a href="+code=ERR_PTR" class="sref">ERR_PTR /a>(- a href="+code=ENOMEM" class="sref">ENOMEM /a>);

118 /a>4
119 /a>         a href="+code=atomic_set" class="sref">atomic_set /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>, 0);     spai class="comment">/* tree does not take a ref */ /spaion
120 /a>         a href="+code=realm" class="sref">realm /a>-> a href="+code=ino" class="sref">ino /a> =  a href="+code=ino" class="sref">ino /a>;

121 /a>         a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=children" class="sref">children /a>);

122 /a>         a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=child_item" class="sref">child_item /a>);

123 /a>         a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=empty_item" class="sref">empty_item /a>);4
124 /a>         a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=dirty_item" class="sref">dirty_item /a>);4
125 /a>         a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=iiodes_with_caps" class="sref">inodes_with_caps /a>);4
126 /a>         a href="+code=spin_lock_init" class="sref">spin_lock_init /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=iiodes_with_caps_lock" class="sref">iiodes_with_caps_lock /a>);4
127 /a>         a href="+code=__insert_snap_realm" class="sref">__insert_snap_realm /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_realms" class="sref">snap_realms /a>,  a href="+code=realm" class="sref">realm /a>);4
128 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"create_snap_realm %llx %p\n"realm /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=realm" class="sref">realm /a>);4
129 /a>        return  a href="+code=realm" class="sref">realm /a>;

130 /a>}4
131 /a>4
132 /a> spai class="comment">/* /spaion
133 /a> spai class="comment"> * lookup the realm rooted at @ino. /spaion
134 /a> spai class="comment"> * /spaion
135 /a> spai class="comment"> * caller must hold snap_rwsem for write. /spaion
136 /a> spai class="comment"> */ /spaion
137 /a>struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=ceph_lookup_snap_realm" class="sref">ceph_lookup_snap_realm /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
138 /a>                                                a href="+code=u64" class="sref">u64 /a>  a href="+code=ino" class="sref">ino /a>)n
139 /a>{n
140 /a>        struct  a href="+code=rb_iode" class="sref">rb_iode /a> * a href="+code=n" class="sref">n /a> =  a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_realms" class="sref">snap_realms /a>. a href="+code=rb_iode" class="sref">rb_iode /a>;

141 /a>        struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=r" class="sref">r /a>;

142 /a>4
143 /a>        while ( a href="+code=n" class="sref">n /a>) {n
144 /a>                 a href="+code=r" class="sref">r /a> =  a href="+code=rb_entry" class="sref">rb_entry /a>( a href="+code=n" class="sref">n /a>, struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a>,  a href="+code=iode" class="sref">iode /a>);4
145 /a>                if ( a href="+code=ino" class="sref">ino /a> <  a href="+code=r" class="sref">r /a>-> a href="+code=ino" class="sref">ino /a>)n
146 /a>                         a href="+code=n" class="sref">n /a> =  a href="+code=n" class="sref">n /a>-> a href="+code=rb_left" class="sref">rb_left /a>;4
147 /a>                else if ( a href="+code=ino" class="sref">ino /a> >  a href="+code=r" class="sref">r /a>-> a href="+code=ino" class="sref">ino /a>)n
148 /a>                         a href="+code=n" class="sref">n /a> =  a href="+code=n" class="sref">n /a>-> a href="+code=rb_right" class="sref">rb_right /a>;4
149 /a>                else {n
150 /a>                         a href="+code=dout" class="sref">dout /a>( spai class="string">"lookup_snap_realm %llx %p\n"r /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=r" class="sref">r /a>);4
151 /a>                        return  a href="+code=r" class="sref">r /a>;

152 /a>                }4
153 /a>        }4
154 /a>        return  a href="+code=NULL" class="sref">NULL /a>;4
155 /a>}4
156 /a>4
157 /a>static void
 a href="+code=__put_snap_realm" class="sref">__put_snap_realm /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
158 /a>                             struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>);4
159 /a>4
160 /a> spai class="comment">/* /spaion
161 /a> spai class="comment"> * called with snap_rwsem (write) /spaion
162 /a> spai class="comment"> */ /spaion
163 /a>static void
 a href="+code=__destroy_snap_realm" class="sref">__destroy_snap_realm /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
164 /a>                                 struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>)n
165 /a>{n
166 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"__destroy_snap_realm %p %llx\n"realm /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=ino" class="sref">ino /a>);4
167 /a>4
168 /a>         a href="+code=rb_erase" class="sref">rb_erase /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=iode" class="sref">iode /a>, & a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_realms" class="sref">snap_realms /a>);4
169 /a>4
170 /a>        if ( a href="+code=realm" class="sref">realm /a>-> a href="+code=parent" class="sref">parent /a>) {n
171 /a>                 a href="+code=list_del_init" class="sref">list_del_init /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=child_item" class="sref">child_item /a>);

172 /a>                 a href="+code=__put_snap_realm" class="sref">__put_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=parent" class="sref">parent /a>);

173 /a>        }4
174 /a>

175 /a>         a href="+code=kfree" class="sref">kfree /a>( a href="+code=realm" class="sref">realm /a>-> a href="+code=prior_parent_snaps" class="sref">prior_parent_snaps /a>);

176 /a>         a href="+code=kfree" class="sref">kfree /a>( a href="+code=realm" class="sref">realm /a>-> a href="+code=snaps" class="sref">snaps /a>);

177 /a>         a href="+code=ceph_put_snap_context" class="sref">ceph_put_snap_context /a>( a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>);

178 /a>         a href="+code=kfree" class="sref">kfree /a>( a href="+code=realm" class="sref">realm /a>);

179 /a>}4
18.10a>4
181 /a> spai class="comment">/* /spaion
182 /a> spai class="comment"> * caller holds snap_rwsem (write) /spaion
183 /a> spai class="comment"> */ /spaion
184 /a>static void
 a href="+code=__put_snap_realm" class="sref">__put_snap_realm /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
185 /a>                             struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>)n
186 /a>{n
187 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"__put_snap_realm %llx %p %d -> %d\n"realm /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=realm" class="sref">realm /a>,n
188 /a>              a href="+code=atomic_read" class="sref">atomic_read /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>),  a href="+code=atomic_read" class="sref">atomic_read /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>)-1);

189 /a>        if ( a href="+code=atomic_dec_and_test" class="sref">atomic_dec_and_test /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>))n
190 /a>                 a href="+code=__destroy_snap_realm" class="sref">__destroy_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=realm" class="sref">realm /a>);

191 /a>}4
192 /a>4
193 /a> spai class="comment">/* /spaion
194 /a> spai class="comment"> * caller needn't hold any locks /spaion
195 /a> spai class="comment"> */ /spaion
196 /a>void
 a href="+code=ceph_put_snap_realm" class="sref">ceph_put_snap_realm /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
197 /a>                         struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>)n
198 /a>{n
199 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"put_snap_realm %llx %p %d -> %d\n"realm /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=realm" class="sref">realm /a>,n
200 /a>              a href="+code=atomic_read" class="sref">atomic_read /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>),  a href="+code=atomic_read" class="sref">atomic_read /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>)-1);

201 /a>        if (! a href="+code=atomic_dec_and_test" class="sref">atomic_dec_and_test /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=nref" class="sref">nref /a>))n
202 /a>                return;

203 /a>4
204 /a>        if ( a href="+code=down_write_trylock" class="sref">down_write_trylock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_rwsem" class="sref">snap_rwsem /a>)) {n
205 /a>                 a href="+code=__destroy_snap_realm" class="sref">__destroy_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=realm" class="sref">realm /a>);

206 /a>                 a href="+code=up_write" class="sref">up_write /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_rwsem" class="sref">snap_rwsem /a>);

207 /a>        } else {n
208 /a>                 a href="+code=spin_lock" class="sref">spin_lock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
209 /a>                 a href="+code=list_add" class="sref">list_add /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=empty_item" class="sref">empty_item /a>, & a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty" class="sref">snap_empty /a>);4
210 /a>                 a href="+code=spin_unlock" class="sref">spin_unlock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
211 /a>        }4
212 /a>}4
213 /a>4
214 /a> spai class="comment">/* /spaion
215 /a> spai class="comment"> * Cleai up any realms whose ref ctunts have dropped to zero.  Note /spaion
216 /a> spai class="comment"> * that this does not include realms who were created but not yet /spaion
217 /a> spai class="comment"> * used. /spaion
218 /a> spai class="comment"> * /spaion
219 /a> spai class="comment"> * Called under snap_rwsem (write) /spaion
220 /a> spai class="comment"> */ /spaion
221 /a>static void
 a href="+code=__cleanup_empty_realms" class="sref">__cleanup_empty_realms /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>)n
222 /a>{n
223 /a>        struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>;

224 /a>

225 /a>         a href="+code=spin_lock" class="sref">spin_lock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
226 /a>        while (! a href="+code=list_empty" class="sref">list_empty /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty" class="sref">snap_empty /a>)) {n
227 /a>                 a href="+code=realm" class="sref">realm /a> =  a href="+code=list_first_entry" class="sref">list_first_entry /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty" class="sref">snap_empty /a>,n
228 /a>                                   struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a>,  a href="+code=empty_item" class="sref">empty_item /a>);4
229 /a>                 a href="+code=list_del" class="sref">list_del /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=empty_item" class="sref">empty_item /a>);4
230 /a>                 a href="+code=spin_unlock" class="sref">spin_unlock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
231 /a>                 a href="+code=__destroy_snap_realm" class="sref">__destroy_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=realm" class="sref">realm /a>);

232 /a>                 a href="+code=spin_lock" class="sref">spin_lock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
233 /a>        }4
234 /a>         a href="+code=spin_unlock" class="sref">spin_unlock /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_empty_lock" class="sref">snap_empty_lock /a>);4
235 /a>}4
236 /a>4
237 /a>void
 a href="+code=ceph_cleanup_empty_realms" class="sref">ceph_cleanup_empty_realms /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>)n
238 /a>{n
239 /a>         a href="+code=down_write" class="sref">down_write /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_rwsem" class="sref">snap_rwsem /a>);

240 /a>         a href="+code=__cleanup_empty_realms" class="sref">__cleanup_empty_realms /a>( a href="+code=mdsc" class="sref">mdsc /a>);

241 /a>         a href="+code=up_write" class="sref">up_write /a>(& a href="+code=mdsc" class="sref">mdsc /a>-> a href="+code=snap_rwsem" class="sref">snap_rwsem /a>);

242 /a>}4
243 /a>4
244 /a> spai class="comment">/* /spaion
245 /a> spai class="comment"> * adjust the parent realm of a given @realm.  adjust child list, and parent /spaion
246 /a> spai class="comment"> * pointers, and ref ctunts appropriately. /spaion
247 /a> spai class="comment"> * /spaion
248 /a> spai class="comment"> * return true if parent was changed, 0 if unchanged, <0 on error. /spaion
249 /a> spai class="comment"> * /spaion
250 /a> spai class="comment"> * caller must hold snap_rwsem for write. /spaion
251 /a> spai class="comment"> */ /spaion
252 /a>static int  a href="+code=adjust_snap_realm_parent" class="sref">adjust_snap_realm_parent /a>(struct  a href="+code=ceph_mds_client" class="sref">ceph_mds_client /a> * a href="+code=mdsc" class="sref">mdsc /a>,n
253 /a>                                    struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>,n
254 /a>                                     a href="+code=u64" class="sref">u64 /a>  a href="+code=parentino" class="sref">parentino /a>)n
255 /a>{n
256 /a>        struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=parent" class="sref">parent /a>;

257 /a>4
258 /a>        if ( a href="+code=realm" class="sref">realm /a>-> a href="+code=parent_ino" class="sref">parent_ino /a> ==  a href="+code=parentino" class="sref">parentino /a>)n
259 /a>                return 0;

26.10a>4
261 /a>         a href="+code=parent" class="sref">parent /a> =  a href="+code=ceph_lookup_snap_realm" class="sref">ceph_lookup_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=parentino" class="sref">parentino /a>);

262 /a>        if (! a href="+code=parent" class="sref">parent /a>) {n
263 /a>                 a href="+code=parent" class="sref">parent /a> =  a href="+code=ceph_create_snap_realm" class="sref">ceph_create_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=parentino" class="sref">parentino /a>);

264 /a>                if ( a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=parent" class="sref">parent /a>))n
265 /a>                        return  a href="+code=PTR_ERR" class="sref">PTR_ERR /a>( a href="+code=parent" class="sref">parent /a>);

266 /a>        }4
267 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"adjust_snap_realm_parent %llx %p: %llx %p -> %llx %p\n"
268 /a>              a href="+code=realm" class="sref">realm /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=realm" class="sref">realm /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=parent_ino" class="sref">parent_ino /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=parent" class="sref">parent /a>,4
269 /a>              a href="+code=parentino" class="sref">parentino /a>,  a href="+code=parent" class="sref">parent /a>);

270 /a>        if ( a href="+code=realm" class="sref">realm /a>-> a href="+code=parent" class="sref">parent /a>) {n
271 /a>                 a href="+code=list_del_init" class="sref">list_del_init /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=child_item" class="sref">child_item /a>);

272 /a>                 a href="+code=ceph_put_snap_realm" class="sref">ceph_put_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=parent" class="sref">parent /a>);

273 /a>        }4
274 /a>         a href="+code=realm" class="sref">realm /a>-> a href="+code=parent_ino" class="sref">parent_ino /a> =  a href="+code=parentino" class="sref">parentino /a>;

275 /a>         a href="+code=realm" class="sref">realm /a>-> a href="+code=parent" class="sref">parent /a> =  a href="+code=parent" class="sref">parent /a>;

276 /a>         a href="+code=ceph_get_snap_realm" class="sref">ceph_get_snap_realm /a>( a href="+code=mdsc" class="sref">mdsc /a>,  a href="+code=parent" class="sref">parent /a>);

277 /a>         a href="+code=list_add" class="sref">list_add /a>(& a href="+code=realm" class="sref">realm /a>-> a href="+code=child_item" class="sref">child_item /a>, & a href="+code=parent" class="sref">parent /a>-> a href="+code=children" class="sref">children /a>);

278 /a>        return 1;

279 /a>}4
28.10a>4
281 /a>4
282 /a>static int  a href="+code=cmpu64_rev" class="sref">cmpu64_rev /a>(const void
* a href="+code=a" class="sref">a /a>, const void
* a href="+code=b" class="sref">b /a>)n
283 /a>{n
284 /a>        if (*( a href="+code=u64" class="sref">u64 /a> *) a href="+code=a" class="sref">a /a> < *( a href="+code=u64" class="sref">u64 /a> *) a href="+code=b" class="sref">b /a>)n
285 /a>                return 1;

286 /a>        if (*( a href="+code=u64" class="sref">u64 /a> *) a href="+code=a" class="sref">a /a> > *( a href="+code=u64" class="sref">u64 /a> *) a href="+code=b" class="sref">b /a>)n
287 /a>                return -1;

288 /a>        return 0;

289 /a>}4
29.10a>4
291 /a> spai class="comment">/* /spaion
292 /a> spai class="comment"> * build the snap context for a given realm. /spaion
293 /a> spai class="comment"> */ /spaion
294 /a>static int  a href="+code=build_snap_context" class="sref">build_snap_context /a>(struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>)n
295 /a>{n
296 /a>        struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=parent" class="sref">parent /a> =  a href="+code=realm" class="sref">realm /a>-> a href="+code=parent" class="sref">parent /a>;

297 /a>        struct  a href="+code=ceph_snap_context" class="sref">ceph_snap_context /a> * a href="+code=snapc" class="sref">snapc /a>;

298 /a>        int  a href="+code=err" class="sref">err /a> = 0;

299 /a>         a href="+code=u32" class="sref">u32 /a>  a href="+code=num" class="sref">num /a> =  a href="+code=realm" class="sref">realm /a>-> a href="+code=num_prior_parent_snaps" class="sref">num_prior_parent_snaps /a> +  a href="+code=realm" class="sref">realm /a>-> a href="+code=num_snaps" class="sref">num_snaps /a>;

30.10a>4
301 /a>         spai class="comment">/* /spaion
302 /a> spai class="comment">         * build parent context, if it hasn't been built. /spaion
303 /a> spai class="comment">         * conservatively estimate that all parent snaps might be /spaion
304 /a> spai class="comment">         * included by us. /spaion
305 /a> spai class="comment">         */ /spaion
306 /a>        if ( a href="+code=parent" class="sref">parent /a>) {n
307 /a>                if (! a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>) {n
308 /a>                         a href="+code=err" class="sref">err /a> =  a href="+code=build_snap_context" class="sref">build_snap_context /a>( a href="+code=parent" class="sref">parent /a>);

309 /a>                        if ( a href="+code=err" class="sref">err /a>)n
310 /a>                                goto  a href="+code=fail" class="sref">fail /a>;

311 /a>                }4
312 /a>                 a href="+code=num" class="sref">num /a> +=  a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=num_snaps" class="sref">num_snaps /a>;

313 /a>        }4
314 /a>

315 /a>         spai class="comment">/* do i actually need to update?  not if my context seq /spaion
316 /a> spai class="comment">           matches realm seq, and my parents' does to.  (this works /spaion
317 /a> spai class="comment">           because we rebuild_snap_realms() works _downward_ in /spaion
318 /a> spai class="comment">           hierarchy after each update.) */ /spaion
319 /a>        if ( a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a> &&n
320 /a>             a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=seq" class="sref">seq /a> ==  a href="+code=realm" class="sref">realm /a>-> a href="+code=seq" class="sref">seq /a> &&n
321 /a>            (! a href="+code=parent" class="sref">parent /a> ||n
322 /a>              a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=seq" class="sref">seq /a> >=  a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=seq" class="sref">seq /a>)) {n
323 /a>                 a href="+code=dout" class="sref">dout /a>( spai class="string">"build_snap_context %llx %p: %p seq %lld (%u snaps)"
324 /a>                      spai class="string">" (unchanged)\n"
325 /a>                      a href="+code=realm" class="sref">realm /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=realm" class="sref">realm /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>,4
326 /a>                      a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=seq" class="sref">seq /a>,4
327 /a>                     (unsigned int)  a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=num_snaps" class="sref">num_snaps /a>);

328 /a>                return 0;

329 /a>        }4
33.10a>4
331 /a>         spai class="comment">/* alloc new snap context */ /spaion
332 /a>         a href="+code=err" class="sref">err /a> = - a href="+code=ENOMEM" class="sref">ENOMEM /a>;

333 /a>        if ( a href="+code=num" class="sref">num /a> > ( a href="+code=SIZE_MAX" class="sref">SIZE_MAX /a> - sizeof(* a href="+code=snapc" class="sref">snapc /a>)) / sizeof( a href="+code=u64" class="sref">u64 /a>))n
334 /a>                goto  a href="+code=fail" class="sref">fail /a>;

335 /a>         a href="+code=snapc" class="sref">snapc /a> =  a href="+code=kzalloc" class="sref">kzalloc /a>(sizeof(* a href="+code=snapc" class="sref">snapc /a>) +  a href="+code=num" class="sref">num /a>*sizeof( a href="+code=u64" class="sref">u64 /a>),  a href="+code=GFP_NOFS" class="sref">GFP_NOFS /a>);

336 /a>        if (! a href="+code=snapc" class="sref">snapc /a>)

337 /a>                goto  a href="+code=fail" class="sref">fail /a>;

338 /a>         a href="+code=atomic_set" class="sref">atomic_set /a>(& a href="+code=snapc" class="sref">snapc /a>-> a href="+code=nref" class="sref">nref /a>, 1);

339 /a>4
340 /a>         spai class="comment">/* build (reverse sorted) snap vector */ /spaion
341 /a>         a href="+code=num" class="sref">num /a> = 0;

342 /a>         a href="+code=snapc" class="sref">snapc /a>-> a href="+code=seq" class="sref">seq /a> =  a href="+code=realm" class="sref">realm /a>-> a href="+code=seq" class="sref">seq /a>;

343 /a>        if ( a href="+code=parent" class="sref">parent /a>) {n
344 /a>                 a href="+code=u32" class="sref">u32 /a>  a href="+code=i" class="sref">i /a>;

345 /a>

346 /a>                 spai class="comment">/* include any of parent's snaps occurring _after_ my /spaion
347 /a> spai class="comment">                   parent became my parent */ /spaion
348 /a>                for ( a href="+code=i" class="sref">i /a> = 0;  a href="+code=i" class="sref">i /a> <  a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=num_snaps" class="sref">num_snaps /a>;  a href="+code=i" class="sref">i /a>++)

349 /a>                        if ( a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=snaps" class="sref">snaps /a>[ a href="+code=i" class="sref">i /a>] >=

350 /a>                             a href="+code=realm" class="sref">realm /a>-> a href="+code=parent_since" class="sref">parent_since /a>)

351 /a>                                 a href="+code=snapc" class="sref">snapc /a>-> a href="+code=snaps" class="sref">snaps /a>[ a href="+code=num" class="sref">num /a>++] =

352 /a>                                         a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=snaps" class="sref">snaps /a>[ a href="+code=i" class="sref">i /a>];

353 /a>                if ( a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=seq" class="sref">seq /a> >  a href="+code=snapc" class="sref">snapc /a>-> a href="+code=seq" class="sref">seq /a>)

354 /a>                         a href="+code=snapc" class="sref">snapc /a>-> a href="+code=seq" class="sref">seq /a> =  a href="+code=parent" class="sref">parent /a>-> a href="+code=cached_context" class="sref">cached_context /a>-> a href="+code=seq" class="sref">seq /a>;

355 /a>        }4
356 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=snapc" class="sref">snapc /a>-> a href="+code=snaps" class="sref">snaps /a> +  a href="+code=num" class="sref">num /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=snaps" class="sref">snaps /a>,4
357 /a>               sizeof( a href="+code=u64" class="sref">u64 /a>)* a href="+code=realm" class="sref">realm /a>-> a href="+code=num_snaps" class="sref">num_snaps /a>);

358 /a>         a href="+code=num" class="sref">num /a> +=  a href="+code=realm" class="sref">realm /a>-> a href="+code=num_snaps" class="sref">num_snaps /a>;

359 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=snapc" class="sref">snapc /a>-> a href="+code=snaps" class="sref">snaps /a> +  a href="+code=num" class="sref">num /a>,  a href="+code=realm" class="sref">realm /a>-> a href="+code=prior_parent_snaps" class="sref">prior_parent_snaps /a>,4
360 /a>               sizeof( a href="+code=u64" class="sref">u64 /a>)* a href="+code=realm" class="sref">realm /a>-> a href="+code=num_prior_parent_snaps" class="sref">num_prior_parent_snaps /a>);

361 /a>         a href="+code=num" class="sref">num /a> +=  a href="+code=realm" class="sref">realm /a>-> a href="+code=num_prior_parent_snaps" class="sref">num_prior_parent_snaps /a>;

362 /a>4
363 /a>         a href="+code=sort" class="sref">sort /a>( a href="+code=snapc" class="sref">snapc /a>-> a href="+code=snaps" class="sref">snaps /a>,  a href="+code=num" class="sref">num /a>, sizeof( a href="+code=u64" class="sref">u64 /a>),  a href="+code=cmpu64_rev" class="sref">cmpu64_rev /a>,  a href="+code=NULL" class="sref">NULL /a>);

364 /a>         a href="+code=snapc" class="sref">snapc /a>-> a href="+code=num_snaps" class="sref">num_snaps /a> =  a href="+code=num" class="sref">num /a>;

365 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"build_snap_context %llx %p: %p seq %lld (%u snaps)\n"
366 /a>              a href="+code=realm" class="sref">realm /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=realm" class="sref">realm /a>,  a href="+code=snapc" class="sref">snapc /a>,  a href="+code=snapc" class="sref">snapc /a>-> a href="+code=seq" class="sref">seq /a>,4
367 /a>             (unsigned int)  a href="+code=snapc" class="sref">snapc /a>-> a href="+code=num_snaps" class="sref">num_snaps /a>);

368 /a>

369 /a>        if ( a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>)

370 /a>                 a href="+code=ceph_put_snap_context" class="sref">ceph_put_snap_context /a>( a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>);

371 /a>         a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a> =  a href="+code=snapc" class="sref">snapc /a>;

372 /a>        return 0;

373 /a>4
374 /a> a href="+code=fail" class="sref">fail /a>:4
375 /a>         spai class="comment">/* /spaion
376 /a> spai class="comment">         * if we fail, clear old (incorrect) cached_context... hopefully /spaion
377 /a> spai class="comment">         * we'll have better luck building it later /spaion
378 /a> spai class="comment">         */ /spaion
379 /a>        if ( a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>) {n
380 /a>                 a href="+code=ceph_put_snap_context" class="sref">ceph_put_snap_context /a>( a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a>);

381 /a>                 a href="+code=realm" class="sref">realm /a>-> a href="+code=cached_context" class="sref">cached_context /a> =  a href="+code=NULL" class="sref">NULL /a>;

382 /a>        }4
383 /a>         a href="+code=pr_err" class="sref">pr_err /a>( spai class="string">"build_snap_context %llx %p fail %d\n"realm /a>-> a href="+code=ino" class="sref">ino /a>,4
384 /a>                a href="+code=realm" class="sref">realm /a>,  a href="+code=err" class="sref">err /a>);

385 /a>        return  a href="+code=err" class="sref">err /a>;

386 /a>}4
387 /a>4
388 /a> spai class="comment">/* /spaion
389 /a> spai class="comment"> * rebuild snap context for the given realm and all of its children. /spaion
390 /a> spai class="comment"> */ /spaion
391 /a>static void
 a href="+code=rebuild_snap_realms" class="sref">rebuild_snap_realms /a>(struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=realm" class="sref">realm /a>)n
392 /a>{n
393 /a>        struct  a href="+code=ceph_snap_realm" class="sref">ceph_snap_realm /a> * a href="+code=child" class="sref">child /a>;

394 /a>

395 /a>         a href="+code=dout" class="sref">dout /a>( spai class="string">"rebuild_snap_realms %llx %p\n"realm /a>-> a href="+code=ino" class="sref">ino /a>,  a href="+code=realm" class="sref">realm /a>);

396 /a>         a href="+code=build_snap_context" class="sref">build_snap_context /a>( a href="+code=realm" class="sref">realm /a>);

397 /a>4
398 /a>         a href="+code=list_for_each_entry" class="sref">list_for_each_entry /a>( a href="+code=child" class="sref">child /a>, & a href="+code=realm" class="sref">realm /a>-> a href="+code=children" class="sref">children /a>,  a href="+code=child_item" class="sref">child_item /a>)4
399 /a>                 a href="+code=rebuild_snap_realms" class="sref">rebuild_snap_realms /a>( a href="+code=child" class="sref">child /a>);

40.10a>}4
401 /a>4
402 /a>4
403 /a> spai class="comment">/* /spaion
404 /a> spai class="comment"> * helper to allocate and decode an array of snapids.  free prior /spaion
405 /a> spai class="comment"> * instance, if any. /spaion
406 /a> spai class="comment"> */ /spaion
407 /a>static int  a href="+code=dup_array" class="sref">dup_array /a>( a href="+code=u64" class="sref">u64 /a> ** a href="+code=dst" class="sref">dst /a>,  a href="+code=__le64" class="sref">__le64 /a> * a href="+code=src" class="sref">src /a>,  a href="+code=u32" class="sref">u32 /a>  a href="+code=num" class="sref">num /a>)4
408 /a>{n
409 /a>         a href="+code=u32" class="sref">u32 /a>  a href="+code=i" class="sref">i /a>;

41.10a>4
411 /a>         a href="+code=kfree" class="sref">kfree /a>(* a href="+code=dst" class="sref">dst /a>);

412 /a>        if ( a href="+code=num" class="sref">num /a>) {n
413 /a>                * a href="+code=dst" class="sref">dst /a> =  a href="+code=kcalloc" class="sref">kcalloc /a>( a href="+code=num" class="sref">num /a>, sizeof( a href="+code=u64" class="sref">u64 /a>),  a href="+code=GFP_NOFS" class="sref">GFP_NOFS /a>);

414 /a>                if (!* a href="+code=dst" class="sref">dst /a>)

415 /a>                        return - a href="+code=ENOMEM" class="sref">ENOMEM /a>;

416 /a>                for ( a href="+code=i" class="sref">i /a> = 0;  a href="+code=i" class="sref">i /a> <  a href="+code=num" class="sref">num /a>;  a href="+code=i" class="sref">i /a>++)

417 /a>                        (* a href="+code=dst" class="sref">dst /a>)[ a href="+code=i" class="sref">i /a>] =  a href="+code=get_unaligned_le64" class="sref">get_unaligned_le64 /a>( a href="+code=src" class="sref">src /a> +  a href="+code=i" class="sref">i /a>);

418 /a>        } else {n
419 /a>                * a href="+code=dst" class="sref">dst /a> =  a href="+code=NULL" class="sref">NULL /a>;

420 /a>        }4
421 /a>        return 0;

422 /a>}4
423 /a>4
424 /a>

425 /a> spai class="comment">/* /spaion
426 /a> spai class="comment"> * When a snapshot is applied, the size/mtime inode metadata is queued /spaion
427 /a> spai class="comment"> * in a ceph_cap_snap (one for each snapshot) until writeback /spaion
428 /a> spai class="comment"> * completes and the metadata cai be flushed back to the MDS. /spaion
429 /a> spai class="comment"> * /spaion
430 /a> spai class="comment"> * However, if a (sync) write is currently in-progress when we apply /spaion
431 /a> spai class="comment"> * the snapshot, we have to wait until the write succeeds or fails /spaion
432 /a> spai class="comment"> * (and a final size/mtime is known).  In this case the /spaion
433 /a> spai class="comment"> * cap_snap->writing = 1, and is said to be "pending."  When the write /spaion
434 /a> spai class="comment"> * finishes, we __ceph_finish_cap_snap(). /spaion
435 /a> spai class="comment"> * /spaion
436 /a> spai class="comment"> * Caller must hold snap_rwsem for read (i.e., the realm topology won't /spaion
437 /a> spai class="comment"> * change). /spaion
438 /a> spai class="comment"> */ /spaion
439 /a>void
 a href="+code=ceph_queue_cap_snap" class="sref">ceph_queue_cap_snap /a>(struct  a href="+code=ceph_inode_info" class="sref">ceph_inode_info /a> * a href="+code=ci" class="sref">ci /a>)

440 /a>{n
441 /a>        struct  a href="+code=inode" class="sref">inode /a> * a href="+code=inode" class="sref">inode /a> = & a href="+code=ci" class="sref">ci /a>-> a href="+code=vfs_inode" class="sref">vfs_inode /a>;

442 /a>        struct  a href="+code=ceph_cap_snap" class="sref">ceph_cap_snap /a> * a href="+code=capsnap" class="sref">capsnap /a>;

443 /a>        int  a href="+code=used" class="sref">used /a>,  a href="+code=dirty" class="sref">dirty /a>;

444 /a>

445 /a>         a href="+code=capsnap" class="sref">capsnap /a> =  a href="+code=kzalloc" class="sref">kzalloc /a>(sizeof(* a href="+code=capsnap" class="sref">capsnap /a>),  a href="+code=GFP_NOFS" class="sref">GFP_NOFS /a>);

446 /a>        if (! a href="+code=capsnap" class="sref">capsnap /a>) {n
447 /a>                 a href="+code=pr_err" class="sref">pr_err /a>( spai class="string">"ENOMEM allocating ceph_cap_snap on %p\n"inode /a>);

448 /a>                return;

449 /a>        }4
45.10a>4
451 /a>         a href="+code=spin_lock" class="sref">spin_lock /a>(& a href="+code=ci" class="sref">ci /a>-> a href="+code=i_ceph_lock" class="sref">i_ceph_lock /a>);

452 /a>         a href="+code=used" class="sref">used /a> =  a href="+code=__ceph_caps_used" class="sref">__ceph_caps_used /a>( a href="+code=ci" class="sref">ci /a>);

453 /a>         a href="+code=dirty" class="sref">dirty /a> =  a href="+code=__ceph_caps_dirty" class="sref">__ceph_caps_dirty /a>( a href="+code=ci" class="sref">ci /a>);

454 /a>

455 /a>         spai class="comment">/* /spaion
456 /a> spai class="comment">         * If there is a write in progress, treat that as a dirty Fw, /spaion
457 /a> spai class="comment">         * even though it hasn't completed yet; by the time we finish /spaion
458 /a> spai class="comment">         * up this capsnap it will be. /spaion
459 /a> spai class="comment">         */ /spaion
460 /a>        if ( a href="+code=used" class="sref">used /a> &  a href="+code=CEPH_CAP_FILE_WR" class="sref">CEPH_CAP_FILE_WR /a>)

461 /a>                 a href="+code=dirty" class="sref">dirty /a> |=  a href="+code=CEPH_CAP_FILE_WR" class="sref">CEPH_CAP_FILE_WR /a>;

462 /a>4
463 /a>        if ( a href="+code=__ceph_have_pending_cap_snap" class="sref">__ceph_have_pending_cap_snap /a>( a href="+code=ci" class="sref">ci /a>)) {n
464 /a>                 spai class="comment">/* there is no point in queuing multiple "pending" cap_snaps, /spaion
="+code=__ceph_class="line" n href="fs/ceph/snap.c#L446" idueL446" clas9ss="sref">realm1 /a>460">fde=u64" class="sref">u64 /a>),w/ceph/starteL431"#L465" , soass=line" namlueL465">
="+code=__ceph_css="commeef="+code=realm" class="4ref">46, and my parents' does to.  (this         sref">ufs/ceph/sna cl="s capstart" ideforass="/ceeviou"line" namlueL432">
432 /a> spai cl     (uns4gned int)  a href="+code4snapc46came my parent */ /spaion
460 /a>        iss="commesnap.c#L369" idueL369" c4ass="4649" idueL449" class="="+code=CEPH_CAPebuild_snap_realms %llx %p\n");

448 /a>        if ( a hr4f="+code=realm" class="s4ef">r46" class="sref">rebuild_snap_realms /s="sref">dst /a>);

448 /a>                 4 href="+code=ceph_put_sn4p_con4ext" class="sr"line" "sref">__ceph_have_P_FILE_WR" class="sref">CEPH_CH_CAP_ef">__ceph_have_eL462" clAUTH_EXC idueL420" classeL462" clAUTH_EXC EPH_|f">__ceph_have_eL462" clXATTR_EXC idueL420" classeL462" clXATTR_EXC EPH_|amlueL448">
448 /a>                 acode=realm" class="sref"4realm47pc" class="sref">snapc /a>-> aFILE_WR /a>;
__ceph_have_eL462" cl/ceph/snap.c#L461" idueL461" class="line" n" namlueL464">
464 /a>        return 0;4snapc /a>;
(  class="sref">i_ceph_lock /a>);

462 /a>4
374 /a> a href4"+code=fa4l" class="sref">fail /a>44
460 /a>         spai cla4s="comment">/* /spaionrealm1 /a>460">fde=opefully64 /a ion< sref"snap.ma="fs/ceph/go429" cla>   ldren /ne" namlueL460">
460 /a>         ss="comment">         * if we fai4, cle4r old (incorrect) cached_context... h60">fde=opph/get" claceph/sna>   c"line" namlueL459">
459 /a> spai class="comm4nt">         * we'll4have 4etter luck building it later /spaion<60">fde=o"line" namlueL460">
460 /a>        ass="comm4nt">         */ /spaion<4 href4749" idueL449" class="ref="fs/ceph/snap.c#L337" idueL337" class="line" namlueL337">
337 /a>       4if ( a hr4f="+code=realm" class="s4ef">r47" class="sref">rebuil>-> aFILE_WR /a>;
(  class="sref">i_ceph_lock /a>);
);
);
NULL /a>;

462 /a>4
451 /a>                 4 href="+code=realm" clas4="sre4">realm /a>-> a href="+code=cachedPebuild_snap_realms %llx %p\n"
366 /a>       4}4"fs/ceph/snap.c#L448" idueL448" class="line">)4snapc /a>-> a href="+code=seq" cinode" cla;capsnap /;CEPH_)"namlueL448">
448 /a>         a href="4code=pr_err" class="sref4>pr_e48dst /a> =  a href="+c"fs/ceph/snap.c##39;" idueL448" clas#39;f="fshref="fs/ceph/s#L448" idueL448" class="line" namlueL448">
448 /a>                a4href="+code=realm" class4"sref48ne" namlueL455">
455 /a>        return  a4href="+code=err" class="4ref">48MEM" class="sref">ENOhref="fs/ceph/scode=snapc" class="sref">snapc /a>-> a href="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.c#L339" idueL339" class="line" namlueL339">
339 /a>4i_ceph_loh_caps_dirty /a>(  class="sref">i_ceph_lonamlueL339">
339 /a>4pr_err /a>( spai class="string">&qINIT_LIST_HEADlass="sref">i_cINIT_LIST_HEAD> a href="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.ciap.c#L399" idueL399" is="line" nnamlueL339">
339 /a>4/* /spaioni_cINIT_LIST_HEAD> a href="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.#L429)) {p.c#L399" idueL399"#L429)) {p.c#ne" nnamlueL339">
339 /a>4 * rebuild snap cont4xt fo48ne" namlueL340">
340 /a>       4ass="comm4nt"> */ /spaionceph_put_snap_contexap.c#L447" idueL447" class="line href="fs/ceph/snap.#o>),wchild" class="sr#o>),wch_loh_caps_dirty /a>( ass="sref">snapc /a>-> a h"fs/ceph/snap.c#L355" idueL355" class="line" namlueL355">
355 /a>       4oid
 a hr4f="+code=rebuild_snap_re4lms" 49>realm /a>-> a href="+code=cachedxap.c#L447" idueL447" class="line href="fs/ceph/snap.issu_FILE_WR" class="issu_F_ceph_caps_dirty /a>( a href="+codissu_FILE_WR" class="a href="+codissu_F="fs/ceph/snap.c#L464" idueL464" class="lin"fs/ceph/snap.c#L364" idueL364" class="line" namlueL364">
364 /a>       4f="fs/cep4/snap.c#L393" idueL393" 4lass=49code=parent" class="sf="+code=cachedxap.c#L447" idueL447" class="line href="fs/ceph/snap.aps_dirty" class="sref">__ceph_caps_dirty /a>( L444" idueL444" class="line" namlueL444">
444 /a>

374 /a> a href4="fs/ceph4snap.c#L395" idueL395" c4ass="4932 /a>  a href="+code=i" class="srefxap.c#L447" idueL447" class="line href="fs/ceph/snap.m448" idueL448" clamgt; a hrefhref="fs/ceph/s#L448" idueL448" class="line"ck /a>);

444 /a>
4out /49MEM" class="sref">ENOhref="fs/ceph/sxap.c#L447" idueL447" class="line href="fs/ceph/snap.uiFILE_WR" class="siF_ceph_caps_dirty /a>( #L448" idueL448" class="line"ck /a>);

444 /a>
);

444 /a>

398 /a>       4 a href="4code=list_for_each_entry4 clas4949" idueL449" class="ref=f">__ceph_have_P_FILE_WR" class="sref">CEPH_CH_CAP_f">__ceph_have_eL462" clXATTR_EXC idueL420" classeL462" clXATTR_EXC EPH_" namlueL464">
464 /a>                 4 href="+code=rebuild_sna4_real4s" class="sref">rebuil#39;s sna="+code=nref" a href=">chilxattrs_blobILE_WR" class="a href=">chilxattrs_blobfs/ceph/snap.c#L454" idueL454" class="line" namlueL454">
454 /a>
realm /a>-> aa="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.xattr_blobILE_WR" class="xattr_blob_ceph_amlueL454">
454 /a>
snapc /a>-> a href="+code=snaps"href=">ffer_gpc" class="sref">href=">ffer_gpcfs/ceph/snap.c#L454" idueL454" class="line"ck /a>);
);

454 /a>
para="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.xattr_ap.cio" class="sref">cxattr_ap.cio"ne" h_caps_dirty /a>(  class="sref">i_ceph_lock /a>);
);
cap.cio"ne" namlueL454">
454 /a>

419 /a>       5ass="comm5nt"> * helper to allocat5 and 50s="sref">snapc /a>-> a href="+code=seq" cpap.c#L447" idueL447" class="line href="fs/ceph/snap.xattr_blobILE_WR" class="xattr_blob_ceph_s/ceph/snap.c#L420" idueL420" class="line" namlueL420">
420 /a>       5ass="comm5nt"> * instance, if any.5/spai50MEM" class="sref">ENOMEM /a>;a="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.xattr_ap.cio" class="sref">cxattr_ap.cio"ne" h_c namlueL422">
422 /a>}4 */ /spaion
45.10a>4
398 /a>       5f="fs/cep5/snap.c#L409" idueL409" 5lass=5049" idueL449" class="=ltiple "pending&quo" claspage count moved from ch"fs429" c459" i"sref;line" namlueL460">
460 /a>       5 a href="5code=u32" class="sref">u52 /a>50fs/ceph/snap.c#L460" idueL460" classssssssssss0" isub"liu/snasref">upage " clie347" id47" class c45line" namlueL460">
460 /a>       5="fs/ceph5snap.c#L411" idueL411" c5ass="51e is currently in-progress wwwwwwwwwwwwwwwwwwwlass=hot"s="line" namlueL460">
460 /a>       5 a href="5code=kfree" class="sref"5kfree51>realm /a>-> a href="+code=cachedxap.c#L447" idueL447" class="line href="fs/ceph/snap." cla_pagesILE_WR" class="" cla_pagesne" h_caps_dirty /a>(  class="sref">i_ceph_lock /a>);
ffer_ffer_
420 /a>       5if ( a hr5f="+code=num" class="sre5">num51code=parent" class="sf="+code=cachedxclass="sref">i_ceph_lock /a>);
ffer_ffer_
422 /a>}4dst /a> =  a href="+cf="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.ce=NULL" class="sref">Na>;

372 /a>       5        i5 (!* a href="+code=dst" 5lass=5sref">dst /a>)
(  class="sref">i_ceph_lock /a>);

454 /a>
ENOMEM /a>;f="+code=snaps"href=>srcef="+code=snapc" class="sref">sn>srcef="+code=snfs/ceph/snap.c#L454" idueL454" class="line"ck /a>);
);
);
NULL /a>;

454 /a>
i /a> = 0;  a href=f="+code=cachedPebuild_snap_realms %llx %p\n"inode /a>);
i_ceph_lock /a>);

454 /a>
dst /a>)[ a >);
cadd_t5" idueL375" classef">cadd_t5" > a href="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.ciap.c#L399" idueL399" is="line" ; a href="+code=childr class="sref">i_ceph_lock /a>);

454 /a>

369 /a>       5        *5a href="+code=dst" class5"sref5>dst /a> =  a href="+c href="+code=CEPH_CAP_FILE_WR" class="sref">CEPH_CAP_FILE_WR /a>)

419 /a>       5}4realm /a>-> aa="+code=nref" Pebuild_snap_realms %llx %p\n");

419 /a>       5}a href="5snapc /a>-> a  %p\n");

366 /a>       5f="fs/cep5/snap.c#L423" idueL423" 5lass=52code=parent" class="sref">parent /f="+code=nref" pap.c#L447" idueL447" class="line="+code=snapc" class="sref">snapc /a>-> a href="+code=seq" class="sref">seq /a>,4
454 /a>

454 /a>
dst /a>)

419 /a>       5ass="comm5nt">/* /spaionENOMEM /a>;fltiple "pending&quonote eph/shref=" NOW"s="line" namlueL460">
460 /a>       5ass="comm5nt"> * When a snapshot i5 appl52">i /a> = 0;  a href=parent /f="+code=nref" c#L435" idueL435" clasILE_WR" class="a href= idueL435" clas="fs/ceph/snap.c#L464" idueL464" class="lin"fs/ceph/snap.c#Lnap.c#L447" idueL447" class="line"namlueL448">
448 /a>       5ass="comm5nt"> * in a ceph_cap_sna5 (one52s="sref">dst /a>)[ a namlueL450">
45.10a>4 * completes and the5metad52eL419" class="line" namlueL419">
419 /a>       5ass="comm5nt"> * /spaionrebuild_snap_realms /Pebuild_snap_realms %llx %p\n");

448 /a>       5ass="comm5nt"> * However, if a (sy5c) wr53xt" class="sref">ceph_put_snap_contes="sref">dst /a>);

448 /a>       5ass="comm5nt"> * the snapshot, we 5ave t53pc" class="srnamlueL450">
45.10a>4 * (and a final size5mtime53ne" namlueL463">
463 /a>       5ass="comm5nt"> * cap_snap->writ5ng = 53( a href="+code=snapc" class=>-&gun" class="sref">ci /a>-&gun" cl> a href="+code=nref" pclass="sref">i_ceph_lock /a>);

452 /a>       5ass="comm5nt"> * finishes, we __ce5h_fin5sh_capnamlueL450">
45.10a>4 * /spaion
45.10a>4 * Caller must hold 5nap_r5sem for read (i.e., the realquline" namlueL460">
460 /a>       5ass="comm5nt"> * change). /spaion<5 href5"fs/ceph/snap.c#L438" idueL438"Fhreff=" "fs/ceph, eph/s hrefap5" class..7" iduishreettle"sre href=value5line" namlueL460">
460 /a>       5ass="comm5nt"> */ /spaion
459 /a> spai c5href="+co5e=ceph_queue_cap_snap" c5ass="53nap.c#L430" idueL430" class="line" namlueL430">
430 /a> spai c5f="fs/cep5/snap.c#L441" idueL441" 5lass=54e is currently in-progress wheIf9" idueL4/snacl=""fs#L429" , addeph/s /a>#L429 ef">e /spa="line"1"line" namlueL459">
459 /a> spai c5struct  a5href="+code=inode" class5"sref54wait until the write succeedsline" namlueL459">
459 /a> spai c5sss="comm5href="+code=ceph_cap_sna5" cla54s known).  In this case the /sopology won't2" class="l"line" namlueL459">
459 /a> spai c5sss="comm5f="+code=used" class="sr5f">us54 and is said to be "pend"line" namlueL460">
460 /a>       5="fs/ceph5snap.c#L445" idueL445" c5ass="5ine" n="+code=dirty" clasc#L435" idueL435" clasILE_WR" class="a href= idueL435" clas="fs/h_inode_info /a> * a href="+code=ci" class="sref">ci /a>)

366 /a>       5 a href="5code=capsnap" class="sre5">cap54MEM" class="sref">ENOMEM /a>;;;;;cap_snap /a> * a href="+code=capsnap" class="sref">capsnap /a>;

337 /a>       5if (! a h5ef="+code=capsnap" class5"sref5>capsnnamlueL419">
419 /a>       5         5 href="+code=pr_err" cla5s="sr5f">pr_err /a>( href="+code=inode" class="sref">inode /a> = & a href="+code=ci" class="sref">ci /a>-> a href="+code=vfs_inode" class="sref">vfs_inode /a>;

442 /a>       5        r5turn;
 * a href="+codmds_cliot;p" class="sref">capsmds_cliot;mp; a href="+code=ci"mds="sref">seq /a>,mds=ne" h_caps_dirty /a>(  ">snab_to_cliot;p" class="sref">capsab_to_cliot;f="fshref="fs/ceph/s#L448" idueL448" class="line"ck /a>);
seq /a>,mds=ne" namlueL442">
442 /a>       5 ref="+co5"fs/ceph/snap.c#L450" id5eL45054ne" namlueL340">
340 /a>       5="fs/ceph5snap.c#L451" idueL451" c5ass="55xt" class="sr="fs/ceph/snap.BUG_ON"sref">seq /a>,BUG_ONf="fshref="fs/ceph/snap.c#L447" idueL447" class="line"fs/ceph/snap.c#L367en the 447" idueL447" en the  hre namlueL452">
452 /a>       5 a href="5code=spin_lock" class="s5ef">s5in_lock /a>(& a href="+conap.c#L447" idueL447" class="line"fs/ceph/snap.c#L367cephass="sref">ci /aephne" h_caps_dirty /a>( #L448" idueL448" class="line"ck /a>);
ci //csephne" namlueL442">
442 /a>       5 a href="5code=used" class="sref">5sed /5> =  a href="+code=__ceph_capxap.c#L447" idueL447" class="line href="fs/ceph/snap.mph/s"sref">seq /a>,mph/sne" h_caps_dirty /a>( #L448" idueL448" class="line"ck /a>);
seq /a>,/cmph/sne" namlueL442">
442 /a>       5 ss="comm5code=dirty" class="sref"5dirty5/a> =  a href="+code=__ceph_cxap.c#L447" idueL447" class="line href="fs/ceph/snap.aph/s"sref">seq /a>,aph/sne" h_caps_dirty /a>( #L448" idueL448" class="line"ck /a>);
seq /a>,/caph/sne" namlueL442">
442 /a>       5 "fs/ceph5snap.c#L455" idueL455" c5ass="554> =  a href="+code=__ceph_cxap.c#L447" idueL447" class="line href="fs/ceph/snap.cph/s"sref">seq /a>,cph/sne" h_caps_dirty /a>( #L448" idueL448" class="line"ck /a>);
seq /a>,/ccph/sne" namlueL442">
442 /a>       5 a href="5s="comment">/* /spaion(  class="sref">i_ceph_lock /a>);

442 /a>       5 f (! a h5nt">         * If there 5s a w55capsnap /a>) {n
419 /a>       5ass="comm5nt">         * even thou5h it 55s="sref">dst /a>)[ a >);
);

419 /a>       5ass="comm5nt">         * up this c5psnap5549" idueL449" class=")[ a >%p\n"indo" claspages" class="line" n>"fs/ceph/snap.c#L448" idueL448" class="line">)4
419 /a>       5aref="+co5nt">         */ /spaion<5 href55" class="sref">rebuil#39;sf="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap.ce=NULL" class="sref">Na>;
)4Na>;

419 /a>       5if ( a hr5f="+code=used" class="sr5f">us56class="sref">realm /a>->p /a> * a href="+code=cap;capsnap /;__cep
ci /aephne" =amlueL419">
419 /a>       5ia href="5 href="+code=dirty" clas5="sre5">dirty /a> |=  a href#39;sf="+code=nref" pap.c#L447" idueL447" class="line href="fs/ceph/snap." cla_pagesILE_WR" class="" cla_pagesne" nnamlueL442">
442 /a>       5="fs/ceph5snap.c#L463" idueL463" c5ass="56code=parent" class="s="line" namlueL422">
422 /a>}4
45.10a>4/* t5ere i564> =  a href="+code=__ceph_cPebuild_snap_realms %llx %p\n"
366 /a>       5class="li5e" n href="fs/ceph/snap.5#L44656MEM" class="sref">"fs/ceph/snap.c#L448" idueL448" class="line">)4Na>;
amlueL366">
366 /a>       5cf (! a h5ef="+code=realm" class="5ref">56">i /a> = 0;  a hr4Na>;
 * a href="+code=cap;capsnap /;__cep

366 /a>       5css="comm5gned int)  a href="+code5snapc56s="sref">dst /a>)[ href="fs/ceph/nap.c#L447" idueL447" class="line"fs/ceph/snap.c#L367cephass="sref">ci /aephne" nnamlueL442">
442 /a>       5=ss="comm5snap.c#L369" idueL369" c5ass="56ne" namlueL369">
369 /a>       5if ( a hr5f="+code=realm" class="s5ef">r56" class="srefde=snapc" class=>-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g" class="sref">ci /a /a>#L429g" clne" nnamlueL442">
442 /a>       5         5 href="+code=ceph_put_sn5p_con57xt" class="sr="fs/ceph/snap.ef">cadd_t5" idueL375" classef">cadd_t5" > a href="+code=nref" pidueL454" class="line"ck /a>);
#L429gp.c#ne" =t="+code=i_ceph_lock"mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g"isref">NULL /a>;
#L429g"isrne" nnamlueL442">
442 /a>       5 a href="5code=realm" class="sref"5realm57n_lock /a>(& a href="+code=ciun" class="sref">ci /a>-&gun" cl> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g" class="sref">ci /a /a>#L429g" clne" nnamlueL442">
442 /a>       5 "fs/ceph5;fltiple "pending&quocpology ay wanteph/href= L429glass=nd"line" namlueL460">
460 /a>       5="fs/ceph5snap.c#L374" idueL374" c5ass="5ine" nnamlueL450">
45.10a>4fail /a>54
455 /a>       5 spai cla5s="comment">/* /spaionrequline" namlueL460">
460 /a>       5 ss="comm5nt">         * if we fai5, cle5r old (incorrect) cached_cont* Q" cl65" class= hrefsrefm" class=" href="isc#L437"/spaits children"line" namlueL459">
459 /a> spai c5ass="comm5nt">         * we'll5have 5etter luck building it later /sopolod=underma /a>ion
459 /a> spai c5ass="comm5nt">         */ /spaion<5 href57snap.c#L439" idueL439" class="line" namlueL439">
439 /a>void
 a5if ( a hr5f="+code=realm" class="s5ef">r57" clarray /aeph_queue_cap_snap /o" cla#L437ce" class= idueL298" claso" cla#L437ce" class=="fs/h_inode_info /a> * a href="a /a>i;

337 /a>       5         5 href="+code=ceph_put_sn5p_con58ine" namlueL441">
441 /a>       5         5 href="+code=realm" clas5="sre58inode /a> * a href="+code=inode" clref="+code=ci" class="sref">ci /a>)

442 /a>       5}4ceph_cap_snap /a> * a href=ass="sref">inode /a> = & a href="+code=ci"f">tass="sref">inode /a>f">tass="ne" h_caps_dirty /a>( 20" idueL420" class="line" namlueL420">
420 /a>       5 a href="5code=pr_err" class="sref5>pr_e58dst /a> =  a h_inode_info /a> * a href="a /a>i;

420 /a>       5 +code=fa5href="+code=realm" class5"sref58ne" namlueL455">
455 /a>       5return  a5href="+code=err" class="5ref">58s/ceph/snap.c#+code=__ceph_cPebuild_snap_realms %llx %p\n""fs/ceph/snap.ci;
"fs/ceph/snap.ci;
);
ci/n ne" nnamlueL442">
442 /a>       5f="fs/cep5/snap.c#L387" idueL387" 5lass=58ny ofamlueL442">
442 /a>       5fss="comm5snap.c#L388" idueL388" c5ass="58">pr_err /a>(de=snapc" class=>-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"i;
);

442 /a>       5fss="comm5nt">/* /spaionchre_snap_ clrdirty" class="sref">chre_snap_ clrdf="fshref="fs/ceph/sx" idueL464" class="lin"f="+code=i_ceph_lock"i;
);

366 /a>       5ff ( a hr5nt"> * rebuild snap cont5xt fo58" class="sref">rebuil#39;s snef">"fs/ceph/snap.c#"a /a>i;
i;

419 /a>       5ass="comm5nt"> */ /spaionceph href="+code=inode" class="sref">inode /a> = & a href="+code=ci" class="sref">ci /a>-> a hrefhref="+code=ci" grabILE_WR" class="/grab> a href="+code=nref" pidueL454" class="line"ck /a>);

442 /a>       5oid
 a hr5f="+code=rebuild_snap_re5lms" 59>realm /a>-> a hreref="fs/ceph/snap.c##L448" idueL448" class="line" amlueL442">
442 /a>       5o4
442 /a>       5oa href="5href="+code=ceph_snap_re5lm" c59dst /a> =  a href="+cf="+code=nref" de=ciun" class="sref">ci /a>-&gun" cl> a href="+code=nref" i;
);

442 /a>       5="fs/ceph5snap.c#L395" idueL395" c5ass="5932 /a>  a href="+code{ntass="sref">inode /a>f">tass="ne"  amlueL442">
442 /a>       5oeturn  a5code=dout" class="sref">5out /59MEM" class="sref">ENOs snef">"fs/ceph/snap.c#pbuild_snap_realms#pbuf="fshref="fs/ceph/sf">tass="sref">inode /a>f">tass="ne"  namlueL442">
442 /a>       5=="fs/cep5code=build_snap_context"5class59ny of parent's sna="+code=nref" f">tass="sref">inode /a>f">tass="ne" h_caps_dirty /a>( #L448" idueL448" class="line"namlueL442">
442 /a>       5=ss="comm5snap.c#L398" idueL398" c5ass="59s="sref">dst /a>)[ a >);
cepf="+code=nref" pidueL454" class="line" namlueL442">
442 /a>       5=ss="comm5code=list_for_each_entry5 clas5949" idueL449" class="de=snapc" class=>-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"i;
);

442 /a>       5         5 href="+code=rebuild_sna5_real5s" class="srefnamlueL450">
45.10a>4ci /a>-&gun" cl> a href="+code=nref" i;
);

442 /a>       6f1"fs/cep6/="+code=rebuild_snap_re6ass="60pc" class="sr{ntass="sref">inode /a>f">tass="ne"  amlueL442">
442 /a>       6f2"fs/cep6/snap.c#L393" idueL393" 6ass="60code=parent" class="s"fs/ceph/snap.c#pbuild_snap_realms#pbuf="fshref="fs/ceph/sf">tass="sref">inode /a>f">tass="ne"  namlueL442">
442 /a>       6f3"fs/cep6/ref="+code=ceph_snap_re6/ceph60ne" namlueL374">
374 /a> a href6ass="comm6nt"> * helper to allocat6 and 604> =  a href="+code=__ceph_cef">chre_snap_ clrdirty" class="sref">chre_snap_ clrdf="fshref="fs/ceph/sxhild idueL298" clasrhildne" "f="+code=i_ceph_lock"i;
);
 * a href="hildap.c#L399" idueL399" hildap.c#ne" n namlueL419">
419 /a>       6ass="comm6nt"> * instance, if any.6/spai60MEM" class="sref">ENO#+code=__ceph_cPebuild_snap_realms %llx %p\n"
366 /a>       6ass="comm6nt"> */ /spaionENO#+code=__ceph_ci;
"fs/ceph/snap.ci;
);
ci/n ne" =tp /a> * a href="hild idueL298" clasrhildne" "fp /a> * a href="hild idueL298" clasrhildne" ck /a>);
ci/n ne" nnamlueL442">
442 /a>       6nt  a hre6="+code=dup_array" class6"sref60s="sref">dst /a>)[ a >);
cdelss=iuild_snap_realmsef">cdelss=iu> a href="+code=nref" phild idueL298" clasrhildne" ck /a>);

442 /a>       6n8  a hre6=ode=list_for_each_entry6lass=6049" idueL449" class="="fs/ceph/snap.ef">caddidueL375" classef">cadd> a href="+code=nref" phild idueL298" clasrhildne" ck /a>);
);

442 /a>       6n9  a hre6=href="+code=rebuild_sna62 /a>60" class="srefnamlueL450">
45.10a>4
451 /a>       6 a href="6code=kfree" class="sref"6kfree61n_lock /a>(& a href="+coef">cdelss=iuild_snap_realmsef">cdelss=iu> a href="+code=nref" i;
);

442 /a>       6if ( a hr6f="+code=num" class="sre6">num61 =  a href="+code=__ceph_capPebuild_snap_realms %llx %p\n""fs/ceph/snap.ci;
"fs/ceph/snap.ci;
);
ci/n ne" nnamlueL442">
442 /a>       6        *6a href="+code=dst" class6"sref61ne" nnamlueL450">
45.10a>4
455 /a>       6         6      return - a href="+6ode=E61idueL446" clas9ss="sref">requline" namlueL460">
460 /a>       6        f6r ( a href="+code=i" cla6s="sr61 old (incorrect) cached_cont* Parse"/spaapply/a i   blob "/a>);srefmtraceo,  a afrom  claMDS.  T"iscspecifie5line" namlueL460">
460 /a>       6 t  a hre6      (* a href="+code=d6t" cl61tter luck building it later /s="fslassa#L437"parcodtersafrom a gifini#L437"/spa0" iofaits ancestor="line" namlueL465">
="+code=__ceph6 ="fs/cep6a href="fs/ceph/snap.c#L619" i61snap.c#L439" idueL439" class=rp.c#9" claroot"line" namlueL459">
459 /a> spai c6        *6a href="+code=dst" class6"sref61nap.c#L430" idueL430" class="line" namlueL430">
430 /a> spai c6}4ion
459 /a> spai c6}a href="6
439 /a>void
 a6f="fs/cep6/snap.c#L423" idueL423" 6lass=62code=="+code=dirty" clase_infupdatecd /a>trace+code=ceph_inode_infupdatecd /a>trace="fs/h_inode_info /a> * a href="mds_cliot;p" class="sref">capsmds_cliot;mp; a href="+code=ci"mds="sref">seq /a>,mds=ne" namlueL366">
366 /a>       6="fs/ceph6snap.c#L424" idueL424" c6ass="62dst /a> =  a href="+cparent ////eph_q href="+code=ci""+code=ceph_inod"line=seph_q href="+code=ci"e+code=ceph_inodline">)4cPeletio"ne"  amlueL442">
442 /a>       6=       i6snap.c#L425" idueL425" c6ass="62ref">namlueL419">
419 /a>       6ass="comm6nt">/* /spaioni;

439 /a>void
 a6f       f6nt"> * When a snapshot i6 appl62">i /a> = 0; href="+code=ci"__lepai class="class=__lepamp; a href="+code=ci"lass= idueL298" claslass=="fs; parent's sn">ENO#ltiple "pending&quoene=cidds"line" namlueL439">
439 /a>void
 a6ft  a hre6nt"> * in a ceph_cap_sna6 (one62">pr_err /a>(de=snapc" class__lepai class="class=__lepamp; a href="+code=ci"prior_pardinclass= idueL298" clasprior_pardinclass=="fs; parent&#ltiple "pending&quoene=cidds"line" namlueL439">
439 /a>void
 a6f="fs/cep6nt"> * completes and the6metad6249" idueL449"cap_snap /a> * a href="+coda /a>i;

442 /a>       6ass="comm6nt"> * /spaionci/nvalidatene" h_c namlueL422">
422 /a>}4 * However, if a (sy6c) wr63xt" class="sr="+code=dirty" claserr+code=ceph_inodlrrne" h_c-ode=dirty" clasENOMEM+code=ceph_inodENOMEMmp; namlueL442">
442 /a>       6ass="comm6nt"> * the snapshot, we 6ave t63n_lock /a>(& a href="+coLIST_HEADlass="sref">i_cLIST_HEAD> >);

442 /a>       6ass="comm6nt"> * (and a final size6mtime63ne" namlueL463">
463 /a>       6ass="comm6nt"> * cap_snap->writ6ng = 63( a href="+code=snapc" classPebuild_snap_realms %llx %p\n"trace Peletio"=h/snad" class="line" n>"fs/ceph/snap.cPeletio" class="sref">cPeletio"ne"  namlueL442">
442 /a>       6a       i6nt"> * finishes, we __ce6h_fin6sh_caphref="+code=ci"mors"sref">seq /a>,mors_cap:amlueL442">
442 /a>       6ass="comm6nt"> * /spaion)aephof( href="+code=ci"iidueL454" class=rine" 

442 /a>       6a       f6nt"> * Caller must hold 6nap_r63">i /a> = 0; href="+code=ci"iidueL454" class=rine" h_caps_dirty /a>( "+code=ceph_inod"linenamlueL442">
442 /a>       6at  a hre6nt"> * change). /spaion<6 href63">pr_err /a>(de=snapc" class"+code=ceph_inod"line +=)aephof( href="+code=ci"iidueL454" class=rine" 
namlueL442">
442 /a>       6a="fs/cep6nt"> */ /spaion)aephof(href="+code=ci"upai class="class=upamp; )*shref="fs/ceph/sfe32_to_cpuild_snap_realmsee32_to_cpu> >);

442 /a>       6ass="comm6e=ceph_queue_cap_snap" c6ass="63" class="sref">rebuil#39;s snef">"fs/ceph/snap.cfe32_to_cpuild_snap_realmsee32_to_cpu> >);

442 /a>       6f="fs/cep6/snap.c#L441" idueL441" 6lass=64xt" class="sr="fs/ceph/snap.dass= idueL298" claslass=="fsh_caps_dirty /a>( "+code=ceph_inod"linenamlueL442">
442 /a>       6struct  a6href="+code=inode" class6"sref64n_lock /a>(& a href="+co"+code=ceph_inod"line +=)aephof(href="+code=ci"upai class="class=upamp; ) *>"fs/ceph/snap.cfe32_to_cpuild_snap_realmsee32_to_cpu> >);

442 /a>       6sss="comm6href="+code=ceph_cap_sna6" cla64 =  a href="+code=__ceph_capprior_pardinclass= idueL298" clasprior_pardinclass=="fsh_caps_dirty /a>( "+code=ceph_inod"linenamlueL442">
442 /a>       6sss="comm6f="+code=used" class="sr6f">us64( a href="+code=snapc" class"+code=ceph_inod"line +=)aephof(href="+code=ci"upai class="class=upamp; ) *>"fs/ceph/snap.cfe32_to_cpuild_snap_realmsee32_to_cpu> >);

442 /a>       6s       i6snap.c#L445" idueL445" c6ass="64ne" namlueL455">
455 /a>       6 a href="6code=capsnap" class="sre6">cap64s/ceph/snap.c#+code=__ceph_ci;
(  ">snlookupda /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.cfe64_to_cpuild_snap_realmsee64_to_cpu> >);
ci/n ne" nnnamlueL442">
442 /a>       6s       f6ef="+code=capsnap" class6"sref64capsnap /a>) {n
419 /a>       6         6 href="+code=pr_err" cla6s="sr64s="sref">dst /a>)[ a >);
(  ">snci;
tecd /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.cfe64_to_cpuild_snap_realmsee64_to_cpu> >);
ci/n ne" nnnamlueL442">
442 /a>       6s="fs/cep6turn;
__ceph_have_IS_ERsnap.c#L461" iduIS_ERs> >);

419 /a>       6 ss="comm6"fs/ceph/snap.c#L450" id6eL45064" class="sref">rebuil#39;s sna="+code=nref" err+code=ceph_inodlrrne" h_ca="+code=nref" PTR_ERsnap.c#L461" iduPTR_ERs> >);

442 /a>       6="fs/ceph6snap.c#L451" idueL451" c6ass="65class="sref">realm /a>->tttgotoca="+code=nref" f5" idueL375" classf5" >namlueL442">
442 /a>       6=truct  a6code=spin_lock" class="s6ef">s65>realm /a>-> a hrenamlueL450">
45.10a>46sed /6> =  a href="+namlueL450">
45.10a>4
374 /a> a href6 "fs/ceph6snap.c#L455" idueL455" c6ass="654> =  a href="ltiple "pending&quoensur" "fs/pardinp_sncorrectds"line" namlueL439">
439 /a>void
 a6 a href="6s="comment">/* /spaioni;
i;
);
seq /a>,mds=ne" n>"fs/ceph/snap.ci;
"fs/ceph/snap.cfe64_to_cpuild_snap_realmsee64_to_cpu> >);

442 /a>       6 f (! a h6nt">         * If there 6s a w65capsnap /a>) {n
442 /a>       6ass="comm6nt">         * even thou6h it 65s="sref">dst /a>)[ a gotoca="+code=nref" f5" idueL375" classf5" >namlueL442">
442 /a>       6=="fs/cep6nt">         * up this c6psnap6549" idueL449"="fs/ceph/snap.invalidateclass="sref">ci/nvalidatene" h+_ca="+code=nref" err+code=ceph_inodlrrne" namlueL442">
442 /a>       6=ss="comm6nt">         */ /spaion<6 href65ne" namlueL340">
340 /a>       6if ( a hr6f="+code=used" class="sr6f">us66class="sref">{n);
"fs/ceph/snap.ci;
);

419 /a>       6ia href="6 href="+code=dirty" clas6="sre6">dirty /a> |=  a hrefde=snapc" classPebuild_snap_realms %llx %p\n"trace updat)) oh/snap.xc" clasph/snap.d ck /aph/snap.d" class="line" namlueL366">
366 /a>       6="fs/ceph6snap.c#L463" idueL463" c6ass="66code=parent" class="s hrefde=snapc" classi;
);
ci/n ne" =tp /a> * a href=i;
"fs/ceph/snap.ci;
);
 * a href=fe64_to_cpuild_snap_realmsee64_to_cpu> >);

442 /a>       6if ( a hr6f="+code=__ceph_have_pen6ing_c66dst /a> =  a href="+cfltiple "pending&quoupdatea#L437"parcodters,slassaef">=nd"line" namlueL460">
460 /a>       6         6pai class="comment">/* t6ere i664> =  a href=="s hrefde=snapc" classi;
);
);

442 /a>       6ia href="6e" n href="fs/ceph/snap.6#L44666MEM" class="sref">refde=snapc" classi;
);
);

442 /a>       6if (! a h6ef="+code=realm" class="6ref">66">i /a> = 0;  a hrrefde=snapc" classi;
);
);

442 /a>       6iss="comm6gned int)  a href="+code6snapc66s="sramlueL442">
442 /a>       6i="fs/cep6snap.c#L369" idueL369" c6ass="6649" idueL449" class="="fs/ceph/snap.i;
);
);

442 /a>       6if ( a hr6f="+code=realm" class="s6ef">r66" class="sref">rebuil#+code=__ceph_cerr+code=ceph_inodlrrne" h_ca="+code=nref" dup_arradirty" class="sreup_arrad> a href="+code=nref" i;
);
);

442 /a>       6         6 href="+code=ceph_put_sn6p_con67class="sref">realm /a{n
442 /a>       6 a href="6code=realm" class="sref"6realm67pc" class="sref">snapc /a>-&ggotoca="+code=nref" f5" idueL375" classf5" >namlueL442">
442 /a>       6 "fs/ceph6
463 /a>       6="fs/ceph6snap.c#L374" idueL374" c6ass="67dst /a> =  a href="+cf="+code=nref" i;
);

463 /a>       6=        6l" class="sref">fail /a>64 =  a href=="s hrefhref="+cf="+code=nref" fe32_to_cpuild_snap_realmsee32_to_cpu> >);

442 /a>       6 spai cla6s="comment">/* /spaionrefde=snapc" classerr+code=ceph_inodlrrne" h_ca="+code=nref" dup_arradirty" class="sreup_arrad> a href="+code=nref" i;
);

442 /a>       6 f (! a h6nt">         * if we fai6, cle67">i /a> = 0;  a href=parent /href="+cf="+code=nref" i;
);

442 /a>       6 ss="comm6nt">         * we'll6have 67s="sref">dst /a>)[ a {n
442 /a>       6 ="fs/cep6nt">         */ /spaion<6 href6749" idueL449" class=")[ a -&ggotoca="+code=nref" f5" idueL375" classf5" >namlueL442">
442 /a>       6 f ( a hr6f="+code=realm" class="s6ef">r67ne" namlueL340">
340 /a>       6         6 href="+code=ceph_put_sn6p_con68xt" class="sref">ceph_ltiple "pending&quoq" cl6#L437"hrefss="srefmri;
tionnd"line" namlueL460">
460 /a>       6         6 href="+code=realm" clas6="sre68>dirty /a> |=  a hrefde=snapc" classef">caddidueL375" classef">cadd> a href="+code=nref" i;
);

442 /a>       6}4
463 /a>       6 a href="6code=pr_err" class="sref6>pr_e68dst /a> =  a href="+cf="+code=nref" invalidateclass="sref">ci/nvalidatene" h_c1namlueL454">
454 /a>
 =  a href="line" {nNached_ce=NULLne"   namlueL419">
419 /a>       6return  a6href="+code=err" class="6ref">68MEM" class="sref">ENO#+code=__ceph_cPebuild_snap_realms %llx %p\n"trace h/snap.xc" claspseqph/snap.d new" class="line" namlueL366">
366 /a>       6f="fs/cep6/snap.c#L387" idueL387" 6lass=68ny of parent's sn">ENO#+code=__ceph_ci;
);
ci/n ne" =tp /a> * a href=i;
"fs/ceph/snap.ci;
);

442 /a>       6}ss="comm6snap.c#L388" idueL388" c6ass="68s="sref">dst /a>)[ a >);
ci/nvalidatene" h_c1namlueL454">
454 /a>
/* /spaion
419 /a>       6rf ( a hr6nt"> * rebuild snap cont6xt fo68" class="sref">rebuil#+code=__ceph_cPebuild_snap_realms %llx %p\n"trace h/snap.xc" claspseqph/snap.d un classd" class="line" namlueL366">
366 /a>       6ass="comm6nt"> */ /spaionceph">ENO#+code=__ceph_ci;
);
ci/n ne" =tp /a> * a href=i;
"fs/ceph/snap.ci;
);

442 /a>      "6s        6f="+code=rebuild_snap_re6lms" 69>realm /a>-&gnamlueL450">
45.10a>4
463 /a>       6oa href="6href="+code=ceph_snap_re6lm" c69( a href="+code=snapc" classPebuild_snap_realms %llx %p\n""fs/ceph/snap.ci;
);
ci/n ne" =amlueL463">
463 /a>       6o+code=fa6snap.c#L395" idueL395" c6ass="6932 /a>  a href="+cp /a> * a href=i;
"fs/ceph/snap.cinvalidateclass="sref">ci/nvalidatene" ref="+code=seq" cp idueL298" claspne" ref="+code=seq" ce+code=ceph_inodline"nnamlueL442">
442 /a>      "6seturn  a6code=dout" class="sref">6out /69MEM" amlueL442">
442 /a>      "6s="fs/cep6code=build_snap_context"6class69capsnap /a>) {n
442 /a>      "6sss="comm6snap.c#L398" idueL398" c6ass="69s="sref">dst /a>)[ a gotoca="+code=nref" mors"sref">seq /a>,mors_capnamlueL442">
442 /a>      "6s="fs/cep6code=list_for_each_entry6 clas69ne" namlueL369">
369 /a>       6         6 href="+code=rebuild_sna6_real6s" class="sref_ltiple "pending&quo/nvalidate when wl6#L4ch "fs/_end_ (root)iofa"fs/trace d"line" namlueL460">
460 /a>       7f="fs/cep7/snap.c#L401" idueL401" 7lass=70class="sref">{nci/nvalidatene" namlueL442">
442 /a>      "7f1"fs/cep7/="+code=rebuild_snap_re7ass="70>dirty /a> |=  a hrefde=snapc" classrebuildad /a>i;

442 /a>       7f2"fs/cep7/snap.c#L393" idueL393" 7ass="70ne" namlueL463">
463 /a>       7f3"fs/cep7/ref="+code=ceph_snap_re7/ceph703 class="sref_ltiple "pending&quline" namlueL460">
460 /a>       7f4"fs/cep7/nap.c#L395" idueL395" c7 and 704> = until the write succeeddddddddduoq" cl6cassL298s _after_ wllass=ve builta"fs/newslassace=NULL="line" namlueL465">
="+code=__ceph7ass="comm7nt"> * instance, if any.7/spai70idueL446" clas9ss="sref">reddddddddduos9" cat i_headad /ac6can bepsetaappropriately"line" namlueL459">
459 /a> spai c7ass="comm7nt"> */ /spaion
460 /a>       7f7s="comm7nnap.c#L398" idueL398" c7"sref70s="sref">dst whilecemp_dirty" class="sref">cemp_d> a href="+code=nref" " cla_i;

419 /a>       7n8  a hre7=ode=list_for_each_entry7lass=7049" idueL449" class="="fs/ceph/snap.i;
( ef">chir">ceclrdirty" class="sref">chir">ceclrd> a href="+code=nref" " cla_i;
 * a href="+coda /a>i;

463 /a>       7n9  a hre7=href="+code=rebuild_sna72 /a>70" class="sref">rebuil#39;s snef">L449" class="="fs/ceph/snap." cla_p.c#L399" idueL399"" cla_p.c#ne" nnamlueL442">
442 /a>       7="fs/ceph7snap.c#L411" idueL411" c7ass="71xt" class="sref">ceph_"fs/ceph/snap.o" cla#L437ce" class= idueL298" claso" cla#L437ce" class=="fs/>);

442 /a>       7 a href="7code=kfree" class="sref"7kfree71>realm /a>-&gnamlueL450">
45.10a>4num71ne" namlueL463">
463 /a>       7        *7a href="+code=dst" class7"sref71( a href="+code=snapc" class__cleanupcemp_d_i;
);
seq /a>,mds=ne" nnamlueL442">
442 /a>       7 4"fs/cep7 (!* a href="+code=dst" 7lass=7132 /a>  a hre="line" namlueL422">
422 /a>}4
442 /a>      "7        f7r ( a href="+code=i" cla7s="sr71 old ();

442 /a>       7 t  a hre7      (* a href="+code=d7t" cl71">pr_err /a>(de=snapc" classerr+code=ceph_inodlrrne" h_c-ode=dirty" clasEINVA idueL420" classEINVA _capnamlueL442">
442 /a>      "7 ="fs/cep7a href="fs/ceph/snap.c#L719" i71snap.c="+code=nref" f5" idueL375" classf5" >:amlueL442">
442 /a>       7 9  a hre7a href="+code=dst" class7"sref71" class="srefde=snapc" classpr_err+code=ceph_inodpr_err7;llx %p\n"trace error h/snad" class="line" n>"fs/ceph/snap.cerr+code=ceph_inodlrrne" nnamlueL442">
442 /a>       7}4  a hre="line""fs/ceph/snap.cerr+code=ceph_inodlrrne" namlueL442">
442 /a>       7}a href="7
45.10a>4
463 /a>       7="fs/ceph7snap.c#L424" idueL424" c7ass="72ne" namlueL374">
374 /a> a href7=       i7snap.c#L425" idueL425" c7ass="724> = until the write succeequline" namlueL460">
460 /a>       7ass="comm7nt">/* /spaionred* Sespa0ny65" class=  cat areoq" cld"href L429.  Tryeph/harrd&gne" namlueL460">
460 /a>       7a       f7nt"> * When a snapshot i7 appl72 old (incorrect) cached_cont* s_muNUL across multiplfslassa L429eseph/aeph_qnap.)) ooverhead"line" namlueL459">
459 /a> spai c7ft  a hre7nt"> * in a ceph_cap_sna7 (one72tter luck building it later /line" namlueL459">
459 /a> spai c7f="fs/cep7nt"> * completes and the7metad72snap.c#L439" idueL439" class=ropology#39;s noqnap.s"line" namlueL459">
459 /a> spai c7f9  a hre7nt"> * /spaion
460 /a>       7ass="comm7nt"> * However, if a (sy7c) wr73xt" crray /aeph_queue_cap_snap / L429glass=idueL375" classfL429glass=7;llxh_inode_info /a> * a href="mds_cliot;p" class="sref">capsmds_cliot;mp; a href="+code=ci"mds="sref">seq /a>,mds=ne" namlueL442">
442 /a>      "7ass="comm7nt"> * the snapshot, we 7ave t73n_locnamlueL419">
419 /a>       7ass="comm7nt"> * (and a final size7mtime73="sref">ceph_cap_snap /a> * a href=>caps+code=ci" class="sref">ci /a>)

442 /a>       7ass="comm7nt"> * cap_snap->writ7ng = 73( a href="+co href="+code=inode" class="sref">inode /a> = & a href="+code=ci" class="sref">ci /a>-> a hnamlueL442">
442 /a>       7a       i7nt"> * finishes, we __ce7h_fin734"sref">ceph_cap_snap /a> * a href=>capsmds_aessio" class="sref">c>capsmds_aessio"mp; a href="+code=ci"aessio" class="sref">caessio"mp; a_caps_dirty /a>( 20" idueL420" class="line" namlueL420">
420 /a>       7ass="comm7nt"> * /spaion
442 /a>      "7a       f7nt"> * Caller must hold 7nap_r73">i /a> = 0; href="+code=ci"Pebuild_snap_realms %llx %p\n"
442 /a>       7at  a hre7nt"> * change). /spaion<7 href73">pr_err /a>(de=snapc" class=>-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g" class="sref">ci /a /a>#L429g" clne" nnamlueL442">
442 /a>       7a="fs/cep7nt"> */ /spaioncemp_dirty" class="sref">cemp_d> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g"isref">NULL /a>;
#L429g"isrne" n  namlueL419">
419 /a>       7ass="comm7e=ceph_queue_cap_snap" c7ass="73" class="sref">rebuilh/snap.c#L440" idueL440" class="line" h_caps_dirty /a>( ef">chir">ceclrdirty" class="sref">chir">ceclrd> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g"isref">NULL /a>;
#L429g"isrne" =amlueL463">
463 /a>       7f="fs/cep7/snap.c#L441" idueL441" 7lass=74class="sref">realm /a>->tttf">ceph_cap_snap /a> * a href=>caps+code=ci" class="sref">ci /a>)
#L429gp.c#L399" idueL399"/cd /a>#L429gp.c#ne" nnamlueL442">
442 /a>       7struct  a7href="+code=inode" class7"sref74>dirty /a> |=  a hrefde=snapc" class class="sref">ci /a>-> a hrefa href="+code=nref" pidueL454" class="line"ck /a>);

442 /a>       7sss="comm7href="+code=ceph_cap_sna7" cla74code=parent" class="s"fs/ceph/snap.c##39;s="sref">ci /a>-#39;="fs/>);

442 /a>       7sss="comm7f="+code=used" class="sr7f">us74dst /a> =  a href="+cf="+code=nref" de=ciun" class="sref">ci /a>-&gun" cl> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g" class="sref">ci /a /a>#L429g" clne" nnamlueL442">
442 /a>       7s       i7snap.c#L445" idueL445" c7ass="744> =  a href=="s hrefde=snapc" class=>-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"pidueL454" class="line"ck /a>);

442 /a>       7sss="comm7code=capsnap" class="sre7">cap74MEM" class="sref">ENO#+code=__ceph_c__ref=" L429glass=idueL375" class__ref=" L429glass=="fs/>);
caessio"mp; , 0nnamlueL442">
442 /a>       7s       f7ef="+code=capsnap" class7"sref74">i /a> = 0;  a hrrefde=snapc" classde=ciun" class="sref">ci /a>-&gun" cl> a href="+code=nref" pidueL454" class="line"ck /a>);

442 /a>       7st  a hre7 href="+code=pr_err" cla7s="sr74s="sref">dst /a>)[ a >);

442 /a>       7s="fs/cep7turn;
-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g" class="sref">ci /a /a>#L429g" clne" nnamlueL442">
442 /a>       7 ss="comm7"fs/ceph/snap.c#L450" id7eL45074" class="srefnamlueL450">
45.10a>4ci /a>-&gun" cl> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>#L429g" class="sref">ci /a /a>#L429g" clne" nnamlueL442">
442 /a>       7=truct  a7code=spin_lock" class="s7ef">s75>realamlueL442">
442 /a>       7=ss="comm7code=used" class="sref">7sed /7> =  a href="+{ncaessio"mp;   namlueL419">
419 /a>       7 ss="comm7code=dirty" class="sref"7dirty75dst /a> =  a href="+cf="+code=nref" muNULiun" class="sref">ci /muNULiun" cl> a href="+code=nref" aessio" class="sref">caessio"mp; "fs/ceph/snap.c#L367c_muNUL class="sref">ca_muNULne" nnamlueL442">
442 /a>       7=       i7snap.c#L455" idueL455" c7ass="754> =  a href=="s hrefde=snapc" classref="pbusmds_aessio" class="sref">c>capspbusmds_aessio"f="fshref="fs/ceph/saessio" class="sref">caessio"mp;  namlueL442">
442 /a>       7=ss="comm7s="comment">/* /spaion
45.10a>4         * If there 7s a w75">i /a> = 0; href="+code=ci"Pebuild_snap_realms %llx %p\n"
442 /a>       7=t  a hre7nt">         * even thou7h it 75s="srnamlueL450">
45.10a>4         * up this c7psnap75ne" namlueL369">
369 /a>       7=ss="comm7nt">         */ /spaion<7 href75ne" namlueL340">
340 /a>       7if ( a hr7f="+code=used" class="sr7f">us76e is currently in-progress quline" namlueL460">
460 /a>       7ia href="7 href="+code=dirty" clas7="sre76wait until the write succeeds Handle/a i    notific
tionnfrom  claMDS.line" namlueL460">
460 /a>       7iss="comm7snap.c#L463" idueL463" c7ass="76code=luck building it later /line" namlueL459">
459 /a> spai c7if ( a hr7f="+code=__ceph_have_pen7ing_c76dst /until the write succeeds T"isccan take two basic"hrems:s="fslimplesnp_snjust/a i    ri;
tionline" namlueL459">
459 /a> spai c7i       i7pai class="comment">/* t7ere i764> = until the write succeed* or Peletio" notific
tionnonnil exist)) oi;

459 /a> spai c7iss="comm7e" n href="fs/ceph/snap.7#L44676idueL446" clas9ss="sref">red* #L437"/spaits rhildren.line" namlueL460">
460 /a>       7i       f7ef="+code=realm" class="7ref">76 old (incorrect) cached_cont*line" namlueL460">
460 /a>       7it  a hre7gned int)  a href="+code7snapc76tter luck building it later /sT"fsmors difficultccae" {s #L437"ri;
tion, dueeph/srefmri;
tionnat aline" namlueL460">
460 /a>       7i="fs/cep7snap.c#L369" idueL369" c7ass="76snap.c#L439" idueL439" class=rnewspo="+cins="fsfile
460 /a>       7iss="comm7f="+code=realm" class="s7ef">r76nap.c#L430" idueL430" class=" directoryr="+h/anotheroi;

460 /a>       7         7 href="+code=ceph_put_sn7p_con77e is currently in-progress wh"line" namlueL460">
460 /a>       7 a href="7code=realm" class="sref"7realm77pc" ceph_queue_cap_snap />capshandleglass class="sref">c>capshandleglass7;llxh_inode_info /a> * a href="mds_cliot;p" class="sref">capsmds_cliot;mp; a href="+code=ci"mds="sref">seq /a>,mds=ne" =amlueL463">
463 /a>       7 "fs/ceph7c>capsmds_aessio"mp; a href="+code=ci"aessio" class="sref">caessio"mp; =amlueL463">
463 /a>       7 f ( a hr7snap.c#L374" idueL374" c7ass="77dst /a> =  a href="+c href_cap_snap /a> * a href=>capsmsg class="sref">c>capsmsgmp; a href="+code=ci"msg class="sref">cmsgmp; namlueL442">
442 /a>      "7=        7l" class="sref">fail /a>74namlueL419">
419 /a>       7 spai cla7s="comment">/* /spaionci /auper_b" clmp; a href="+code=ci"abass="sref">ci /abne" h_caps_dirty /a>( mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367fs="sref">seq /a>,fs=ne" "fs/ceph/snap.c#L367cbass="sref">ci /abne" namlueL442">
442 /a>       7 f (! a h7nt">         * if we fai7, cle77">i /a> = 0; ="+code=dirty" clasmds"sref">seq /a>,mdsne" h_caps_dirty /a>( aessio" class="sref">caessio"mp; "fs/ceph/snap.c#L367c_mds"sref">seq /a>,c_mdsne" namlueL442">
442 /a>       7 t  a hre7nt">         * we'll7have 77">pr_err /a>(de=snapc" classupai class="class=upamp; r="fs/ceph/snap.deliuild_snap_realmsdeliune" namlueL442">
442 /a>       7 ="fs/cep7nt">         */ /spaion<7 href7749" idueL449"="+code=dirty" clasos class="sref">co"linenamlueL442">
442 /a>       7 f ( a hr7f="+code=realm" class="s7ef">r77" class="sref="+code=dirty" clastrace_le" class="sref">ctrace_le"linenamlueL442">
442 /a>       7         7 href="+code=ceph_put_sn7p_con78xt" class="srcap_snap /a> * a href="+coda /a>i;
( 20" idueL420" class="line" namlueL420">
420 /a>       7         7 href="+code=realm" clas7="sre78>dirty /a> |=eph_q href="+code=ci""+code=ceph_inod"lineh_caps_dirty /a>( msg class="sref">cmsgmp; "fs/ceph/snap.c#L367frot;p" class="sref"frot;mp; .href="fs/ceph/s#ov_bas8" idueL448" clasov_bas8ne" namlueL420">
420 /a>       7 "fs/ceph7"fs/ceph/snap.c#L383" id7eL383782dirty /a> |=eph_q href="+code=ci"e+code=ceph_inodline"h_caps_dirty /a>( "+code=ceph_inod"line +caps_dirty /a>( msg class="sref">cmsgmp; "fs/ceph/snap.c#L367frot;p" class="sref"frot;mp; .href="fs/ceph/s#ov_le" class="sref">c#ov_le"ne" namlueL420">
420 /a>       7 f ( a hr7code=pr_err" class="sref7>pr_e78( a href="+co href="+code=inode" cl>capsmds_a /a>head class="sref">c>capsmds_a /a>headmp; a href="+code=ci"h class="sref">chne" namlueL420">
420 /a>       7         7href="+code=realm" class7"sref784> =  a href=="+code=dirty" clascumcleliuss="= idueL298" clascumcleliuss="=fs/cn>"fs/ceph/snap.ccumcleliusi;

420 /a>       7 spai cla7href="+code=err" class="7ref">78MEM" class="s#+code=__ceph_c__lepai class="class=__lepamp; a href="+code=ci"leliuss="= idueL298" clasleliuss="=fs/ca_caps_dirty /a>( 20" idueL420" class="line" ,a href="+code=ci"leliusi;
( 20" idueL420" class="line" namlueL420">
420 /a>       7 f (! a h7/snap.c#L387" idueL387" 7lass=78">i /a> = 0; ="+code=dirty" clasidueL454" class=ine" namlueL442">
442 /a>       7}ss="comm7snap.c#L388" idueL388" c7ass="78s="sref">dst ="+code=dirty" clas" cled>ion
422 /a>}4/* /spaion
369 /a>       7rf ( a hr7nt"> * rebuild snap cont7xt fo78" class="sref_ltiple "pending&quodeeph_wh"line" namlueL460">
460 /a>       7ass="comm7nt"> */ /spaion{ncmsgmp; "fs/ceph/snap.c#L367frot;p" class="sref"frot;mp; .href="fs/ceph/s#ov_le" class="sref">c#ov_le"ne"  < aephof( href="+code=ci"h class="sref">chne" )namlueL442">
442 /a>      "7s        7f="+code=rebuild_snap_re7lms" 79>dirty /a> |=  a hrefgotoca="+code=nref" bfsILE_WR" class="bfsne" namlueL422">
422 /a>}4chne" h_caps_dirty /a>( "+code=ceph_inod"linenamlueL442">
442 /a>       7oa href="7href="+code=ceph_snap_re7lm" c79( a href="+code=snapc" classos class="sref">co"lineh_ca="+code=nref" fe32_to_cpuild_snap_realmsee32_to_cpu> >);
chne" "fs/ceph/snap.c#L367os class="sref">co"line namlueL442">
442 /a>       7o+code=fa7snap.c#L395" idueL395" c7ass="7932 /a>  a hre="fs/ceph/snap.deliuild_snap_realmsdeliune" h_ca="+code=nref" fe64_to_cpuild_snap_realmsee64_to_cpu> >);
chne" "fs/ceph/snap.c#L367deliuild_snap_realmsdeliune" );ref_ltiple "pending&quonon-zero>{n
459 /a> spai c7seturn  a7code=dout" class="sref">7out /79idueL446" clas9ss="sref">redddddddddddddddddddddddddddddddddddddddddd* exist)) oi;

460 /a>       7af (! a h7code=build_snap_context"7class79">i /a> = 0; href="+code=ci"cumcleliuss="= idueL298" clascumcleliuss="=fs/ch_ca="+code=nref" fe32_to_cpuild_snap_realmsee32_to_cpu> >);
chne" "fs/ceph/snap.c#L367cumcleliuss="= idueL298" clascumcleliuss="=fs/c namlueL442">
442 /a>       7oss="comm7snap.c#L398" idueL398" c7ass="79">pr_err /a>(de=snapc" classcumcleliusi;
);
chne" "fs/ceph/snap.c#L367cumcleliusi;

442 /a>       7o="fs/cep7code=list_for_each_entry7 clas7949" idueL449"="fs/ceph/snap.trace_le" class="sref">ctrace_le"lineh_ca="+code=nref" fe32_to_cpuild_snap_realmsee32_to_cpu> >);
chne" "fs/ceph/snap.c#L367trace_le" class="sref">ctrace_le"line namlueL442">
442 /a>       7of ( a hr7 href="+code=rebuild_sna7_real79" class="srefde=snapc" classp+code=ceph_inod"line +=)aephof( href="+code=ci"h class="sref">chne" )namlueL442">
442 /a>       8f="fs/cep8/snap.c#L401" idueL401" 8lass=80classamlueL442">
442 /a>       8f1"fs/cep8/="+code=rebuild_snap_re8ass="80n_lock /a>(& a href="+coPebuild_snap_realms %llx %p\n""fs/ceph/snap.cmds"sref">seq /a>,mdsne" =amlueL463">
463 /a>       8f2"fs/cep8/snap.c#L393" idueL393" 8ass="80code=parent" classp /a> * a href="+coda /a>op_eL39 idueL298" clasref="a /a>op_eL39> >);
co"line ref="+code=seq" cleliuild_snap_realmsdeliune" ref="+code=seq" ctrace_le" class="sref">ctrace_le"line namlueL442">
442 /a>       8f3"fs/cep8/ref="+code=ceph_snap_re8/ceph80ne" namlueL374">
374 /a> a href8f4"fs/cep8/nap.c#L395" idueL395" c8 and 8032 /a>  a hre="fs/ceph/snap.muNULi" class="sref">ci /muNULi" cl> a href="+code=nref" aessio" class="sref">caessio"mp; "fs/ceph/snap.c#L367c_muNUL class="sref">ca_muNULne" nnamlueL442">
442 /a>       8ass="comm8nt"> * instance, if any.8/spai80MEM" class="s#+code=__ceph_caessio" class="sref">caessio"mp; "fs/ceph/snap.c#L367c_" idueL367" class="_"line" ++namlueL442">
442 /a>       8a6s="comm8node=build_snap_context"8s/cep80">i /a> = 0; href="+code=ci"muNULiun" class="sref">ci /muNULiun" cl> a href="+code=nref" aessio" class="sref">caessio"mp; "fs/ceph/snap.c#L367c_muNUL class="sref">ca_muNULne" nnamlueL442">
442 /a>       8f7s="comm8nnap.c#L398" idueL398" c8"sref80s="sramlueL442">
442 /a>       8n8  a hre8=ode=list_for_each_entry8lass=8049" idueL449"="fs/ceph/snap.down_writeclass="sref">cidown_write> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>ion
442 /a>       8f9  a hre8=href="+code=rebuild_sna82 /a>80" class="srefde=snapc" class" cled>ion
454 /a>

442 /a>       8 a href="8code=kfree" class="sref"8kfree81>realm /a>-&g{nco"lineh__ca="+code=nref" CEPH_SNAP_OP_SPLIT class="sref">cCEPH_SNAP_OP_SPLITne" n namlueL419">
419 /a>       8if ( a hr8f="+code=num" class="sre8">num81code=parent" class="s href="+code=inode" cl>capsmds_a /a>i;

454 /a>

374 /a> a href8 4"fs/cep8 (!* a href="+code=dst" 8lass=814> =  a href=="s hrefdurrently in-progress quline" namlueL460">
460 /a>       8         8      return - a href="+8ode=E81idueL446" clas9ss="sref">reddddddddddddddddd* A class=deliuclass= bi;
ks"partiofail exist)) oi;

460 /a>       8 6s="comm8r ( a href="+code=i" cla8s="sr81 old (incorrect) cached_contdddddddddddddddd* arnewsi;

460 /a>       8 7s="comm8      (* a href="+code=d8t" cl81tter luck building it later dddddddddddddddd* (witf caps)"/sparhildsi;

460 /a>       8 8  a hre8a href="fs/ceph/snap.c#L819" i81snap.c#L439" idueL439" classdddddddddddddddd* rhild.line" namlueL460">
460 /a>       8 9  a hre8a href="+code=dst" class8"sref81nap.c#L430" idueL430" class=dddddddddddddddd*"line" namlueL460">
460 /a>       8}4ceph_"fs/ceph/snap.leliuss="= idueL298" clasleliuss="=fs/ca_caps_dirty /a>( "+code=ceph_inod"linenamlueL442">
442 /a>       8}a href="8dirty /a> |=  a hrefde=snapc" classp+code=ceph_inod"line +=)aephof(de=snapc" classupai class="class=upamp; )d* eph/snap.c#L367cumcleliuss="= idueL298" clascumcleliuss="=fs/cnamlueL442">
442 /a>       8}f ( a hr8/snap.c#L423" idueL423" 8lass=82code=parent" class="s"fs/ceph/snap.cleliusi;
( "+code=ceph_inod"linenamlueL442">
442 /a>       8}3"fs/cep8snap.c#L424" idueL424" c8ass="82dst /a> =  a href="+cf="+code=nref" p+code=ceph_inod"line +=)aephof(de=snapc" classupai class="class=upamp; )d* eph/snap.c#L367cumcleliusi;

420 /a>       8=       i8snap.c#L425" idueL425" c8ass="824> =  a href=="s hrefde=snapc" classref="deeph__neec idueL298" clasref="deeph__neec> a href="+code=nref" p idueL298" claspne" ref="+code=seq" ce+code=ceph_inodline",)aephof( href="+code=ci"iidueL454" class=rine"  ref="+code=seq" cbfsILE_WR" class="bfsne" nnamlueL442">
442 /a>       8ass="comm8nt">/* /spaionENO#ltiple "pending&quowe will peeknat i;

460 /a>       8}6s="comm8nt"> * When a snapshot i8 appl82 old (incorrect) cached_contdddddddddddddddd* advance p, asa"fs/i;

460 /a>       8}7s="comm8nt"> * in a ceph_cap_sna8 (one82tter luck building it later dddddddddddddddd* ref="updatecd /a>trace.d*"line" namlueL460">
460 /a>       8}8  a hre8nt"> * completes and the8metad8249" idueL449" class="="fs/ceph/snap.iidueL454" class=rine" a_caps_dirty /a>( "+code=ceph_inod"linenamlueL442">
442 /a>       8}9  a hre8nt"> * /spaion
340 /a>       8ass="comm8nt"> * However, if a (sy8c) wr83xt" class="sref">ceph_"fs/ceph/snap.i;
( ref="lookup_a /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.cdeliuild_snap_realmsdeliune" );amlueL340">
340 /a>       8aa href="8nt"> * the snapshot, we 8ave t83>dirty /a> |=  a href{n
419 /a>       8ass="comm8nt"> * (and a final size8mtime83code=parent" class="s href_ph_"fs/ceph/snap.i;
( ref="ri;
te_a /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.cdeliuild_snap_realmsdeliune" );amlueL340">
340 /a>       8a3"fs/cep8nt"> * cap_snap->writ8ng = 83dst /a> =  a href="+c href_&g{n);

442 /a>      "8a       i8nt"> * finishes, we __ce8h_fin834> =  a href=="s hrefffffffffffffffffgotoca="+code=nref" ebuild_snap_realms%ll;amlueL340">
340 /a>       8ass="comm8nt"> * /spaionENOnamlueL450">
45.10a>4 * Caller must hold 8nap_r83">i /a> = 0;  a hrrefde=snapc" classref="get_a /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.ci;

442 /a>       8at  a hre8nt"> * change). /spaion<8 href83s="sramlueL442">
442 /a>       8a="fs/cep8nt"> */ /spaioni;
"fs/ceph/snap.ci;
);
ci/n ne" =>"fs/ceph/snap.ci;

442 /a>       8a9  a hre8e=ceph_queue_cap_snap" c8ass="83" class="sref">rebuilhrefshref="fs/ceph/s#class="sref">ci/mp; a_c0; f="+code=seq" c#class="sref">ci/mp; a< f="+code=seq" ccumcleliuss="= idueL298" clascumcleliuss="=fs/cn f="+code=seq" c#class="sref">ci/mp; ++n namlueL419">
419 /a>       8f="fs/cep8/snap.c#L441" idueL441" 8lass=84class="sref">realm /a>->ttt href="+code=inode" cl>capsv/n class="sref">ci>capsv/n lass=+code=inode" clv/n class="sref">civ/n lass== namlueL419">
419 /a>       8fa href="8href="+code=inode" class8"sref84>dirty /a> |=  a hrefffffffffffffffff.href="fs/ceph/s#n class="sref">ci/n ne" h_ca="+code=nref" fe64_to_cpuild_snap_realmsee64_to_cpu> >);
ci/mp; ])=amlueL463">
463 /a>       8sss="comm8href="+code=ceph_cap_sna8" cla84code=parent" class="sffffffffffffffff.href="fs/ceph/slass class="sref">class7;llh_ca="+code=nref" CEPH_NOSNAP class="sref">cCEPH_NOSNAPne" =amlueL463">
463 /a>       8sss="comm8f="+code=used" class="sr8f">us84dst /a> =  a href="+ccccccccc}namlueL442">
442 /a>       8s       i8snap.c#L445" idueL445" c8ass="844> =  a href=="s href>->ttt href="+code=inode" class="sref">inode /a> = & a href="+code=ci" class="sref">ci /a>-> a ha_caps_dirty /a>( ref="findap.c#L442" idueL442" ref="findap.c#L> >);
ci /abne" =>"fs/ceph/snap.cv/n class="sref">civ/n lassnnamlueL442">
442 /a>       8sss="comm8code=capsnap" class="sre8">cap84MEM" class="sref">ENO>->ttt href="+code=inode" cl>caps+code=ci" class="sref">ci /a>)

442 /a>       8s       f8ef="+code=capsnap" class8"sref84">i /a> = 0;  a hrref>->ttt href="+code=inode" cl>capsa /a>i;

442 /a>       8st  a hre8 href="+code=pr_err" cla8s="sr84s="sramlueL442">
442 /a>       8s="fs/cep8turn;

442 /a>       8s9  a hre8"fs/ceph/snap.c#L450" id8eL45084" class="sref">rebuil#39;s snef">L449ce=NinuenamlueL442">
442 /a>       8="fs/ceph8snap.c#L451" idueL451" c8ass="85class="sref">realm /a>->ttth/snap.c#L440" idueL440" class="line" a_caps_dirty /a>( ref="p.c#L442" idueL442" ref="p.c#L> >);

442 /a>       8=truct  a8code=spin_lock" class="s8ef">s85>realamlueL442">
442 /a>       8=ss="comm8code=used" class="sref">8sed /85code=parent" class="s href_ph_"fs/ceph/snap.=>-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"pidueL454" class="line"ck /a>);

442 /a>       8 ss="comm8code=dirty" class="sref"8dirty85dst /a> =  a href="+c""""""""{n);
i;

442 /a>       8=       i8snap.c#L455" idueL455" c8ass="854> =  a href=="s hrefffffffffffffffffgotoca="+code=nref" skip"p.c#L442" idueL442" skip"p.c#Lne" namlueL442">
442 /a>       8=ss="comm8s="comment">/* /spaionENO>->tttdurrently in-progress quline" namlueL460">
460 /a>       8=       f8nt">         * If there 8s a w85 old (incorrect) cached_contdddddddddddddddddddddddd* Ifa"fisass="l belo) seph/a #L

460 /a>       8=t  a hre8nt">         * even thou8h it 85tter luck building it later dddddddddddddddddddddddd* ri;
ted after ourrnewsi;

460 /a>       8=="fs/cep8nt">         * up this c8psnap85snap.c#L439" idueL439" classdddddddddddddddddddddddd* a #ace (Pueeph/anotherodeliu notific
tionsline" namlueL460">
460 /a>       8=9  a hre8nt">         */ /spaion<8 href85nap.c#L430" idueL430" class=dddddddddddddddddddddddd* arriv)) ofrom a differclaaMDS).  So skipline" namlueL460">
460 /a>       8if ( a hr8f="+code=used" class="sr8f">us86e is currently in-progress =dddddddddddddddddddddddd* "fisass="l.line" namlueL460">
460 /a>       8ia href="8 href="+code=dirty" clas8="sre86wait until the write succeeddddddddddddddddddddddddd*"line" namlueL460">
460 /a>       8iss="comm8snap.c#L463" idueL463" c8ass="86code=parent" class="s href_ph{n);
i;

460 /a>       8iss="comm8f="+code=__ceph_have_pen8ing_c86dst /a> =  a href="+c""""""""""""a="+code=nref" fe64_to_cpuild_snap_realmsee64_to_cpu> >);

419 /a>       8i       i8pai class="comment">/* t8ere i864> =  a href=="s hrefffffffffffffffff="fs/ceph/snap.Pebuild_snap_realms %llx %p\n"
419 /a>       8iss="comm8e" n href="fs/ceph/snap.8#L44686MEM" class="sref">ENO>->tttfffffffffffff="fs/ceph/snap.#L448" idueL448" class="line"=>"fs/ceph/snap.cpidueL454" class="line"ck /a>);
i;
ci/n ne" =amlueL463">
463 /a>       8i       f8ef="+code=realm" class="8ref">86">i /a> = 0;  a hrref>->tttfffffffffffff="fs/ceph/snap.pidueL454" class="line"ck /a>);
i;

460 /a>       8it  a hre8gned int)  a href="+code8snapc86s="sref">dst /a>)[ a                 gotoca="+code=nref" skip"p.c#L442" idueL442" skip"p.c#Lne" namlueL442">
442 /a>       8i="fs/cep8snap.c#L369" idueL369" c8ass="8649" idueL449" class="""""""""namlueL450">
45.10a>4r86" class="sref">rebuil#39;s sn="fs/ceph/snap.Pebuild_snap_realms %llx %p\n"
419 /a>       8         8 href="+code=ceph_put_sn8p_con87class="sref">realm /a>->tttf">ce="fs/ceph/snap.#L448" idueL448" class="line"=>"fs/ceph/snap.ci;
);
ci/n ne" =>"fs/ceph/snap.ci;

442 /a>       8 a href="8code=realm" class="sref"8realm87>dirty /a> |=  a hrefffffffffdurrently in-progress quline" namlueL460">
460 /a>       8 "fs/ceph8
460 /a>       8 ss="comm8snap.c#L374" idueL374" c8ass="87dst /until the write succeed                        *"line" namlueL460">
460 /a>       8=        8l" class="sref">fail /a>84 =  a href=="s hrefffffffff_"fs/ceph/snap.=>-&g" class="sref">ci /a>-> a href="+code=i_ceph_lock"i;
);

442 /a>       8 ss="comm8s="comment">/* /spaionENO>->tttd="+code=nref" ff">cdel"p.iuild_snap_realmsff">cdel"p.iu href="+code=i_ceph_lock"pidueL454" class="line"ck /a>);
i;

442 /a>       8        f8nt">         * if we fai8, cle87">i /a> = 0;  a hrref>->tttd="+code=nref" ff">cadddueL454" class=ff">cadd href="+code=i_ceph_lock"pidueL454" class="line"ck /a>);
i;

419 /a>       8 t  a hre8nt">         * we'll8have 87s="sref">dst /a>)[ a                 f="+code=i_ceph_lock"i;
);

442 /a>       8 ="fs/cep8nt">         */ /spaion<8 href8749" idueL449" class="""""""""href="+code=ci"oldre
( ridueL454" class="line"ck /a>);
i;

442 /a>       8 ss="comm8f="+code=realm" class="s8ef">r87" class="sref">rebuil#39;s sn="fs/ceph/snap.ridueL454" class="line"ck /a>);
i;
( i;

442 /a>       8         8 href="+code=ceph_put_sn8p_con88class="sref">realm /a>->ttth/snap.c#L440" de=ciun" class="sref">ci /a>-&gun" cl> a href="+code=nref" i;
);

442 /a>       8         8 href="+code=realm" clas8="sre88>dirty /a> |=  a hrefffffffffd/snap.c#L440" de=ciun" class="sref">ci /a>-&gun" cl> a href="+code=nref" pidueL454" class="line"ck /a>);

442 /a>       8 "fs/ceph8"fs/ceph/snap.c#L383" id8eL38388ne" namlueL463">
463 /a>       8 f ( a hr8code=pr_err" class="sref8>pr_e88dst /a> =  a href="+c""""""""de=snapc" classref="get_a /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.ci;

442 /a>       8         8href="+code=realm" class8"sref884> =  a href=="s hrefffffffff_"fs/ceph/snap.ref="pbusa /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.coldre

442 /a>       8 ss="comm8href="+code=err" class="8ref">88MEM" amlueL442">
442 /a>      "8 f (! a h8/snap.c#L387" idueL387" 8lass=88">i /a> = 0;  a hrref>->tttd="+code=nref" #pbuild_snap_realms#pbuf="fshref="fs/ceph/s#L448" idueL448" class="line" namlueL442">
442 /a>       8}ss="comm8snap.c#L388" idueL388" c8ass="88s="sref">dst /a>)[ a         ce=NinuenamlueL442">
442 /a>       8 ="fs/cep8nt">/* /spaion
369 /a>       8rf ( a hr8nt"> * rebuild snap cont8xt fo88" claa="+code=nref" skip"p.c#L442" idueL442" skip"p.c#Lne" :amlueL442">
442 /a>       8ass="comm8nt"> */ /spaionrealm /a>->ttth/snap.c#L440" de=ciun" class="sref">ci /a>-&gun" cl> a href="+code=nref" pidueL454" class="line"ck /a>);

442 /a>       8s        8f="+code=rebuild_snap_re8lms" 89>dirty /a> |=  a href>->tttd="+code=nref" #pbuild_snap_realms#pbuf="fshref="fs/ceph/s#L448" idueL448" class="line" namlueL442">
442 /a>       8o4
45.10a>4
374 /a> a href8o+code=fa8snap.c#L395" idueL395" c8ass="894> =  a href=="s hrefdurrently in-progress quowe may haveo"aken someiofa"fs/oldsi;

460 /a>       8seturn  a8code=dout" class="sref">8out /89MEM" class="sref">ENOhrefshref="fs/ceph/s#class="sref">ci/mp; a_c0; f="+code=seq" c#class="sref">ci/mp; a< f="+code=seq" ccumcleliusi;
ci/mp; ++n namlueL419">
419 /a>       8af (! a h8code=build_snap_context"8class89">i /a> = 0;  a hrref>->ttt href="+code=inode" cl>capsa /a>i;

419 /a>       8ass="comm8snap.c#L398" idueL398" c8ass="89s="sref">dst /a>)[ a                 +code=inode" cl>capslookup_a /a>i;
seq /a>,mds=ne" namlueL419">
419 /a>       8a="fs/cep8code=list_for_each_entry8 clas8949" idueL449" class=""""""""" a                 +code=inode" clfe64_to_cpuild_snap_realmsee64_to_cpu> >);
ci/mp; ]) namlueL442">
442 /a>       8of ( a hr8 href="+code=rebuild_sna8_real89" class="sref">rebuil#39;s sn{n
442 /a>       9f="fs/cep9/snap.c#L401" idueL401" 9lass=90class="sref">realm /a>->tttf">ceph_ce=NinuenamlueL442">
442 /a>       9f1"fs/cep9/="+code=rebuild_snap_re9ass="90>dirty /a> |=  a href>->tttd="+code=nref" adjustcd /a>i;
i;
);
seq /a>,mds=ne" n>"fs/ceph/snap.cphild idueL298" clasrhildmp; =>"fs/ceph/snap.ci;
);
ci/n ne"  namlueL442">
442 /a>       9f2"fs/cep9/snap.c#L393" idueL393" 9ass="90code=parent" class "snamlueL450">
45.10a>4
45.10a>4
45.10a>49/spai90MEM" class="s#urrently in-progress quline" namlueL460">
460 /a>       9a6s="comm9node=build_snap_context"9s/cep90 old (incorrect) cached_contdddddddd*iupdateaus)) o"fs/provided/srefmtrace.d{n
460 /a>       9a7s="comm9nnap.c#L398" idueL398" c9"sref90tter luck building it later dddddddd*/sref,owe can aeph_qqueuei) ocap_a /as.line" namlueL460">
460 /a>       9n8  a hre9=ode=list_for_each_entry9lass=90snap.c#L439" idueL439" classdddddddd*"line" namlueL460">
460 /a>       9f9  a hre9=href="+code=rebuild_sna92 /a>90" class="srefde=snapc" classref="updatecd /a>trace idueL298" clasref="updatecd /a>trace> >);
seq /a>,mds=ne" n>"fs/ceph/snap.cp idueL298" claspne" ref="+code=seq" ce+code=ceph_inodline",amlueL460">
460 /a>       9="fs/ceph9snap.c#L411" idueL411" c9ass="91class="sref">realm /a>->tttf">ceph"fs/ceph/snap.cos class="sref">co"lineh__ca="+code=nref" CEPH_SNAP_OP_DESTROY class="sref">cCEPH_SNAP_OP_DESTROYne"  namlueL442">
442 /a>       9 a href="9code=kfree" class="sref"9kfree91>realamlueL442">
442 /a>       9if ( a hr9f="+code=num" class="sre9">num91 =  a href="+{nco"lineh__ca="+code=nref" CEPH_SNAP_OP_SPLIT class="sref">cCEPH_SNAP_OP_SPLITne" namlueL442">
442 /a>       9i3"fs/cep9a href="+code=dst" class9"sref91dst /a> =  a href="+cfurrently in-progress quowe took/a #Lferclce when we ci;
ted "fs/i;

460 /a>       9 4"fs/cep9 (!* a href="+code=dst" 9lass=914> =  a href=="s hrefd"fs/ceph/snap.ref="pbusa /a>i;
seq /a>,mds=ne" n>"fs/ceph/snap.ci;

442 /a>       9         9      return - a href="+9ode=E91MEM" amlueL442">
442 /a>      "9 6s="comm9r ( a href="+code=i" cla9s="sr91">i /a> = 0; href="+code=ci"__cleanup_emptysi;
seq /a>,mds=ne" nnamlueL442">
442 /a>       9 7s="comm9      (* a href="+code=d9t" cl91s="sramlueL442">
442 /a>       9 8  a hre9a href="fs/ceph/snap.c#L919" i9149" idueL449"="fs/ceph/snap.up_writeclass="sref">ciup_write> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>ion
442 /a>       9 9  a hre9a href="+code=dst" class9"sref91ne" namlueL340">
340 /a>       9}4);
seq /a>,mds=ne" nnamlueL442">
442 /a>       9}a href="9dirty /a> |=returnnamlueL442">
442 /a>       9}f ( a hr9/snap.c#L423" idueL423" 9lass=92ne" namlueL463">
463 /a>       9}3"fs/cep9snap.c#L424" idueL424" c9ass="92dst />);

442 /a>       9=       i9snap.c#L425" idueL425" c9ass="924> =  a href="fs/ceph/snap.cpr_err idueL298" claspr_err="fs/>%p\n""fs/ceph/snap.cmds"sref">seq /a>,mdsne" nnamlueL442">
442 /a>       9}        9nt">/* /spaionc>capsmsg_dums="fs/>);
cmsgmp; nnamlueL442">
442 /a>       9}6s="comm9nt"> * When a snapshot i9 appl92 old (="+code=cachedobuild_snap_realms%ll:amlueL442">
442 /a>       9=7s="comm9nt"> * in a ceph_cap_sna9 (one92s="sref">dst =nion
442 /a>       9}8  a hre9nt"> * completes and the9metad9249" idueL449" class="="fs/ceph/snap.up_writeclass="sref">ciup_write> a href="+code=nref" mds="sref">seq /a>,mds=ne" "fs/ceph/snap.c#L367c /a>ion
442 /a>       9}9  a hre9nt"> * /spaion
442 /a>       9ass="comm9nt"> * However, if a (sy9c) wr93xt" cnamlueL450">
45.10a>4 * the snapshot, we 9ave t93>realamlueL442">
442 /a>       9ass="comm9nt"> * (and a final size9mtime93ne" namlueL463">
463 /a>       9a3"fs/cep9nt"> * cap_snap->writ9ng = 93ne" namlueL374">
374 /a> a href9a       i9nt"> * finishes, we __ce9h_fin934> = 
* finifooter"> T"laoriginal LXR softwareoby "fs/mlueL374"http://sourceforge.net/projects/lxr">LXR progunityne" n>"fisaexperigresal versio"oby mlueL374"mailto:lxr@sheux.nosrexr@sheux.none" .
* finisubfooter"> exr.sheux.no kindly hosted by mlueL374"http://www.redpill-shepro.nosrRedpill Lhepro ASne" n>provideriofaLheux_ce=sult)) oand oser tions services silce 1995.