179 if (!(sb=kmalloc(sizeof(struct ip_vs_sync_buff), GFP_ATOMIC)))
180 return NULL;
181
182 if (!(sb->mesg=kmalloc(sync_send_mesg_maxlen, GFP_ATOMIC))) {
183 kfree(sb);
184 return NULL;
185 }
186 sb->mesg->nr_conns = 0;
187 sb->mesg->syncid = ip_vs_master_syncid;
188 sb->mesg->size = 4;
189 sb->head = (unsigned char *)sb->mesg + 4;
190 sb->end = (unsigned char *)sb->mesg + sync_send_mesg_maxlen;
191 sb->firstuse = jiffies;
192 return sb;
193}
194
195static inline void ip_vs_sync_buff_release(struct ip_vs_sync_buff *sb)
196{
197 kfree(sb->mesg);
198 kfree(sb);
199}
200
201static inline void sb_queue_tail(struct ip_vs_sync_buff *sb)
202{
203 spin_lock(&ip_vs_sync_lock);
204 if (ip_vs_sync_state & IP_VS_STATE_MASTER)
205 list_add_tail(&sb->list, &ip_vs_sync_queue);
206 else
207 ip_vs_sync_buff_release(sb);
208 spin_unlock(&ip_vs_sync_lock);
209}
210
211
212
213
214
215static inline struct ip_vs_sync_buff *
216get_curr_sync_buff(unsigned long time)
217{
218 struct ip_vs_sync_buff *sb;
219