unique_id
int64
13
189k
target
int64
0
1
code
stringlengths
20
241k
__index_level_0__
int64
0
18.9k
142,990
0
AtomicString SrcSchemeToURL(TestURLScheme scheme) { switch (scheme) { case TestURLScheme::kHttp: return "http://example.com/foo.mp4"; case TestURLScheme::kHttps: return "https://example.com/foo.mp4"; case TestURLScheme::kFtp: return "ftp://example.com/foo.mp4"; case TestURLScheme::kFile: return "file:///foo/bar.mp4"; case TestURLScheme::kData: return "data:video/mp4;base64,XXXXXXX"; case TestURLScheme::kBlob: return "blob:http://example.com/00000000-0000-0000-0000-000000000000"; default: NOTREACHED(); } return g_empty_atom; }
10,700
175,518
0
IHEVCD_ERROR_T ihevcd_parse_mastering_disp_params_sei(codec_t *ps_codec) { parse_ctxt_t *ps_parse = &ps_codec->s_parse; bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm; UWORD32 value; mastering_dis_col_vol_sei_params_t *ps_mastering_dis_col_vol; WORD32 i; ps_parse->s_sei_params.i4_sei_mastering_disp_colour_vol_params_present_flags = 1; ps_mastering_dis_col_vol = &ps_parse->s_sei_params.s_mastering_dis_col_vol_sei_params; for(i = 0; i < 3; i++) { BITS_PARSE("display_primaries_x[c]", value, ps_bitstrm, 16); ps_mastering_dis_col_vol->au2_display_primaries_x[i] = value; BITS_PARSE("display_primaries_y[c]", value, ps_bitstrm, 16); ps_mastering_dis_col_vol->au2_display_primaries_y[i] = value; } BITS_PARSE("white_point_x", value, ps_bitstrm, 16); ps_mastering_dis_col_vol->u2_white_point_x = value; BITS_PARSE("white_point_y", value, ps_bitstrm, 16); ps_mastering_dis_col_vol->u2_white_point_y = value; BITS_PARSE("max_display_mastering_luminance", value, ps_bitstrm, 32); ps_mastering_dis_col_vol->u4_max_display_mastering_luminance = value; BITS_PARSE("min_display_mastering_luminance", value, ps_bitstrm, 32); ps_mastering_dis_col_vol->u4_min_display_mastering_luminance = value; return (IHEVCD_ERROR_T)IHEVCD_SUCCESS; }
10,701
132,063
0
LayoutBlockFlow::LayoutBlockFlowRareData& LayoutBlockFlow::ensureRareData() { if (m_rareData) return *m_rareData; m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); return *m_rareData; }
10,702
26,629
0
struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, const struct in6_addr *final_dst, bool can_sleep) { struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie); int err; dst = ip6_sk_dst_check(sk, dst, fl6); err = ip6_dst_lookup_tail(sk, &dst, fl6); if (err) return ERR_PTR(err); if (final_dst) ipv6_addr_copy(&fl6->daddr, final_dst); if (can_sleep) fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP; return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); }
10,703
47,240
0
static int des_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct des_ctx *dctx = crypto_tfm_ctx(tfm); u32 *flags = &tfm->crt_flags; u32 tmp[DES_EXPKEY_WORDS]; int ret; /* Expand to tmp */ ret = des_ekey(tmp, key); if (unlikely(ret == 0) && (*flags & CRYPTO_TFM_REQ_WEAK_KEY)) { *flags |= CRYPTO_TFM_RES_WEAK_KEY; return -EINVAL; } /* Copy to output */ memcpy(dctx->expkey, tmp, sizeof(dctx->expkey)); return 0; }
10,704
73,526
0
static MagickBooleanType ReadPSDChannelRLE(Image *image,const PSDInfo *psd_info, const ssize_t type,MagickOffsetType *offsets,ExceptionInfo *exception) { MagickBooleanType status; size_t length, row_size; ssize_t count, y; unsigned char *compact_pixels, *pixels; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " layer data is RLE compressed"); row_size=GetPSDRowSize(image); pixels=(unsigned char *) AcquireQuantumMemory(row_size,sizeof(*pixels)); if (pixels == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); length=0; for (y=0; y < (ssize_t) image->rows; y++) if ((MagickOffsetType) length < offsets[y]) length=(size_t) offsets[y]; compact_pixels=(unsigned char *) AcquireQuantumMemory(length,sizeof(*pixels)); if (compact_pixels == (unsigned char *) NULL) { pixels=(unsigned char *) RelinquishMagickMemory(pixels); ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } (void) ResetMagickMemory(compact_pixels,0,length*sizeof(*compact_pixels)); status=MagickTrue; for (y=0; y < (ssize_t) image->rows; y++) { status=MagickFalse; count=ReadBlob(image,(size_t) offsets[y],compact_pixels); if (count != (ssize_t) offsets[y]) break; count=DecodePSDPixels((size_t) offsets[y],compact_pixels, (ssize_t) (image->depth == 1 ? 123456 : image->depth),row_size,pixels); if (count != (ssize_t) row_size) break; status=ReadPSDChannelPixels(image,psd_info->channels,y,type,pixels, exception); if (status == MagickFalse) break; } compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels); pixels=(unsigned char *) RelinquishMagickMemory(pixels); return(status); }
10,705
51,271
0
static ZIPARCHIVE_METHOD(setCommentName) { struct zip *intern; zval *this = getThis(); int comment_len, name_len; char * comment, *name; int idx; if (!this) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, this); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &comment, &comment_len) == FAILURE) { return; } if (name_len < 1) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name"); } idx = zip_name_locate(intern, name, 0); if (idx < 0) { RETURN_FALSE; } PHP_ZIP_SET_FILE_COMMENT(intern, idx, comment, comment_len); }
10,706
171,460
0
static void set_ppflags(const vpx_codec_alg_priv_t *ctx, vp9_ppflags_t *flags) { flags->post_proc_flag = ctx->postproc_cfg.post_proc_flag; flags->deblocking_level = ctx->postproc_cfg.deblocking_level; flags->noise_level = ctx->postproc_cfg.noise_level; }
10,707
135,373
0
void Document::setImportsController(HTMLImportsController* controller) { ASSERT(!m_importsController || !controller); m_importsController = controller; if (!m_importsController && !loader()) m_fetcher->clearContext(); }
10,708
21,963
0
raptor_libxml_error_common(void* user_data, const char *msg, va_list args, const char *prefix, int is_fatal) { raptor_sax2* sax2 = NULL; int prefix_length = RAPTOR_BAD_CAST(int, strlen(prefix)); int length; char *nmsg; int msg_len; raptor_world* world = NULL; raptor_locator* locator = NULL; if(user_data) { /* Work around libxml2 bug - sometimes the sax2->error * returns a user_data, sometimes the userdata */ if(((raptor_sax2*)user_data)->magic == RAPTOR_LIBXML_MAGIC) sax2 = (raptor_sax2*)user_data; else /* user_data is not userData */ sax2 = (raptor_sax2*)((xmlParserCtxtPtr)user_data)->userData; } if(sax2) { world = sax2->world; locator = sax2->locator; if(locator) raptor_libxml_update_document_locator(sax2, sax2->locator); } msg_len = RAPTOR_BAD_CAST(int, strlen(msg)); length = prefix_length + msg_len + 1; nmsg = RAPTOR_MALLOC(char*, length); if(nmsg) { memcpy(nmsg, prefix, prefix_length); /* Do not copy NUL */ memcpy(nmsg + prefix_length, msg, msg_len + 1); /* Copy NUL */ if(nmsg[length-1] == '\n') nmsg[length-1]='\0'; } if(is_fatal) raptor_log_error_varargs(world, RAPTOR_LOG_LEVEL_FATAL, locator, nmsg ? nmsg : msg, args); else raptor_log_error_varargs(world, RAPTOR_LOG_LEVEL_ERROR, locator, nmsg ? nmsg : msg, args); if(nmsg) RAPTOR_FREE(char*, nmsg); }
10,709
126,662
0
TabStripModel::~TabStripModel() { FOR_EACH_OBSERVER(TabStripModelObserver, observers_, TabStripModelDeleted()); STLDeleteElements(&contents_data_); order_controller_.reset(); }
10,710
56,953
0
static ssize_t fuse_perform_write(struct file *file, struct address_space *mapping, struct iov_iter *ii, loff_t pos) { struct inode *inode = mapping->host; struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_inode *fi = get_fuse_inode(inode); int err = 0; ssize_t res = 0; if (is_bad_inode(inode)) return -EIO; if (inode->i_size < pos + iov_iter_count(ii)) set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); do { struct fuse_req *req; ssize_t count; unsigned nr_pages = fuse_wr_pages(pos, iov_iter_count(ii)); req = fuse_get_req(fc, nr_pages); if (IS_ERR(req)) { err = PTR_ERR(req); break; } count = fuse_fill_write_pages(req, mapping, ii, pos); if (count <= 0) { err = count; } else { size_t num_written; num_written = fuse_send_write_pages(req, file, inode, pos, count); err = req->out.h.error; if (!err) { res += num_written; pos += num_written; /* break out of the loop on short write */ if (num_written != count) err = -EIO; } } fuse_put_request(fc, req); } while (!err && iov_iter_count(ii)); if (res > 0) fuse_write_update_size(inode, pos); clear_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); fuse_invalidate_attr(inode); return res > 0 ? res : err; }
10,711
81,810
0
robj *streamTypeLookupWriteOrCreate(client *c, robj *key) { robj *o = lookupKeyWrite(c->db,key); if (o == NULL) { o = createStreamObject(); dbAdd(c->db,key,o); } else { if (o->type != OBJ_STREAM) { addReply(c,shared.wrongtypeerr); return NULL; } } return o; }
10,712
89,365
0
static int get_aligned_image_size(struct spl_load_info *info, int data_size, int offset) { data_size = data_size + get_aligned_image_overhead(info, offset); if (info->filename) return data_size; return (data_size + info->bl_len - 1) / info->bl_len; }
10,713
52,224
0
static inline int arp_packet_match(const struct arphdr *arphdr, struct net_device *dev, const char *indev, const char *outdev, const struct arpt_arp *arpinfo) { const char *arpptr = (char *)(arphdr + 1); const char *src_devaddr, *tgt_devaddr; __be32 src_ipaddr, tgt_ipaddr; long ret; #define FWINV(bool, invflg) ((bool) ^ !!(arpinfo->invflags & (invflg))) if (FWINV((arphdr->ar_op & arpinfo->arpop_mask) != arpinfo->arpop, ARPT_INV_ARPOP)) { dprintf("ARP operation field mismatch.\n"); dprintf("ar_op: %04x info->arpop: %04x info->arpop_mask: %04x\n", arphdr->ar_op, arpinfo->arpop, arpinfo->arpop_mask); return 0; } if (FWINV((arphdr->ar_hrd & arpinfo->arhrd_mask) != arpinfo->arhrd, ARPT_INV_ARPHRD)) { dprintf("ARP hardware address format mismatch.\n"); dprintf("ar_hrd: %04x info->arhrd: %04x info->arhrd_mask: %04x\n", arphdr->ar_hrd, arpinfo->arhrd, arpinfo->arhrd_mask); return 0; } if (FWINV((arphdr->ar_pro & arpinfo->arpro_mask) != arpinfo->arpro, ARPT_INV_ARPPRO)) { dprintf("ARP protocol address format mismatch.\n"); dprintf("ar_pro: %04x info->arpro: %04x info->arpro_mask: %04x\n", arphdr->ar_pro, arpinfo->arpro, arpinfo->arpro_mask); return 0; } if (FWINV((arphdr->ar_hln & arpinfo->arhln_mask) != arpinfo->arhln, ARPT_INV_ARPHLN)) { dprintf("ARP hardware address length mismatch.\n"); dprintf("ar_hln: %02x info->arhln: %02x info->arhln_mask: %02x\n", arphdr->ar_hln, arpinfo->arhln, arpinfo->arhln_mask); return 0; } src_devaddr = arpptr; arpptr += dev->addr_len; memcpy(&src_ipaddr, arpptr, sizeof(u32)); arpptr += sizeof(u32); tgt_devaddr = arpptr; arpptr += dev->addr_len; memcpy(&tgt_ipaddr, arpptr, sizeof(u32)); if (FWINV(arp_devaddr_compare(&arpinfo->src_devaddr, src_devaddr, dev->addr_len), ARPT_INV_SRCDEVADDR) || FWINV(arp_devaddr_compare(&arpinfo->tgt_devaddr, tgt_devaddr, dev->addr_len), ARPT_INV_TGTDEVADDR)) { dprintf("Source or target device address mismatch.\n"); return 0; } if (FWINV((src_ipaddr & arpinfo->smsk.s_addr) != arpinfo->src.s_addr, ARPT_INV_SRCIP) || FWINV(((tgt_ipaddr & arpinfo->tmsk.s_addr) != arpinfo->tgt.s_addr), ARPT_INV_TGTIP)) { dprintf("Source or target IP address mismatch.\n"); dprintf("SRC: %pI4. Mask: %pI4. Target: %pI4.%s\n", &src_ipaddr, &arpinfo->smsk.s_addr, &arpinfo->src.s_addr, arpinfo->invflags & ARPT_INV_SRCIP ? " (INV)" : ""); dprintf("TGT: %pI4 Mask: %pI4 Target: %pI4.%s\n", &tgt_ipaddr, &arpinfo->tmsk.s_addr, &arpinfo->tgt.s_addr, arpinfo->invflags & ARPT_INV_TGTIP ? " (INV)" : ""); return 0; } /* Look for ifname matches. */ ret = ifname_compare(indev, arpinfo->iniface, arpinfo->iniface_mask); if (FWINV(ret != 0, ARPT_INV_VIA_IN)) { dprintf("VIA in mismatch (%s vs %s).%s\n", indev, arpinfo->iniface, arpinfo->invflags & ARPT_INV_VIA_IN ? " (INV)" : ""); return 0; } ret = ifname_compare(outdev, arpinfo->outiface, arpinfo->outiface_mask); if (FWINV(ret != 0, ARPT_INV_VIA_OUT)) { dprintf("VIA out mismatch (%s vs %s).%s\n", outdev, arpinfo->outiface, arpinfo->invflags & ARPT_INV_VIA_OUT ? " (INV)" : ""); return 0; } return 1; #undef FWINV }
10,714
23,328
0
decode_restorefh(struct xdr_stream *xdr) { return decode_op_hdr(xdr, OP_RESTOREFH); }
10,715
458
0
pdf_copy_pattern_gstate(fz_context *ctx, pdf_gstate *gs, const pdf_gstate *old) { gs->ctm = old->ctm; pdf_drop_font(ctx, gs->text.font); gs->text.font = pdf_keep_font(ctx, old->text.font); pdf_drop_xobject(ctx, gs->softmask); gs->softmask = pdf_keep_xobject(ctx, old->softmask); fz_drop_stroke_state(ctx, gs->stroke_state); gs->stroke_state = fz_keep_stroke_state(ctx, old->stroke_state); }
10,716
43,017
0
static int virtnet_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) { struct virtnet_info *vi = netdev_priv(dev); struct scatterlist sg; sg_init_one(&sg, &vid, sizeof(vid)); if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, VIRTIO_NET_CTRL_VLAN_ADD, &sg)) dev_warn(&dev->dev, "Failed to add VLAN ID %d.\n", vid); return 0; }
10,717
51,457
0
void gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) { int i; int l; l = strlen ((char *) s); for (i = 0; (i < l); i++) { gdImageCharUp(im, f, x, y, s[i], color); y -= f->w; } }
10,718
122,381
0
bool HTMLKeygenElement::appendFormData(FormDataList& encoding, bool) { const AtomicString& keyType = fastGetAttribute(keytypeAttr); if (!keyType.isNull() && !equalIgnoringCase(keyType, "rsa")) return false; String value = signedPublicKeyAndChallengeString(shadowSelect()->selectedIndex(), fastGetAttribute(challengeAttr), document().baseURL()); if (value.isNull()) return false; encoding.appendData(name(), value.utf8()); return true; }
10,719
58,088
0
static ssize_t snd_compr_read(struct file *f, char __user *buf, size_t count, loff_t *offset) { struct snd_compr_file *data = f->private_data; struct snd_compr_stream *stream; size_t avail; int retval; if (snd_BUG_ON(!data)) return -EFAULT; stream = &data->stream; mutex_lock(&stream->device->lock); /* read is allowed when stream is running, paused, draining and setup * (yes setup is state which we transition to after stop, so if user * wants to read data after stop we allow that) */ switch (stream->runtime->state) { case SNDRV_PCM_STATE_OPEN: case SNDRV_PCM_STATE_PREPARED: case SNDRV_PCM_STATE_XRUN: case SNDRV_PCM_STATE_SUSPENDED: case SNDRV_PCM_STATE_DISCONNECTED: retval = -EBADFD; goto out; } avail = snd_compr_get_avail(stream); pr_debug("avail returned %ld\n", (unsigned long)avail); /* calculate how much we can read from buffer */ if (avail > count) avail = count; if (stream->ops->copy) { retval = stream->ops->copy(stream, buf, avail); } else { retval = -ENXIO; goto out; } if (retval > 0) stream->runtime->total_bytes_transferred += retval; out: mutex_unlock(&stream->device->lock); return retval; }
10,720
164,853
0
OnCanDownloadDecidedObserver() : on_decided_called_(false), last_allow_(false) {}
10,721
119,541
0
void simulatePageScale(WebViewImpl* webViewImpl, float& scale) { WebCore::IntSize scrollDelta = webViewImpl->fakePageScaleAnimationTargetPositionForTesting() - webViewImpl->mainFrameImpl()->frameView()->scrollPosition(); float scaleDelta = webViewImpl->fakePageScaleAnimationPageScaleForTesting() / webViewImpl->pageScaleFactor(); webViewImpl->applyScrollAndScale(scrollDelta, scaleDelta); scale = webViewImpl->pageScaleFactor(); }
10,722
67,768
0
static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr) { memset(unix_addr, 0, sizeof(*unix_addr)); unix_addr->sun_family = AF_UNIX; /* we need to be binary safe on systems that support an abstract * namespace */ if (xparam->inputs.namelen >= sizeof(unix_addr->sun_path)) { /* On linux, when the path begins with a NUL byte we are * referring to an abstract namespace. In theory we should * allow an extra byte below, since we don't need the NULL. * BUT, to get into this branch of code, the name is too long, * so we don't care. */ xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1; php_error_docref(NULL, E_NOTICE, "socket path exceeded the maximum allowed length of %lu bytes " "and was truncated", (unsigned long)sizeof(unix_addr->sun_path)); } memcpy(unix_addr->sun_path, xparam->inputs.name, xparam->inputs.namelen); return 1; }
10,723
14,096
0
SProcRenderComposite (ClientPtr client) { register int n; REQUEST(xRenderCompositeReq); swaps(&stuff->length, n); swapl(&stuff->src, n); swapl(&stuff->mask, n); swapl(&stuff->dst, n); swaps(&stuff->xSrc, n); swaps(&stuff->ySrc, n); swaps(&stuff->xMask, n); swaps(&stuff->yMask, n); swaps(&stuff->xDst, n); swaps(&stuff->yDst, n); swaps(&stuff->width, n); swaps(&stuff->height, n); return (*ProcRenderVector[stuff->renderReqType]) (client); }
10,724
141,303
0
HTMLCollection* Document::anchors() { return EnsureCachedCollection<HTMLCollection>(kDocAnchors); }
10,725
154,152
0
const char* GLES2DecoderImpl::GetCommandName(unsigned int command_id) const { if (command_id >= kFirstGLES2Command && command_id < kNumCommands) { return gles2::GetCommandName(static_cast<CommandId>(command_id)); } return GetCommonCommandName(static_cast<cmd::CommandId>(command_id)); }
10,726
115,971
0
void ewk_frame_title_set(Evas_Object* ewkFrame, const char* title) { DBG("ewkFrame=%p, title=%s", ewkFrame, title ? title : "(null)"); EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData); if (!eina_stringshare_replace(&smartData->title, title)) return; evas_object_smart_callback_call(ewkFrame, "title,changed", (void*)smartData->title); }
10,727
169,357
0
void RenderFrameSubmissionObserver::Wait() { run_loop_ = std::make_unique<base::RunLoop>(); run_loop_->Run(); run_loop_.reset(); }
10,728
128,310
0
RenderView* FrameView::renderView() const { return frame().contentRenderer(); }
10,729
176,855
0
const bt_interface_t* getBluetoothInterface() { return sBluetoothInterface; }
10,730
149,990
0
void LayerTreeHostImpl::PinchGestureUpdate(float magnify_delta, const gfx::Point& anchor) { TRACE_EVENT0("cc", "LayerTreeHostImpl::PinchGestureUpdate"); if (!InnerViewportScrollLayer()) return; viewport()->PinchUpdate(magnify_delta, anchor); client_->SetNeedsCommitOnImplThread(); SetNeedsRedraw(); client_->RenewTreePriority(); UpdateRootLayerStateForSynchronousInputHandler(); }
10,731
133,915
0
std::string AppListControllerDelegate::AppListSourceToString( AppListSource source) { switch (source) { case LAUNCH_FROM_APP_LIST: return extension_urls::kLaunchSourceAppList; case LAUNCH_FROM_APP_LIST_SEARCH: return extension_urls::kLaunchSourceAppListSearch; default: return std::string(); } }
10,732
34,369
0
static noinline int can_nocow_odirect(struct btrfs_trans_handle *trans, struct inode *inode, u64 offset, u64 len) { struct btrfs_path *path; int ret; struct extent_buffer *leaf; struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_file_extent_item *fi; struct btrfs_key key; u64 disk_bytenr; u64 backref_offset; u64 extent_end; u64 num_bytes; int slot; int found_type; path = btrfs_alloc_path(); if (!path) return -ENOMEM; ret = btrfs_lookup_file_extent(trans, root, path, btrfs_ino(inode), offset, 0); if (ret < 0) goto out; slot = path->slots[0]; if (ret == 1) { if (slot == 0) { /* can't find the item, must cow */ ret = 0; goto out; } slot--; } ret = 0; leaf = path->nodes[0]; btrfs_item_key_to_cpu(leaf, &key, slot); if (key.objectid != btrfs_ino(inode) || key.type != BTRFS_EXTENT_DATA_KEY) { /* not our file or wrong item type, must cow */ goto out; } if (key.offset > offset) { /* Wrong offset, must cow */ goto out; } fi = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item); found_type = btrfs_file_extent_type(leaf, fi); if (found_type != BTRFS_FILE_EXTENT_REG && found_type != BTRFS_FILE_EXTENT_PREALLOC) { /* not a regular extent, must cow */ goto out; } disk_bytenr = btrfs_file_extent_disk_bytenr(leaf, fi); backref_offset = btrfs_file_extent_offset(leaf, fi); extent_end = key.offset + btrfs_file_extent_num_bytes(leaf, fi); if (extent_end < offset + len) { /* extent doesn't include our full range, must cow */ goto out; } if (btrfs_extent_readonly(root, disk_bytenr)) goto out; /* * look for other files referencing this extent, if we * find any we must cow */ if (btrfs_cross_ref_exist(trans, root, btrfs_ino(inode), key.offset - backref_offset, disk_bytenr)) goto out; /* * adjust disk_bytenr and num_bytes to cover just the bytes * in this extent we are about to write. If there * are any csums in that range we have to cow in order * to keep the csums correct */ disk_bytenr += backref_offset; disk_bytenr += offset - key.offset; num_bytes = min(offset + len, extent_end) - offset; if (csum_exist_in_range(root, disk_bytenr, num_bytes)) goto out; /* * all of the above have passed, it is safe to overwrite this extent * without cow */ ret = 1; out: btrfs_free_path(path); return ret; }
10,733
33,281
0
void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) { /* Address WBINVD may be executed by guest */ if (need_emulate_wbinvd(vcpu)) { if (kvm_x86_ops->has_wbinvd_exit()) cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask); else if (vcpu->cpu != -1 && vcpu->cpu != cpu) smp_call_function_single(vcpu->cpu, wbinvd_ipi, NULL, 1); } kvm_x86_ops->vcpu_load(vcpu, cpu); /* Apply any externally detected TSC adjustments (due to suspend) */ if (unlikely(vcpu->arch.tsc_offset_adjustment)) { adjust_tsc_offset_host(vcpu, vcpu->arch.tsc_offset_adjustment); vcpu->arch.tsc_offset_adjustment = 0; set_bit(KVM_REQ_CLOCK_UPDATE, &vcpu->requests); } if (unlikely(vcpu->cpu != cpu) || check_tsc_unstable()) { s64 tsc_delta = !vcpu->arch.last_host_tsc ? 0 : native_read_tsc() - vcpu->arch.last_host_tsc; if (tsc_delta < 0) mark_tsc_unstable("KVM discovered backwards TSC"); if (check_tsc_unstable()) { u64 offset = kvm_x86_ops->compute_tsc_offset(vcpu, vcpu->arch.last_guest_tsc); kvm_x86_ops->write_tsc_offset(vcpu, offset); vcpu->arch.tsc_catchup = 1; } /* * On a host with synchronized TSC, there is no need to update * kvmclock on vcpu->cpu migration */ if (!vcpu->kvm->arch.use_master_clock || vcpu->cpu == -1) kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); if (vcpu->cpu != cpu) kvm_migrate_timers(vcpu); vcpu->cpu = cpu; } accumulate_steal_time(vcpu); kvm_make_request(KVM_REQ_STEAL_UPDATE, vcpu); }
10,734
184,075
1
PP_InputEvent_Type ConvertEventTypes(WebInputEvent::Type wetype) { switch (wetype) { case WebInputEvent::MouseDown: return PP_INPUTEVENT_TYPE_MOUSEDOWN; case WebInputEvent::MouseUp: return PP_INPUTEVENT_TYPE_MOUSEUP; case WebInputEvent::MouseMove: return PP_INPUTEVENT_TYPE_MOUSEMOVE; case WebInputEvent::MouseEnter: return PP_INPUTEVENT_TYPE_MOUSEENTER; case WebInputEvent::MouseLeave: return PP_INPUTEVENT_TYPE_MOUSELEAVE; case WebInputEvent::MouseWheel: return PP_INPUTEVENT_TYPE_MOUSEWHEEL; case WebInputEvent::RawKeyDown: return PP_INPUTEVENT_TYPE_RAWKEYDOWN; case WebInputEvent::KeyDown: return PP_INPUTEVENT_TYPE_KEYDOWN; case WebInputEvent::KeyUp: return PP_INPUTEVENT_TYPE_KEYUP; case WebInputEvent::Char: return PP_INPUTEVENT_TYPE_CHAR; case WebInputEvent::Undefined: default: return PP_INPUTEVENT_TYPE_UNDEFINED; } }
10,735
173,016
0
display_clean_write(struct display *dp) { if (dp->write_pp != NULL) png_destroy_write_struct(&dp->write_pp, NULL); }
10,736
131,004
0
static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectV8Internal::reflectedStringAttrAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
10,737
110,707
0
bool BasePrefsChange::Init(Profile* profile) { if (!BaseSettingChange::Init(profile)) return false; pref_observer_.reset(new PrefSetObserver(profile->GetPrefs(), this)); return true; }
10,738
66,327
0
static void gen_compute_eflags(DisasContext *s) { TCGv zero, dst, src1, src2; int live, dead; if (s->cc_op == CC_OP_EFLAGS) { return; } if (s->cc_op == CC_OP_CLR) { tcg_gen_movi_tl(cpu_cc_src, CC_Z | CC_P); set_cc_op(s, CC_OP_EFLAGS); return; } TCGV_UNUSED(zero); dst = cpu_cc_dst; src1 = cpu_cc_src; src2 = cpu_cc_src2; /* Take care to not read values that are not live. */ live = cc_op_live[s->cc_op] & ~USES_CC_SRCT; dead = live ^ (USES_CC_DST | USES_CC_SRC | USES_CC_SRC2); if (dead) { zero = tcg_const_tl(0); if (dead & USES_CC_DST) { dst = zero; } if (dead & USES_CC_SRC) { src1 = zero; } if (dead & USES_CC_SRC2) { src2 = zero; } } gen_update_cc_op(s); gen_helper_cc_compute_all(cpu_cc_src, dst, src1, src2, cpu_cc_op); set_cc_op(s, CC_OP_EFLAGS); if (dead) { tcg_temp_free(zero); } }
10,739
70,794
0
static HTTPContext *find_rtp_session_with_url(const char *url, const char *session_id) { HTTPContext *rtp_c; char path1[1024]; const char *path; char buf[1024]; int s, len; rtp_c = find_rtp_session(session_id); if (!rtp_c) return NULL; /* find which URL is asked */ av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url); path = path1; if (*path == '/') path++; if(!strcmp(path, rtp_c->stream->filename)) return rtp_c; for(s=0; s<rtp_c->stream->nb_streams; ++s) { snprintf(buf, sizeof(buf), "%s/streamid=%d", rtp_c->stream->filename, s); if(!strncmp(path, buf, sizeof(buf))) /* XXX: Should we reply with RTSP_STATUS_ONLY_AGGREGATE * if nb_streams>1? */ return rtp_c; } len = strlen(path); if (len > 0 && path[len - 1] == '/' && !strncmp(path, rtp_c->stream->filename, len - 1)) return rtp_c; return NULL; }
10,740
131,629
0
static void raisesExceptionVoidMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::raisesExceptionVoidMethodOptionalLongArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
10,741
138,774
0
void RenderFrameHostImpl::OnUpdateEncoding(const std::string& encoding_name) { delegate_->UpdateEncoding(this, encoding_name); }
10,742
109,960
0
AudioOutputDevice::AudioThreadCallback::AudioThreadCallback( const AudioParameters& audio_parameters, int input_channels, base::SharedMemoryHandle memory, int memory_length, AudioRendererSink::RenderCallback* render_callback) : AudioDeviceThread::Callback(audio_parameters, input_channels, memory, memory_length), render_callback_(render_callback) { }
10,743
79,710
0
struct r_bin_mdmp_obj *r_bin_mdmp_new_buf(struct r_buf_t *buf) { bool fail = false; struct r_bin_mdmp_obj *obj = R_NEW0 (struct r_bin_mdmp_obj); if (!obj) { return NULL; } obj->kv = sdb_new0 (); obj->b = r_buf_new (); obj->size = (ut32)buf->length; fail |= (!(obj->streams.ex_threads = r_list_new ())); fail |= (!(obj->streams.memories = r_list_new ())); fail |= (!(obj->streams.memories64.memories = r_list_new ())); fail |= (!(obj->streams.memory_infos = r_list_new ())); fail |= (!(obj->streams.modules = r_list_new ())); fail |= (!(obj->streams.operations = r_list_new ())); fail |= (!(obj->streams.thread_infos = r_list_new ())); fail |= (!(obj->streams.threads = r_list_new ())); fail |= (!(obj->streams.unloaded_modules = r_list_new ())); fail |= (!(obj->pe32_bins = r_list_newf (r_bin_mdmp_free_pe32_bin))); fail |= (!(obj->pe64_bins = r_list_newf (r_bin_mdmp_free_pe64_bin))); if (fail) { r_bin_mdmp_free (obj); return NULL; } if (!r_buf_set_bytes (obj->b, buf->buf, buf->length)) { r_bin_mdmp_free (obj); return NULL; } if (!r_bin_mdmp_init (obj)) { r_bin_mdmp_free (obj); return NULL; } return obj; }
10,744
161,154
0
bool MediaStreamManager::RequestDone(const DeviceRequest& request) const { DCHECK_CURRENTLY_ON(BrowserThread::IO); const bool requested_audio = IsAudioInputMediaType(request.audio_type()); const bool requested_video = IsVideoMediaType(request.video_type()); const bool audio_done = !requested_audio || request.state(request.audio_type()) == MEDIA_REQUEST_STATE_DONE || request.state(request.audio_type()) == MEDIA_REQUEST_STATE_ERROR; if (!audio_done) return false; const bool video_done = !requested_video || request.state(request.video_type()) == MEDIA_REQUEST_STATE_DONE || request.state(request.video_type()) == MEDIA_REQUEST_STATE_ERROR; if (!video_done) return false; return true; }
10,745
45,859
0
static int crypto_pcbc_init_tfm(struct crypto_tfm *tfm) { struct crypto_instance *inst = (void *)tfm->__crt_alg; struct crypto_spawn *spawn = crypto_instance_ctx(inst); struct crypto_pcbc_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_cipher *cipher; cipher = crypto_spawn_cipher(spawn); if (IS_ERR(cipher)) return PTR_ERR(cipher); ctx->child = cipher; return 0; }
10,746
56,159
0
int __ext4_journal_get_write_access(const char *where, unsigned int line, handle_t *handle, struct buffer_head *bh) { int err = 0; might_sleep(); if (ext4_handle_valid(handle)) { err = jbd2_journal_get_write_access(handle, bh); if (err) ext4_journal_abort_handle(where, line, __func__, bh, handle, err); } return err; }
10,747
78,359
0
static int entersafe_set_security_env(sc_card_t *card, const sc_security_env_t *env, int se_num) { assert(card); assert(env); SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); if(card->drv_data){ free(card->drv_data); card->drv_data=0; } card->drv_data = calloc(1,sizeof(*env)); if(!card->drv_data) SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE, SC_ERROR_OUT_OF_MEMORY); memcpy(card->drv_data,env,sizeof(*env)); SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE, SC_SUCCESS); }
10,748
72,691
0
static void jas_icccurv_destroy(jas_iccattrval_t *attrval) { jas_icccurv_t *curv = &attrval->data.curv; if (curv->ents) { jas_free(curv->ents); curv->ents = 0; } }
10,749
6,337
0
static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) { char *format; int format_len; long ts; char *string; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { RETURN_FALSE; } if (ZEND_NUM_ARGS() == 1) { ts = time(NULL); } string = php_format_date(format, format_len, ts, localtime TSRMLS_CC); RETVAL_STRING(string, 0); }
10,750
45,108
0
static int lua_websocket_ping(lua_State *L) { apr_socket_t *sock; apr_size_t plen; char prelude[2]; apr_status_t rv; request_rec *r = ap_lua_check_request_rec(L, 1); sock = ap_get_conn_socket(r->connection); /* Send a header that says: PING. */ prelude[0] = 0x89; /* ping opcode */ prelude[1] = 0; plen = 2; apr_socket_send(sock, prelude, &plen); /* Get opcode and FIN bit from pong */ plen = 2; rv = apr_socket_recv(sock, prelude, &plen); if (rv == APR_SUCCESS) { unsigned char opcode = prelude[0]; unsigned char len = prelude[1]; unsigned char mask = len >> 7; if (mask) len -= 128; plen = len; ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Websocket: Got PONG opcode: %x", opcode); if (opcode == 0x8A) { lua_pushboolean(L, 1); } else { lua_pushboolean(L, 0); } if (plen > 0) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "Websocket: Reading %" APR_SIZE_T_FMT " bytes of PONG", plen); return 1; } if (mask) { plen = 2; apr_socket_recv(sock, prelude, &plen); plen = 2; apr_socket_recv(sock, prelude, &plen); } } else { lua_pushboolean(L, 0); } return 1; }
10,751
81,798
0
void streamIteratorStart(streamIterator *si, stream *s, streamID *start, streamID *end, int rev) { /* Intialize the iterator and translates the iteration start/stop * elements into a 128 big big-endian number. */ if (start) { streamEncodeID(si->start_key,start); } else { si->start_key[0] = 0; si->start_key[0] = 0; } if (end) { streamEncodeID(si->end_key,end); } else { si->end_key[0] = UINT64_MAX; si->end_key[0] = UINT64_MAX; } /* Seek the correct node in the radix tree. */ raxStart(&si->ri,s->rax); if (!rev) { if (start && (start->ms || start->seq)) { raxSeek(&si->ri,"<=",(unsigned char*)si->start_key, sizeof(si->start_key)); if (raxEOF(&si->ri)) raxSeek(&si->ri,"^",NULL,0); } else { raxSeek(&si->ri,"^",NULL,0); } } else { if (end && (end->ms || end->seq)) { raxSeek(&si->ri,"<=",(unsigned char*)si->end_key, sizeof(si->end_key)); if (raxEOF(&si->ri)) raxSeek(&si->ri,"$",NULL,0); } else { raxSeek(&si->ri,"$",NULL,0); } } si->stream = s; si->lp = NULL; /* There is no current listpack right now. */ si->lp_ele = NULL; /* Current listpack cursor. */ si->rev = rev; /* Direction, if non-zero reversed, from end to start. */ }
10,752
18,818
0
void cipso_v4_doi_putdef(struct cipso_v4_doi *doi_def) { if (doi_def == NULL) return; if (!atomic_dec_and_test(&doi_def->refcount)) return; spin_lock(&cipso_v4_doi_list_lock); list_del_rcu(&doi_def->list); spin_unlock(&cipso_v4_doi_list_lock); cipso_v4_cache_invalidate(); call_rcu(&doi_def->rcu, cipso_v4_doi_free_rcu); }
10,753
179,031
1
static struct vm_area_struct *vma_to_resize(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long *p) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma = find_vma(mm, addr); if (!vma || vma->vm_start > addr) goto Efault; if (is_vm_hugetlb_page(vma)) goto Einval; /* We can't remap across vm area boundaries */ if (old_len > vma->vm_end - addr) goto Efault; if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)) { if (new_len > old_len) goto Efault; } if (vma->vm_flags & VM_LOCKED) { unsigned long locked, lock_limit; locked = mm->locked_vm << PAGE_SHIFT; lock_limit = rlimit(RLIMIT_MEMLOCK); locked += new_len - old_len; if (locked > lock_limit && !capable(CAP_IPC_LOCK)) goto Eagain; } if (!may_expand_vm(mm, (new_len - old_len) >> PAGE_SHIFT)) goto Enomem; if (vma->vm_flags & VM_ACCOUNT) { unsigned long charged = (new_len - old_len) >> PAGE_SHIFT; if (security_vm_enough_memory(charged)) goto Efault; *p = charged; } return vma; Efault: /* very odd choice for most of the cases, but... */ return ERR_PTR(-EFAULT); Einval: return ERR_PTR(-EINVAL); Enomem: return ERR_PTR(-ENOMEM); Eagain: return ERR_PTR(-EAGAIN); }
10,754
65,478
0
get_clnt_odstate(struct nfs4_clnt_odstate *co) { if (co) atomic_inc(&co->co_odcount); }
10,755
39,281
0
static void security_load_policycaps(void) { selinux_policycap_netpeer = ebitmap_get_bit(&policydb.policycaps, POLICYDB_CAPABILITY_NETPEER); selinux_policycap_openperm = ebitmap_get_bit(&policydb.policycaps, POLICYDB_CAPABILITY_OPENPERM); selinux_policycap_alwaysnetwork = ebitmap_get_bit(&policydb.policycaps, POLICYDB_CAPABILITY_ALWAYSNETWORK); }
10,756
95,888
0
void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) { int i, type; char info[MAX_INFO_STRING]; char *infoString; int prot; char *gamename; qboolean gameMismatch; infoString = MSG_ReadString( msg ); gamename = Info_ValueForKey( infoString, "gamename" ); #ifdef LEGACY_PROTOCOL if (com_legacyprotocol->integer && !*gamename) gameMismatch = qfalse; else #endif gameMismatch = !*gamename || strcmp(gamename, com_gamename->string) != 0; if (gameMismatch) { Com_DPrintf( "Game mismatch in info packet: %s\n", infoString ); return; } prot = atoi( Info_ValueForKey( infoString, "protocol" ) ); if(prot != com_protocol->integer #ifdef LEGACY_PROTOCOL && prot != com_legacyprotocol->integer #endif ) { Com_DPrintf( "Different protocol info packet: %s\n", infoString ); } for ( i = 0; i < MAX_PINGREQUESTS; i++ ) { if ( cl_pinglist[i].adr.port && !cl_pinglist[i].time && NET_CompareAdr( from, cl_pinglist[i].adr ) ) { cl_pinglist[i].time = Sys_Milliseconds() - cl_pinglist[i].start; Com_DPrintf( "ping time %dms from %s\n", cl_pinglist[i].time, NET_AdrToString( from ) ); Q_strncpyz( cl_pinglist[i].info, infoString, sizeof( cl_pinglist[i].info ) ); switch ( from.type ) { case NA_BROADCAST: case NA_IP: type = 1; break; case NA_IP6: type = 2; break; default: type = 0; break; } Info_SetValueForKey( cl_pinglist[i].info, "nettype", va( "%d", type ) ); CL_SetServerInfoByAddress( from, infoString, cl_pinglist[i].time ); return; } } if ( cls.pingUpdateSource != AS_LOCAL ) { return; } for ( i = 0 ; i < MAX_OTHER_SERVERS ; i++ ) { if ( cls.localServers[i].adr.port == 0 ) { break; } if ( NET_CompareAdr( from, cls.localServers[i].adr ) ) { return; } } if ( i == MAX_OTHER_SERVERS ) { Com_DPrintf( "MAX_OTHER_SERVERS hit, dropping infoResponse\n" ); return; } cls.numlocalservers = i + 1; CL_InitServerInfo( &cls.localServers[i], &from ); Q_strncpyz( info, MSG_ReadString( msg ), MAX_INFO_STRING ); if ( strlen( info ) ) { if ( info[strlen( info ) - 1] != '\n' ) { Q_strcat( info, sizeof(info), "\n" ); } Com_Printf( "%s: %s", NET_AdrToStringwPort( from ), info ); } }
10,757
19,189
0
void dns_resolve_domain(s2s_t s2s, dnscache_t dns) { dnsquery_t query = (dnsquery_t) calloc(1, sizeof(struct dnsquery_st)); query->s2s = s2s; query->results = xhash_new(71); if (idna_to_ascii_8z(dns->name, &query->name, 0) != IDNA_SUCCESS) { log_write(s2s->log, LOG_ERR, "idna dns encode for %s failed", dns->name); /* shortcut resolution failure */ query->expiry = time(NULL) + 99999999; out_resolve(query->s2s, dns->name, query->results, query->expiry); return; } query->hosts = xhash_new(71); query->srv_i = -1; query->expiry = 0; query->cur_host = NULL; query->cur_port = 0; query->cur_expiry = 0; query->query = NULL; dns->query = query; log_debug(ZONE, "dns resolve for %s@%p started", query->name, query); /* - resolve all SRV records to host/port * - if no results, include domain/5269 * - resolve all host/port combinations * - return result */ _dns_result_srv(NULL, NULL, query); }
10,758
126,469
0
void TabContentsContainerGtk::SetTab(TabContents* tab) { if (tab_ == tab) return; if (tab_) HideTab(tab_); tab_ = tab; if (tab_) { if (tab_ == preview_) preview_ = NULL; else PackTab(tab_); GtkWidget* widget = tab_->web_contents()->GetContentNativeView(); if (widget) { GdkWindow* content_gdk_window = gtk_widget_get_window(widget); if (content_gdk_window) gdk_window_lower(content_gdk_window); } } }
10,759
87,131
0
CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) { if (hooks == NULL) { /* Reset hooks */ global_hooks.allocate = malloc; global_hooks.deallocate = free; global_hooks.reallocate = realloc; return; } global_hooks.allocate = malloc; if (hooks->malloc_fn != NULL) { global_hooks.allocate = hooks->malloc_fn; } global_hooks.deallocate = free; if (hooks->free_fn != NULL) { global_hooks.deallocate = hooks->free_fn; } /* use realloc only if both free and malloc are used */ global_hooks.reallocate = NULL; if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) { global_hooks.reallocate = realloc; } }
10,760
88,163
0
void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, unsigned int oper_speed) { hu->init_speed = init_speed; hu->oper_speed = oper_speed; }
10,761
48,034
0
static int handle_pause(struct kvm_vcpu *vcpu) { if (ple_gap) grow_ple_window(vcpu); kvm_vcpu_on_spin(vcpu); return kvm_skip_emulated_instruction(vcpu); }
10,762
41,601
0
static int irda_shutdown(struct socket *sock, int how) { struct sock *sk = sock->sk; struct irda_sock *self = irda_sk(sk); pr_debug("%s(%p)\n", __func__, self); lock_sock(sk); sk->sk_state = TCP_CLOSE; sk->sk_shutdown |= SEND_SHUTDOWN; sk->sk_state_change(sk); if (self->iriap) { iriap_close(self->iriap); self->iriap = NULL; } if (self->tsap) { irttp_disconnect_request(self->tsap, NULL, P_NORMAL); irttp_close_tsap(self->tsap); self->tsap = NULL; } /* A few cleanup so the socket look as good as new... */ self->rx_flow = self->tx_flow = FLOW_START; /* needed ??? */ self->daddr = DEV_ADDR_ANY; /* Until we get re-connected */ self->saddr = 0x0; /* so IrLMP assign us any link */ release_sock(sk); return 0; }
10,763
162,166
0
void MojoAudioInputIPC::CloseStream() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); delegate_ = nullptr; if (factory_client_binding_.is_bound()) factory_client_binding_.Unbind(); if (stream_client_binding_.is_bound()) stream_client_binding_.Unbind(); stream_.reset(); }
10,764
123,821
0
virtual ~CallbackWrapper() { }
10,765
144,956
0
void RenderWidgetHostViewAura::OnSetNeedsFlushInput() { needs_flush_input_ = true; UpdateNeedsBeginFramesInternal(); }
10,766
115,963
0
unsigned int ewk_frame_text_matches_mark(Evas_Object* ewkFrame, const char* string, Eina_Bool caseSensitive, Eina_Bool highlight, unsigned int limit) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); smartData->frame->editor()->setMarkedTextMatchesAreHighlighted(highlight); return smartData->frame->editor()->countMatchesForText(WTF::String::fromUTF8(string), caseSensitive, limit, true); }
10,767
115,947
0
Eina_Bool ewk_frame_reload_full(Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false); smartData->frame->loader()->reload(true); return true; }
10,768
65,663
0
nfsd_inject_forget_openowners(u64 max) { u64 count = 0; struct nfs4_client *clp; struct nfsd_net *nn = net_generic(current->nsproxy->net_ns, nfsd_net_id); LIST_HEAD(reaplist); if (!nfsd_netns_ready(nn)) return count; spin_lock(&nn->client_lock); list_for_each_entry(clp, &nn->client_lru, cl_lru) { count += nfsd_collect_client_openowners(clp, &reaplist, max - count); if (max != 0 && count >= max) break; } spin_unlock(&nn->client_lock); nfsd_reap_openowners(&reaplist); return count; }
10,769
59,163
0
static bool reg_is_pkt_pointer(const struct bpf_reg_state *reg) { return type_is_pkt_pointer(reg->type); }
10,770
128,132
0
void TrayCast::DestroyDefaultView() { default_ = nullptr; }
10,771
181,824
1
ssh_packet_get_compress_state(struct sshbuf *m, struct ssh *ssh) { struct session_state *state = ssh->state; struct sshbuf *b; int r; if ((b = sshbuf_new()) == NULL) return SSH_ERR_ALLOC_FAIL; if (state->compression_in_started) { if ((r = sshbuf_put_string(b, &state->compression_in_stream, sizeof(state->compression_in_stream))) != 0) goto out; } else if ((r = sshbuf_put_string(b, NULL, 0)) != 0) goto out; if (state->compression_out_started) { if ((r = sshbuf_put_string(b, &state->compression_out_stream, sizeof(state->compression_out_stream))) != 0) goto out; } else if ((r = sshbuf_put_string(b, NULL, 0)) != 0) goto out; r = sshbuf_put_stringb(m, b); out: sshbuf_free(b); return r; }
10,772
41,795
0
static void addrconf_sit_config(struct net_device *dev) { struct inet6_dev *idev; ASSERT_RTNL(); /* * Configure the tunnel with one of our IPv4 * addresses... we should configure all of * our v4 addrs in the tunnel */ idev = ipv6_find_idev(dev); if (idev == NULL) { pr_debug("%s: add_dev failed\n", __func__); return; } if (dev->priv_flags & IFF_ISATAP) { addrconf_addr_gen(idev, false); return; } sit_add_v4_addrs(idev); if (dev->flags&IFF_POINTOPOINT) addrconf_add_mroute(dev); }
10,773
135,045
0
void AppCacheBackendImpl::Initialize(AppCacheServiceImpl* service, AppCacheFrontend* frontend, int process_id) { DCHECK(!service_ && !frontend_ && frontend && service); service_ = service; frontend_ = frontend; process_id_ = process_id; service_->RegisterBackend(this); }
10,774
51,142
0
int audit_alloc(struct task_struct *tsk) { struct audit_context *context; enum audit_state state; char *key = NULL; if (likely(!audit_ever_enabled)) return 0; /* Return if not auditing. */ state = audit_filter_task(tsk, &key); if (state == AUDIT_DISABLED) { clear_tsk_thread_flag(tsk, TIF_SYSCALL_AUDIT); return 0; } if (!(context = audit_alloc_context(state))) { kfree(key); audit_log_lost("out of memory in audit_alloc"); return -ENOMEM; } context->filterkey = key; tsk->audit_context = context; set_tsk_thread_flag(tsk, TIF_SYSCALL_AUDIT); return 0; }
10,775
60,667
0
static int sctp_getsockopt_local_addrs(struct sock *sk, int len, char __user *optval, int __user *optlen) { struct sctp_bind_addr *bp; struct sctp_association *asoc; int cnt = 0; struct sctp_getaddrs getaddrs; struct sctp_sockaddr_entry *addr; void __user *to; union sctp_addr temp; struct sctp_sock *sp = sctp_sk(sk); int addrlen; int err = 0; size_t space_left; int bytes_copied = 0; void *addrs; void *buf; if (len < sizeof(struct sctp_getaddrs)) return -EINVAL; if (copy_from_user(&getaddrs, optval, sizeof(struct sctp_getaddrs))) return -EFAULT; /* * For UDP-style sockets, id specifies the association to query. * If the id field is set to the value '0' then the locally bound * addresses are returned without regard to any particular * association. */ if (0 == getaddrs.assoc_id) { bp = &sctp_sk(sk)->ep->base.bind_addr; } else { asoc = sctp_id2assoc(sk, getaddrs.assoc_id); if (!asoc) return -EINVAL; bp = &asoc->base.bind_addr; } to = optval + offsetof(struct sctp_getaddrs, addrs); space_left = len - offsetof(struct sctp_getaddrs, addrs); addrs = kmalloc(space_left, GFP_USER | __GFP_NOWARN); if (!addrs) return -ENOMEM; /* If the endpoint is bound to 0.0.0.0 or ::0, get the valid * addresses from the global local address list. */ if (sctp_list_single_entry(&bp->address_list)) { addr = list_entry(bp->address_list.next, struct sctp_sockaddr_entry, list); if (sctp_is_any(sk, &addr->a)) { cnt = sctp_copy_laddrs(sk, bp->port, addrs, space_left, &bytes_copied); if (cnt < 0) { err = cnt; goto out; } goto copy_getaddrs; } } buf = addrs; /* Protection on the bound address list is not needed since * in the socket option context we hold a socket lock and * thus the bound address list can't change. */ list_for_each_entry(addr, &bp->address_list, list) { memcpy(&temp, &addr->a, sizeof(temp)); addrlen = sctp_get_pf_specific(sk->sk_family) ->addr_to_user(sp, &temp); if (space_left < addrlen) { err = -ENOMEM; /*fixme: right error?*/ goto out; } memcpy(buf, &temp, addrlen); buf += addrlen; bytes_copied += addrlen; cnt++; space_left -= addrlen; } copy_getaddrs: if (copy_to_user(to, addrs, bytes_copied)) { err = -EFAULT; goto out; } if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) { err = -EFAULT; goto out; } if (put_user(bytes_copied, optlen)) err = -EFAULT; out: kfree(addrs); return err; }
10,776
159,877
0
PrepopulatedPageList TopSitesImpl::GetPrepopulatedPages() { return prepopulated_pages_; }
10,777
106,773
0
void WebView::updateActiveStateSoon() { ::SetTimer(m_window, UpdateActiveStateTimer, 0, 0); }
10,778
149,129
0
static SQLITE_NOINLINE void *createAggContext(sqlite3_context *p, int nByte){ Mem *pMem = p->pMem; assert( (pMem->flags & MEM_Agg)==0 ); if( nByte<=0 ){ sqlite3VdbeMemSetNull(pMem); pMem->z = 0; }else{ sqlite3VdbeMemClearAndResize(pMem, nByte); pMem->flags = MEM_Agg; pMem->u.pDef = p->pFunc; if( pMem->z ){ memset(pMem->z, 0, nByte); } } return (void*)pMem->z; }
10,779
82,276
0
void socket_seq_show(struct seq_file *seq) { seq_printf(seq, "sockets: used %d\n", sock_inuse_get(seq->private)); }
10,780
47,872
0
struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) { struct sock *newsk; bool is_charged = true; newsk = sk_prot_alloc(sk->sk_prot, priority, sk->sk_family); if (newsk != NULL) { struct sk_filter *filter; sock_copy(newsk, sk); /* SANITY */ if (likely(newsk->sk_net_refcnt)) get_net(sock_net(newsk)); sk_node_init(&newsk->sk_node); sock_lock_init(newsk); bh_lock_sock(newsk); newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL; newsk->sk_backlog.len = 0; atomic_set(&newsk->sk_rmem_alloc, 0); /* * sk_wmem_alloc set to one (see sk_free() and sock_wfree()) */ atomic_set(&newsk->sk_wmem_alloc, 1); atomic_set(&newsk->sk_omem_alloc, 0); skb_queue_head_init(&newsk->sk_receive_queue); skb_queue_head_init(&newsk->sk_write_queue); rwlock_init(&newsk->sk_callback_lock); lockdep_set_class_and_name(&newsk->sk_callback_lock, af_callback_keys + newsk->sk_family, af_family_clock_key_strings[newsk->sk_family]); newsk->sk_dst_cache = NULL; newsk->sk_wmem_queued = 0; newsk->sk_forward_alloc = 0; atomic_set(&newsk->sk_drops, 0); newsk->sk_send_head = NULL; newsk->sk_userlocks = sk->sk_userlocks & ~SOCK_BINDPORT_LOCK; sock_reset_flag(newsk, SOCK_DONE); skb_queue_head_init(&newsk->sk_error_queue); filter = rcu_dereference_protected(newsk->sk_filter, 1); if (filter != NULL) /* though it's an empty new sock, the charging may fail * if sysctl_optmem_max was changed between creation of * original socket and cloning */ is_charged = sk_filter_charge(newsk, filter); if (unlikely(!is_charged || xfrm_sk_clone_policy(newsk, sk))) { /* It is still raw copy of parent, so invalidate * destructor and make plain sk_free() */ newsk->sk_destruct = NULL; bh_unlock_sock(newsk); sk_free(newsk); newsk = NULL; goto out; } RCU_INIT_POINTER(newsk->sk_reuseport_cb, NULL); newsk->sk_err = 0; newsk->sk_err_soft = 0; newsk->sk_priority = 0; newsk->sk_incoming_cpu = raw_smp_processor_id(); atomic64_set(&newsk->sk_cookie, 0); mem_cgroup_sk_alloc(newsk); cgroup_sk_alloc(&newsk->sk_cgrp_data); /* * Before updating sk_refcnt, we must commit prior changes to memory * (Documentation/RCU/rculist_nulls.txt for details) */ smp_wmb(); atomic_set(&newsk->sk_refcnt, 2); /* * Increment the counter in the same struct proto as the master * sock (sk_refcnt_debug_inc uses newsk->sk_prot->socks, that * is the same as sk->sk_prot->socks, as this field was copied * with memcpy). * * This _changes_ the previous behaviour, where * tcp_create_openreq_child always was incrementing the * equivalent to tcp_prot->socks (inet_sock_nr), so this have * to be taken into account in all callers. -acme */ sk_refcnt_debug_inc(newsk); sk_set_socket(newsk, NULL); newsk->sk_wq = NULL; if (newsk->sk_prot->sockets_allocated) sk_sockets_allocated_inc(newsk); if (sock_needs_netstamp(sk) && newsk->sk_flags & SK_FLAGS_TIMESTAMP) net_enable_timestamp(); } out: return newsk; }
10,781
38,479
0
static int cma_get_port(struct rdma_id_private *id_priv) { struct idr *ps; int ret; if (cma_family(id_priv) != AF_IB) ps = cma_select_inet_ps(id_priv); else ps = cma_select_ib_ps(id_priv); if (!ps) return -EPROTONOSUPPORT; mutex_lock(&lock); if (cma_any_port(cma_src_addr(id_priv))) ret = cma_alloc_any_port(ps, id_priv); else ret = cma_use_port(ps, id_priv); mutex_unlock(&lock); return ret; }
10,782
22,490
0
static inline int normal_prio(struct task_struct *p) { int prio; if (task_has_rt_policy(p)) prio = MAX_RT_PRIO-1 - p->rt_priority; else prio = __normal_prio(p); return prio; }
10,783
187,051
1
ImageBitmapFactories::ImageBitmapLoader::ImageBitmapLoader( ImageBitmapFactories& factory, base::Optional<IntRect> crop_rect, ScriptState* script_state, const ImageBitmapOptions* options) : loader_( FileReaderLoader::Create(FileReaderLoader::kReadAsArrayBuffer, this)), factory_(&factory), resolver_(ScriptPromiseResolver::Create(script_state)), crop_rect_(crop_rect), options_(options) {}
10,784
92,602
0
static inline void list_del_leaf_cfs_rq(struct cfs_rq *cfs_rq) { }
10,785
128,467
0
RenderLayerScrollableArea::~RenderLayerScrollableArea() { if (inResizeMode() && !box().documentBeingDestroyed()) { if (LocalFrame* frame = box().frame()) frame->eventHandler().resizeScrollableAreaDestroyed(); } if (LocalFrame* frame = box().frame()) { if (FrameView* frameView = frame->view()) { frameView->removeScrollableArea(this); } } if (box().frame() && box().frame()->page()) { if (ScrollingCoordinator* scrollingCoordinator = box().frame()->page()->scrollingCoordinator()) scrollingCoordinator->willDestroyScrollableArea(this); } if (!box().documentBeingDestroyed()) { Node* node = box().node(); if (node && node->isElementNode()) toElement(node)->setSavedLayerScrollOffset(m_scrollOffset); } if (LocalFrame* frame = box().frame()) { if (FrameView* frameView = frame->view()) frameView->removeResizerArea(box()); } destroyScrollbar(HorizontalScrollbar); destroyScrollbar(VerticalScrollbar); if (m_scrollCorner) m_scrollCorner->destroy(); if (m_resizer) m_resizer->destroy(); }
10,786
154,451
0
const gpu::gles2::ContextState* GLES2DecoderPassthroughImpl::GetContextState() { return nullptr; }
10,787
179,912
1
xfs_attr_rmtval_set( struct xfs_da_args *args) { struct xfs_inode *dp = args->dp; struct xfs_mount *mp = dp->i_mount; struct xfs_bmbt_irec map; xfs_dablk_t lblkno; xfs_fileoff_t lfileoff = 0; __uint8_t *src = args->value; int blkcnt; int valuelen; int nmap; int error; int offset = 0; trace_xfs_attr_rmtval_set(args); /* * Find a "hole" in the attribute address space large enough for * us to drop the new attribute's value into. Because CRC enable * attributes have headers, we can't just do a straight byte to FSB * conversion and have to take the header space into account. */ blkcnt = xfs_attr3_rmt_blocks(mp, args->valuelen); error = xfs_bmap_first_unused(args->trans, args->dp, blkcnt, &lfileoff, XFS_ATTR_FORK); if (error) return error; args->rmtblkno = lblkno = (xfs_dablk_t)lfileoff; args->rmtblkcnt = blkcnt; /* * Roll through the "value", allocating blocks on disk as required. */ while (blkcnt > 0) { int committed; /* * Allocate a single extent, up to the size of the value. */ xfs_bmap_init(args->flist, args->firstblock); nmap = 1; error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno, blkcnt, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, args->firstblock, args->total, &map, &nmap, args->flist); if (!error) { error = xfs_bmap_finish(&args->trans, args->flist, &committed); } if (error) { ASSERT(committed); args->trans = NULL; xfs_bmap_cancel(args->flist); return(error); } /* * bmap_finish() may have committed the last trans and started * a new one. We need the inode to be in all transactions. */ if (committed) xfs_trans_ijoin(args->trans, dp, 0); ASSERT(nmap == 1); ASSERT((map.br_startblock != DELAYSTARTBLOCK) && (map.br_startblock != HOLESTARTBLOCK)); lblkno += map.br_blockcount; blkcnt -= map.br_blockcount; /* * Start the next trans in the chain. */ error = xfs_trans_roll(&args->trans, dp); if (error) return (error); } /* * Roll through the "value", copying the attribute value to the * already-allocated blocks. Blocks are written synchronously * so that we can know they are all on disk before we turn off * the INCOMPLETE flag. */ lblkno = args->rmtblkno; blkcnt = args->rmtblkcnt; valuelen = args->valuelen; while (valuelen > 0) { struct xfs_buf *bp; xfs_daddr_t dblkno; int dblkcnt; ASSERT(blkcnt > 0); xfs_bmap_init(args->flist, args->firstblock); nmap = 1; error = xfs_bmapi_read(dp, (xfs_fileoff_t)lblkno, blkcnt, &map, &nmap, XFS_BMAPI_ATTRFORK); if (error) return(error); ASSERT(nmap == 1); ASSERT((map.br_startblock != DELAYSTARTBLOCK) && (map.br_startblock != HOLESTARTBLOCK)); dblkno = XFS_FSB_TO_DADDR(mp, map.br_startblock), dblkcnt = XFS_FSB_TO_BB(mp, map.br_blockcount); bp = xfs_buf_get(mp->m_ddev_targp, dblkno, dblkcnt, 0); if (!bp) return ENOMEM; bp->b_ops = &xfs_attr3_rmt_buf_ops; xfs_attr_rmtval_copyin(mp, bp, args->dp->i_ino, &offset, &valuelen, &src); error = xfs_bwrite(bp); /* GROT: NOTE: synchronous write */ xfs_buf_relse(bp); if (error) return error; /* roll attribute extent map forwards */ lblkno += map.br_blockcount; blkcnt -= map.br_blockcount; } ASSERT(valuelen == 0); return 0; }
10,788
107,213
0
virtual ~TestAutoFillManager() {}
10,789
142,824
0
bool HTMLMediaElement::IsMouseFocusable() const { return !IsFullscreen(); }
10,790
57,540
0
int ext4_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; int error, rc = 0; const unsigned int ia_valid = attr->ia_valid; error = inode_change_ok(inode, attr); if (error) return error; if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { handle_t *handle; /* (user+group)*(old+new) structure, inode write (sb, * inode block, ? - but truncate inode update has it) */ handle = ext4_journal_start(inode, (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)+ EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb))+3); if (IS_ERR(handle)) { error = PTR_ERR(handle); goto err_out; } error = vfs_dq_transfer(inode, attr) ? -EDQUOT : 0; if (error) { ext4_journal_stop(handle); return error; } /* Update corresponding info in inode so that everything is in * one transaction */ if (attr->ia_valid & ATTR_UID) inode->i_uid = attr->ia_uid; if (attr->ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; error = ext4_mark_inode_dirty(handle, inode); ext4_journal_stop(handle); } if (attr->ia_valid & ATTR_SIZE) { if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); if (attr->ia_size > sbi->s_bitmap_maxbytes) { error = -EFBIG; goto err_out; } } } if (S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE && (attr->ia_size < inode->i_size || (EXT4_I(inode)->i_flags & EXT4_EOFBLOCKS_FL))) { handle_t *handle; handle = ext4_journal_start(inode, 3); if (IS_ERR(handle)) { error = PTR_ERR(handle); goto err_out; } error = ext4_orphan_add(handle, inode); EXT4_I(inode)->i_disksize = attr->ia_size; rc = ext4_mark_inode_dirty(handle, inode); if (!error) error = rc; ext4_journal_stop(handle); if (ext4_should_order_data(inode)) { error = ext4_begin_ordered_truncate(inode, attr->ia_size); if (error) { /* Do as much error cleanup as possible */ handle = ext4_journal_start(inode, 3); if (IS_ERR(handle)) { ext4_orphan_del(NULL, inode); goto err_out; } ext4_orphan_del(handle, inode); ext4_journal_stop(handle); goto err_out; } } /* ext4_truncate will clear the flag */ if ((EXT4_I(inode)->i_flags & EXT4_EOFBLOCKS_FL)) ext4_truncate(inode); } rc = inode_setattr(inode, attr); /* If inode_setattr's call to ext4_truncate failed to get a * transaction handle at all, we need to clean up the in-core * orphan list manually. */ if (inode->i_nlink) ext4_orphan_del(NULL, inode); if (!rc && (ia_valid & ATTR_MODE)) rc = ext4_acl_chmod(inode); err_out: ext4_std_error(inode->i_sb, error); if (!error) error = rc; return error; }
10,791
167,712
0
void WebRuntimeFeatures::EnableInputMultipleFieldsUI(bool enable) { RuntimeEnabledFeatures::SetInputMultipleFieldsUIEnabled(enable); }
10,792
102,585
0
void EnterpriseEnrollmentScreen::HandleAuthError( const GoogleServiceAuthError& error) { scoped_ptr<GaiaAuthFetcher> scoped_killer(auth_fetcher_.release()); if (!is_showing_) return; switch (error.state()) { case GoogleServiceAuthError::CONNECTION_FAILED: UMA_HISTOGRAM_ENUMERATION(policy::kMetricEnrollment, policy::kMetricEnrollmentNetworkFailed, policy::kMetricEnrollmentSize); actor_->ShowNetworkEnrollmentError(); return; case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: case GoogleServiceAuthError::CAPTCHA_REQUIRED: case GoogleServiceAuthError::TWO_FACTOR: case GoogleServiceAuthError::SERVICE_UNAVAILABLE: UMA_HISTOGRAM_ENUMERATION(policy::kMetricEnrollment, policy::kMetricEnrollmentLoginFailed, policy::kMetricEnrollmentSize); actor_->ShowAuthError(error); return; case GoogleServiceAuthError::USER_NOT_SIGNED_UP: case GoogleServiceAuthError::ACCOUNT_DELETED: case GoogleServiceAuthError::ACCOUNT_DISABLED: UMA_HISTOGRAM_ENUMERATION(policy::kMetricEnrollment, policy::kMetricEnrollmentNotSupported, policy::kMetricEnrollmentSize); actor_->ShowAccountError(); return; case GoogleServiceAuthError::NONE: case GoogleServiceAuthError::HOSTED_NOT_ALLOWED: NOTREACHED() << error.state(); case GoogleServiceAuthError::REQUEST_CANCELED: LOG(ERROR) << "Unexpected GAIA auth error: " << error.state(); UMA_HISTOGRAM_ENUMERATION(policy::kMetricEnrollment, policy::kMetricEnrollmentNetworkFailed, policy::kMetricEnrollmentSize); actor_->ShowFatalAuthError(); return; } NOTREACHED() << error.state(); UMA_HISTOGRAM_ENUMERATION(policy::kMetricEnrollment, policy::kMetricEnrollmentOtherFailed, policy::kMetricEnrollmentSize); }
10,793
122,009
0
InstallationState GetAppLauncherInstallationState() { if (IsAppLauncherEnabledAtLevel(SYSTEM_LEVEL_INSTALLATION)) return INSTALLED_AT_SYSTEM_LEVEL; if (IsAppLauncherEnabledAtLevel(USER_LEVEL_INSTALLATION)) return INSTALLED_AT_USER_LEVEL; return NOT_INSTALLED; }
10,794
174,050
0
void H264SwDecFree(void *ptr) { free(ptr); }
10,795
141,676
0
void V8Console::groupEndCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { ConsoleHelper(info).reportCallWithDefaultArgument(ConsoleAPIType::kEndGroup, String16("console.groupEnd")); }
10,796
102,016
0
void createPixmap(uint32_t winId) { XWindowAttributes attr; XGetWindowAttributes(m_display, winId, &attr); XRenderPictFormat* format = XRenderFindVisualFormat(m_display, attr.visual); m_hasAlpha = (format->type == PictTypeDirect && format->direct.alphaMask); m_size = IntSize(attr.width, attr.height); int numberOfConfigs; GLXFBConfig* configs = glXChooseFBConfig(m_display, XDefaultScreen(m_display), glxSpec, &numberOfConfigs); m_xPixmap = XCompositeNameWindowPixmap(m_display, winId); m_glxPixmap = glXCreatePixmap(m_display, *configs, m_xPixmap, glxAttributes); uint inverted = 0; glXQueryDrawable(m_display, m_glxPixmap, GLX_Y_INVERTED_EXT, &inverted); m_textureIsYInverted = !!inverted; XFree(configs); }
10,797
35,485
0
ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; u16 *seq; u8 *qc; int tid; /* * Packet injection may want to control the sequence * number, if we have no matching interface then we * neither assign one ourselves nor ask the driver to. */ if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR)) return TX_CONTINUE; if (unlikely(ieee80211_is_ctl(hdr->frame_control))) return TX_CONTINUE; if (ieee80211_hdrlen(hdr->frame_control) < 24) return TX_CONTINUE; if (ieee80211_is_qos_nullfunc(hdr->frame_control)) return TX_CONTINUE; /* * Anything but QoS data that has a sequence number field * (is long enough) gets a sequence number from the global * counter. QoS data frames with a multicast destination * also use the global counter (802.11-2012 9.3.2.10). */ if (!ieee80211_is_data_qos(hdr->frame_control) || is_multicast_ether_addr(hdr->addr1)) { /* driver should assign sequence number */ info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; /* for pure STA mode without beacons, we can do it */ hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number); tx->sdata->sequence_number += 0x10; return TX_CONTINUE; } /* * This should be true for injected/management frames only, for * management frames we have set the IEEE80211_TX_CTL_ASSIGN_SEQ * above since they are not QoS-data frames. */ if (!tx->sta) return TX_CONTINUE; /* include per-STA, per-TID sequence counter */ qc = ieee80211_get_qos_ctl(hdr); tid = *qc & IEEE80211_QOS_CTL_TID_MASK; seq = &tx->sta->tid_seq[tid]; hdr->seq_ctrl = cpu_to_le16(*seq); /* Increase the sequence number. */ *seq = (*seq + 0x10) & IEEE80211_SCTL_SEQ; return TX_CONTINUE; }
10,798
69,448
0
void nfs_fattr_map_and_free_names(struct nfs_server *server, struct nfs_fattr *fattr) { if (nfs_fattr_map_owner_name(server, fattr)) nfs_fattr_free_owner_name(fattr); if (nfs_fattr_map_group_name(server, fattr)) nfs_fattr_free_group_name(fattr); }
10,799