type
stringclasses
5 values
content
stringlengths
9
163k
functions
int snd_hda_input_mux_info(const struct hda_input_mux *imux, struct snd_ctl_elem_info *uinfo) { unsigned int index; uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count = 1; uinfo->value.enumerated.items = imux->num_items; if (!imux->num_items) return 0; index = uinfo->value.enumerated.item; if (i...
functions
int snd_hda_input_mux_put(struct hda_codec *codec, const struct hda_input_mux *imux, struct snd_ctl_elem_value *ucontrol, hda_nid_t nid, unsigned int *cur_val) { unsigned int idx; if (!imux->num_items) return 0; idx = ucontrol->value.enumerated.item[0]; if (idx >= imux->num_items) idx = imu...
functions
void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid, unsigned int stream_tag, unsigned int format) { /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) set_dig_out_convert(codec, nid, codec->spdif_ctl...
functions
void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid) { snd_hda_codec_cleanup_stream(codec, nid); if (codec->slave_dig_outs) { hda_nid_t *d; for (d = codec->slave_dig_outs; *d; d++) snd_hda_codec_cleanup_stream(codec, *d); }
functions
void snd_hda_bus_reboot_notify(struct hda_bus *bus) { struct hda_codec *codec; if (!bus) return; list_for_each_entry(codec, &bus->codec_list, list) { #ifdef CONFIG_SND_HDA_POWER_SAVE if (!codec->power_on) continue; #endif if (codec->patch_ops.reboot_notify) codec->patch_ops.reboot_notify(codec); }
functions
int snd_hda_multi_out_dig_open(struct hda_codec *codec, struct hda_multi_out *mout) { mutex_lock(&codec->spdif_mutex); if (mout->dig_out_used == HDA_DIG_ANALOG_DUP) /* already opened as analog dup; reset it once */ cleanup_dig_out_stream(codec, mout->dig_out_nid); mout->dig_out_used = HDA_DIG_EXCLUSIVE...
functions
int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, struct hda_multi_out *mout, unsigned int stream_tag, unsigned int format, struct snd_pcm_substream *substream) { mutex_lock(&codec->spdif_mutex); setup_dig_out_stream(codec, mout->dig_out_nid, stream_tag, format); mutex_unlock(&codec-...
functions
int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec, struct hda_multi_out *mout) { mutex_lock(&codec->spdif_mutex); cleanup_dig_out_stream(codec, mout->dig_out_nid); mutex_unlock(&codec->spdif_mutex); return 0; }
functions
int snd_hda_multi_out_dig_close(struct hda_codec *codec, struct hda_multi_out *mout) { mutex_lock(&codec->spdif_mutex); mout->dig_out_used = 0; mutex_unlock(&codec->spdif_mutex); return 0; }
functions
int snd_hda_multi_out_analog_open(struct hda_codec *codec, struct hda_multi_out *mout, struct snd_pcm_substream *substream, struct hda_pcm_stream *hinfo) { struct snd_pcm_runtime *runtime = substream->runtime; runtime->hw.channels_max = mout->max_channels; if (mout->dig_out_nid) { if (!mout->anal...
functions
int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, struct hda_multi_out *mout, unsigned int stream_tag, unsigned int format, struct snd_pcm_substream *substream) { hda_nid_t *nids = mout->dac_nids; int chs = substream->runtime->channels; int i; mutex_lock(&codec->spdi...
functions
int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_out *mout) { hda_nid_t *nids = mout->dac_nids; int i; for (i = 0; i < mout->num_dacs; i++) snd_hda_codec_cleanup_stream(codec, nids[i]); if (mout->hp_nid) snd_hda_codec_cleanup_stream(codec, mout->hp_nid); for (i = 0; i < ...
functions
int is_in_nid_list(hda_nid_t nid, hda_nid_t *list) { for (; *list; list++) if (*list == nid) return 1; return 0; }
functions
void sort_pins_by_sequence(hda_nid_t *pins, short *sequences, int num_pins) { int i, j; short seq; hda_nid_t nid; for (i = 0; i < num_pins; i++) { for (j = i + 1; j < num_pins; j++) { if (sequences[i] > sequences[j]) { seq = sequences[i]; sequences[i] = sequences[j]; sequences[j] = seq; ...
functions
void add_auto_cfg_input_pin(struct auto_pin_cfg *cfg, hda_nid_t nid, int type) { if (cfg->num_inputs < AUTO_CFG_MAX_INS) { cfg->inputs[cfg->num_inputs].pin = nid; cfg->inputs[cfg->num_inputs].type = type; cfg->num_inputs++; }
functions
void sort_autocfg_input_pins(struct auto_pin_cfg *cfg) { int i, j; for (i = 0; i < cfg->num_inputs; i++) { for (j = i + 1; j < cfg->num_inputs; j++) { if (cfg->inputs[i].type > cfg->inputs[j].type) { struct auto_pin_cfg_item tmp; tmp = cfg->inputs[i]; cfg->inputs[i] = cfg->inputs[j]; cfg->inputs...
functions
int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *cfg, hda_nid_t *ignore_nids) { hda_nid_t nid, end_nid; short seq, assoc_line_out, assoc_speaker; short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)]; short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)]; short sequences...
functions
else if (cfg->hp_outs) { cfg->line_outs = cfg->hp_outs; memcpy(cfg->line_out_pins, cfg->hp_pins, sizeof(cfg->hp_pins)); cfg->hp_outs = 0; memset(cfg->hp_pins, 0, sizeof(cfg->hp_pins)); cfg->line_out_type = AUTO_PIN_HP_OUT; }
functions
int snd_hda_get_input_pin_attr(unsigned int def_conf) { unsigned int loc = get_defcfg_location(def_conf); unsigned int conn = get_defcfg_connect(def_conf); if (conn == AC_JACK_PORT_NONE) return INPUT_PIN_ATTR_UNUSED; /* Windows may claim the internal mic to be BOTH, too */ if (conn == AC_JACK_PORT_FIXED || conn ...
functions
int check_mic_location_need(struct hda_codec *codec, const struct auto_pin_cfg *cfg, int input) { unsigned int defc; int i, attr, attr2; defc = snd_hda_codec_get_pincfg(codec, cfg->inputs[input].pin); attr = snd_hda_get_input_pin_attr(defc); /* for internal or docking mics, we need locations */ if ...
functions
int snd_hda_add_imux_item(struct hda_input_mux *imux, const char *label, int index, int *type_idx) { int i, label_idx = 0; if (imux->num_items >= HDA_MAX_NUM_INPUTS) { snd_printd(KERN_ERR "hda_codec: Too many imux items!\n"); return -EINVAL; }
functions
int snd_hda_suspend(struct hda_bus *bus) { struct hda_codec *codec; list_for_each_entry(codec, &bus->codec_list, list) { #ifdef CONFIG_SND_HDA_POWER_SAVE if (!codec->power_on) continue; #endif hda_call_codec_suspend(codec); }
functions
int snd_hda_resume(struct hda_bus *bus) { struct hda_codec *codec; list_for_each_entry(codec, &bus->codec_list, list) { if (snd_hda_codec_needs_resume(codec)) hda_call_codec_resume(codec); }
functions
void snd_array_free(struct snd_array *array) { kfree(array->list); array->used = 0; array->alloced = 0; array->list = NULL; }
functions
void snd_print_pcm_rates(int pcm, char *buf, int buflen) { static unsigned int rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 384000 }
functions
void snd_print_pcm_bits(int pcm, char *buf, int buflen) { static unsigned int bits[] = { 8, 16, 20, 24, 32 }
includes
#include <linux/module.h>
includes
#include <linux/mm.h>
includes
#include <asm/blackfin.h>
includes
#include <asm/cacheflush.h>
includes
#include <asm/cplb.h>
includes
#include <asm/cplbinit.h>
includes
#include <asm/mmu_context.h>
defines
#define MGR_ATTR __attribute__((l1_text))
defines
#define MGR_ATTR
functions
int faulting_cplb_index(int status) { int signbits = __builtin_bfin_norm_fr1x32(status & 0xFFFF); return 30 - signbits; }
functions
int write_permitted(int status, unsigned long data) { if (status & FAULT_USERSUPV) return !!(data & CPLB_SUPV_WR); else return !!(data & CPLB_USER_WR); }
functions
int evict_one_icplb(unsigned int cpu) { int i; for (i = first_switched_icplb; i < MAX_CPLBS; i++) if ((icplb_tbl[cpu][i].data & CPLB_VALID) == 0) return i; i = first_switched_icplb + icplb_rr_index[cpu]; if (i >= MAX_CPLBS) { i -= MAX_CPLBS - first_switched_icplb; icplb_rr_index[cpu] -= MAX_CPLBS - first_s...
functions
int evict_one_dcplb(unsigned int cpu) { int i; for (i = first_switched_dcplb; i < MAX_CPLBS; i++) if ((dcplb_tbl[cpu][i].data & CPLB_VALID) == 0) return i; i = first_switched_dcplb + dcplb_rr_index[cpu]; if (i >= MAX_CPLBS) { i -= MAX_CPLBS - first_switched_dcplb; dcplb_rr_index[cpu] -= MAX_CPLBS - first_s...
functions
int dcplb_miss(unsigned int cpu) { unsigned long addr = bfin_read_DCPLB_FAULT_ADDR(); int status = bfin_read_DCPLB_STATUS(); unsigned long *mask; int idx; unsigned long d_data; nr_dcplb_miss[cpu]++; d_data = CPLB_SUPV_WR | CPLB_VALID | CPLB_DIRTY | PAGE_SIZE_4KB; #ifdef CONFIG_BFIN_EXTMEM_DCACHEABLE if (bfin_...
functions
endif if (L2_LENGTH && addr >= L2_START && addr < L2_START + L2_LENGTH) { addr = L2_START; d_data = L2_DMEMORY; }
functions
else if (addr >= physical_mem_end) { if (addr >= ASYNC_BANK0_BASE && addr < ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE) { #if defined(CONFIG_ROMFS_ON_MTD) && defined(CONFIG_MTD_ROM) mask = current_rwx_mask[cpu]; if (mask) { int page = (addr - (ASYNC_BANK0_BASE - _ramend)) >> PAGE_SHIFT; int idx = page >> 5; ...
functions
else if (addr >= _ramend) { d_data |= CPLB_USER_RD | CPLB_USER_WR; if (reserved_mem_dcache_on) d_data |= CPLB_L1_CHBL; }
functions
int icplb_miss(unsigned int cpu) { unsigned long addr = bfin_read_ICPLB_FAULT_ADDR(); int status = bfin_read_ICPLB_STATUS(); int idx; unsigned long i_data; nr_icplb_miss[cpu]++; if (addr >= _ramend - DMA_UNCACHED_REGION && addr < _ramend) return CPLB_PROT_VIOL; if (status & FAULT_USERSUPV) nr_icplb_supv...
functions
endif if (L2_LENGTH && addr >= L2_START && addr < L2_START + L2_LENGTH) { addr = L2_START; i_data = L2_IMEMORY; }
functions
else if (addr >= physical_mem_end) { if (addr >= ASYNC_BANK0_BASE && addr < ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE) { if (!(status & FAULT_USERSUPV)) { unsigned long *mask = current_rwx_mask[cpu]; if (mask) { int page = (addr - (ASYNC_BANK0_BASE - _ramend)) >> PAGE_SHIFT; int idx = page >> 5; ...
functions
else if (addr >= _ramend) { i_data |= CPLB_USER_RD; if (reserved_mem_icache_on) i_data |= CPLB_L1_CHBL; }
functions
int dcplb_protection_fault(unsigned int cpu) { int status = bfin_read_DCPLB_STATUS(); nr_dcplb_prot[cpu]++; if (status & FAULT_RW) { int idx = faulting_cplb_index(status); unsigned long data = dcplb_tbl[cpu][idx].data; if (!(data & CPLB_WT) && !(data & CPLB_DIRTY) && write_permitted(status, data)) { ...
functions
int cplb_hdr(int seqstat, struct pt_regs *regs) { int cause = seqstat & 0x3f; unsigned int cpu = raw_smp_processor_id(); switch (cause) { case 0x23: return dcplb_protection_fault(cpu); case 0x2C: return icplb_miss(cpu); case 0x26: return dcplb_miss(cpu); default: return 1; }
functions
void flush_switched_cplbs(unsigned int cpu) { int i; unsigned long flags; nr_cplb_flush[cpu]++; flags = hard_local_irq_save(); _disable_icplb(); for (i = first_switched_icplb; i < MAX_CPLBS; i++) { icplb_tbl[cpu][i].data = 0; bfin_write32(ICPLB_DATA0 + i * 4, 0); }
functions
void set_mask_dcplbs(unsigned long *masks, unsigned int cpu) { int i; unsigned long addr = (unsigned long)masks; unsigned long d_data; unsigned long flags; if (!masks) { current_rwx_mask[cpu] = masks; return; }
main
int main (void) { int v1 = get_version_1 (); int v2 = get_version_2 (); if (v1 != 104) return 1; /* The value returned by get_version_2 depends on the target. On GNU/Linux, for instance, it should return 104. But on x86-windows, for instance, it will return 203. */ if (v2 != 104 && v2 != 203...
defines
#define XFS_ABSDIFF(a,b) (((a) <= (b)) ? ((b) - (a)) : ((a) - (b)))
defines
#define XFSA_FIXUP_BNO_OK 1
defines
#define XFSA_FIXUP_CNT_OK 2
functions
int xfs_alloc_lookup_eq( struct xfs_btree_cur *cur, xfs_agblock_t bno, xfs_extlen_t len, int *stat) { cur->bc_rec.a.ar_startblock = bno; cur->bc_rec.a.ar_blockcount = len; return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); }
functions
int xfs_alloc_lookup_ge( struct xfs_btree_cur *cur, xfs_agblock_t bno, xfs_extlen_t len, int *stat) { cur->bc_rec.a.ar_startblock = bno; cur->bc_rec.a.ar_blockcount = len; return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); }
functions
int xfs_alloc_lookup_le( struct xfs_btree_cur *cur, xfs_agblock_t bno, xfs_extlen_t len, int *stat) { cur->bc_rec.a.ar_startblock = bno; cur->bc_rec.a.ar_blockcount = len; return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); }
functions
int xfs_alloc_update( struct xfs_btree_cur *cur, xfs_agblock_t bno, xfs_extlen_t len) { union xfs_btree_rec rec; rec.alloc.ar_startblock = cpu_to_be32(bno); rec.alloc.ar_blockcount = cpu_to_be32(len); return xfs_btree_update(cur, &rec); }
functions
int xfs_alloc_get_rec( struct xfs_btree_cur *cur, xfs_agblock_t *bno, xfs_extlen_t *len, int *stat) { union xfs_btree_rec *rec; int error; error = xfs_btree_get_rec(cur, &rec, stat); if (!error && *stat == 1) { *bno = be32_to_cpu(rec->alloc.ar_startblock); *len = be32_to_cpu(rec->alloc.ar_bl...
functions
void xfs_alloc_compute_aligned( xfs_alloc_arg_t *args, xfs_agblock_t foundbno, xfs_extlen_t foundlen, xfs_agblock_t *resbno, xfs_extlen_t *reslen) { xfs_agblock_t bno; xfs_extlen_t len; xfs_alloc_busy_trim(args, foundbno, foundlen, &bno, &len); if (args->alignment > 1 && len >= args->minlen) { xfs_...
functions
xfs_extlen_t xfs_alloc_compute_diff( xfs_agblock_t wantbno, xfs_extlen_t wantlen, xfs_extlen_t alignment, xfs_agblock_t freebno, xfs_extlen_t freelen, xfs_agblock_t *newbnop) { xfs_agblock_t freeend; xfs_agblock_t newbno1; xfs_agblock_t newbno2; xfs_extlen_t newlen1=0; xfs_extlen_t newlen2=0; ...
functions
else if (freeend >= wantend && alignment > 1) { newbno1 = roundup(wantbno, alignment); newbno2 = newbno1 - alignment; if (newbno1 >= freeend) newbno1 = NULLAGBLOCK; else newlen1 = XFS_EXTLEN_MIN(wantlen, freeend - newbno1); if (newbno2 < freebno) newbno2 = NULLAGBLOCK; else newlen2 = XFS_EXTLEN_...
functions
else if (freeend >= wantend) { newbno1 = wantbno; }
functions
else if (alignment > 1) { newbno1 = roundup(freeend - wantlen, alignment); if (newbno1 > freeend - wantlen && newbno1 - alignment >= freebno) newbno1 -= alignment; else if (newbno1 >= freeend) newbno1 = NULLAGBLOCK; }
functions
void xfs_alloc_fix_len( xfs_alloc_arg_t *args) { xfs_extlen_t k; xfs_extlen_t rlen; ASSERT(args->mod < args->prod); rlen = args->len; ASSERT(rlen >= args->minlen); ASSERT(rlen <= args->maxlen); if (args->prod <= 1 || rlen < args->mod || rlen == args->maxlen || (args->mod == 0 && rlen < args->prod)) re...
functions
int xfs_alloc_fix_minleft( xfs_alloc_arg_t *args) { xfs_agf_t *agf; int diff; if (args->minleft == 0) return 1; agf = XFS_BUF_TO_AGF(args->agbp); diff = be32_to_cpu(agf->agf_freeblks) - args->len - args->minleft; if (diff >= 0) return 1; args->len += diff; if (args->len >= args->minlen) retur...
functions
int xfs_alloc_fixup_trees( xfs_btree_cur_t *cnt_cur, xfs_btree_cur_t *bno_cur, xfs_agblock_t fbno, xfs_extlen_t flen, xfs_agblock_t rbno, xfs_extlen_t rlen, int flags) { int error; int i; xfs_agblock_t nfbno1; xfs_agblock_t nfbno2; xfs_extlen_t nflen1=0; xfs_extlen_t nflen2=0; ...
functions
DEBUG if (bno_cur->bc_nlevels == 1 && cnt_cur->bc_nlevels == 1) { struct xfs_btree_block *bnoblock; struct xfs_btree_block *cntblock; bnoblock = XFS_BUF_TO_BLOCK(bno_cur->bc_bufs[0]); cntblock = XFS_BUF_TO_BLOCK(cnt_cur->bc_bufs[0]); XFS_WANT_CORRUPTED_RETURN( bnoblock->bb_numrecs == cntblock->bb_numrec...
functions
else if (rbno == fbno) { nfbno1 = rbno + rlen; nflen1 = flen - rlen; nfbno2 = NULLAGBLOCK; }
functions
else if (rbno + rlen == fbno + flen) { nfbno1 = fbno; nflen1 = flen - rlen; nfbno2 = NULLAGBLOCK; }
functions
int xfs_alloc_read_agfl( xfs_mount_t *mp, xfs_trans_t *tp, xfs_agnumber_t agno, xfs_buf_t **bpp) { xfs_buf_t *bp; int error; ASSERT(agno != NULLAGNUMBER); error = xfs_trans_read_buf( mp, tp, mp->m_ddev_targp, XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR(mp)), XFS_FSS_TO_BB(mp, 1), 0, &bp); if...
functions
int xfs_alloc_update_counters( struct xfs_trans *tp, struct xfs_perag *pag, struct xfs_buf *agbp, long len) { struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); pag->pagf_freeblks += len; be32_add_cpu(&agf->agf_freeblks, len); xfs_trans_agblocks_delta(tp, len); if (unlikely(be32_to_cpu(agf->agf_freeblks) > ...
functions
int xfs_alloc_ag_vextent( xfs_alloc_arg_t *args) { int error=0; ASSERT(args->minlen > 0); ASSERT(args->maxlen > 0); ASSERT(args->minlen <= args->maxlen); ASSERT(args->mod < args->prod); ASSERT(args->alignment > 0); args->wasfromfl = 0; switch (args->type) { case XFS_ALLOCTYPE_THIS_AG: error = xfs_allo...
functions
int xfs_alloc_ag_vextent_exact( xfs_alloc_arg_t *args) { xfs_btree_cur_t *bno_cur; xfs_btree_cur_t *cnt_cur; int error; xfs_agblock_t fbno; xfs_extlen_t flen; xfs_agblock_t tbno; xfs_extlen_t tlen; xfs_agblock_t tend; int i; ASSERT(args->alignment == 1); bno_cur = xfs_allocbt_init_cursor(args-...
functions
int xfs_alloc_find_best_extent( struct xfs_alloc_arg *args, struct xfs_btree_cur **gcur, struct xfs_btree_cur **scur, xfs_agblock_t gdiff, xfs_agblock_t *sbno, xfs_extlen_t *slen, xfs_agblock_t *sbnoa, xfs_extlen_t *slena, int dir) { xfs_agblock_t new; xfs_agblock_t sdiff; int error; in...
functions
int xfs_alloc_ag_vextent_near( xfs_alloc_arg_t *args) { xfs_btree_cur_t *bno_cur_gt; xfs_btree_cur_t *bno_cur_lt; xfs_btree_cur_t *cnt_cur; xfs_agblock_t gtbno; xfs_agblock_t gtbnoa; xfs_extlen_t gtdiff; xfs_extlen_t gtlen; xfs_extlen_t gtlena; xfs_agblock_t gtnew; int error; int i;...
functions
endif if (ltlen || args->alignment > 1) { cnt_cur->bc_ptrs[0] = 1; do { if ((error = xfs_alloc_get_rec(cnt_cur, &ltbno, &ltlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if (ltlen >= args->minlen) break; if ((error = xfs_btree_increment(cnt_cur, 0, &i))) go...
functions
int xfs_alloc_ag_vextent_size( xfs_alloc_arg_t *args) { xfs_btree_cur_t *bno_cur; xfs_btree_cur_t *cnt_cur; int error; xfs_agblock_t fbno; xfs_extlen_t flen; int i; xfs_agblock_t rbno; xfs_extlen_t rlen; int forced = 0; restart: cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, ar...
functions
int xfs_alloc_ag_vextent_small( xfs_alloc_arg_t *args, xfs_btree_cur_t *ccur, xfs_agblock_t *fbnop, xfs_extlen_t *flenp, int *stat) { int error; xfs_agblock_t fbno; xfs_extlen_t flen; int i; if ((error = xfs_btree_decrement(ccur, 0, &i))) goto error0; if (i) { if ((error = xfs_alloc_get_rec(c...
functions
int xfs_free_ag_extent( xfs_trans_t *tp, xfs_buf_t *agbp, xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, int isfl) { xfs_btree_cur_t *bno_cur; xfs_btree_cur_t *cnt_cur; int error; xfs_agblock_t gtbno; xfs_extlen_t gtlen; int haveleft; int haveright; int i; xfs_agblock...
functions
else if (haveleft) { if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if ((error = xfs_btree_decrement(bno_cur, 0, &i))) goto error0; ...
functions
else if (haveright) { if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); nbno = bno; nlen = len + gtlen; if ((error = xfs_alloc_update(b...
functions
void xfs_alloc_compute_maxlevels( xfs_mount_t *mp) { int level; uint maxblocks; uint maxleafents; int minleafrecs; int minnoderecs; maxleafents = (mp->m_sb.sb_agblocks + 1) / 2; minleafrecs = mp->m_alloc_mnr[0]; minnoderecs = mp->m_alloc_mnr[1]; maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs...
functions
xfs_extlen_t xfs_alloc_longest_free_extent( struct xfs_mount *mp, struct xfs_perag *pag) { xfs_extlen_t need, delta = 0; need = XFS_MIN_FREELIST_PAG(pag, mp); if (need > pag->pagf_flcount) delta = need - pag->pagf_flcount; if (pag->pagf_longest > delta) return pag->pagf_longest - delta; return pag->pagf_f...
functions
int xfs_alloc_fix_freelist( xfs_alloc_arg_t *args, int flags) { xfs_buf_t *agbp; xfs_agf_t *agf; xfs_buf_t *agflbp; xfs_agblock_t bno; xfs_extlen_t delta; int error; xfs_extlen_t longest; xfs_mount_t *mp; xfs_extlen_t need; xfs_perag_t *pag; xfs_alloc_arg_t targs; xfs_trans_t *tp; mp = ...
functions
int xfs_alloc_get_freelist( xfs_trans_t *tp, xfs_buf_t *agbp, xfs_agblock_t *bnop, int btreeblk) { xfs_agf_t *agf; xfs_agfl_t *agfl; xfs_buf_t *agflbp; xfs_agblock_t bno; int error; int logflags; xfs_mount_t *mp; xfs_perag_t *pag; agf = XFS_BUF_TO_AGF(agbp); if (!agf->agf_flcount) { *bn...
functions
void xfs_alloc_log_agf( xfs_trans_t *tp, xfs_buf_t *bp, int fields) { int first; int last; static const short offsets[] = { offsetof(xfs_agf_t, agf_magicnum), offsetof(xfs_agf_t, agf_versionnum), offsetof(xfs_agf_t, agf_seqno), offsetof(xfs_agf_t, agf_length), offsetof(xfs_agf_t, agf_roots[0]), ...
functions
int xfs_alloc_pagf_init( xfs_mount_t *mp, xfs_trans_t *tp, xfs_agnumber_t agno, int flags) { xfs_buf_t *bp; int error; if ((error = xfs_alloc_read_agf(mp, tp, agno, flags, &bp))) return error; if (bp) xfs_trans_brelse(tp, bp); return 0; }
functions
int xfs_alloc_put_freelist( xfs_trans_t *tp, xfs_buf_t *agbp, xfs_buf_t *agflbp, xfs_agblock_t bno, int btreeblk) { xfs_agf_t *agf; xfs_agfl_t *agfl; __be32 *blockp; int error; int logflags; xfs_mount_t *mp; xfs_perag_t *pag; agf = XFS_BUF_TO_AGF(agbp); mp = tp->t_mountp; i...
functions
int xfs_read_agf( struct xfs_mount *mp, struct xfs_trans *tp, xfs_agnumber_t agno, int flags, struct xfs_buf **bpp) { struct xfs_agf *agf; int agf_ok; int error; ASSERT(agno != NULLAGNUMBER); error = xfs_trans_read_buf( mp, tp, mp->m_ddev_targp, XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(...
functions
int xfs_alloc_read_agf( struct xfs_mount *mp, struct xfs_trans *tp, xfs_agnumber_t agno, int flags, struct xfs_buf **bpp) { struct xfs_agf *agf; struct xfs_perag *pag; int error; ASSERT(agno != NULLAGNUMBER); error = xfs_read_agf(mp, tp, agno, (flags & XFS_ALLOC_FLAG_TRYLOCK) ? XBF_T...
functions
int __xfs_alloc_vextent( xfs_alloc_arg_t *args) { xfs_agblock_t agsize; int error; int flags; xfs_extlen_t minleft; xfs_mount_t *mp; xfs_agnumber_t sagno; xfs_alloctype_t type; int bump_rotor = 0; int no_min = 0; xfs_agnumber_t rotorstep = xfs_rotorstep; mp = args->mp; type = args->otype = ...
functions
else if (type == XFS_ALLOCTYPE_FIRST_AG) { args->agno = XFS_FSB_TO_AGNO(mp, args->fsbno); args->type = XFS_ALLOCTYPE_THIS_AG; sagno = 0; flags = 0; }
functions
void xfs_alloc_vextent_worker( struct work_struct *work) { struct xfs_alloc_arg *args = container_of(work, struct xfs_alloc_arg, work); unsigned long pflags; current_set_flags_nested(&pflags, PF_FSTRANS); args->result = __xfs_alloc_vextent(args); complete(args->done); current_restore_flags_nested(&pf...
functions
int xfs_alloc_vextent( xfs_alloc_arg_t *args) { DECLARE_COMPLETION_ONSTACK(done); args->done = &done; INIT_WORK(&args->work, xfs_alloc_vextent_worker); queue_work(xfs_alloc_wq, &args->work); wait_for_completion(&done); return args->result; }
functions
int xfs_free_extent( xfs_trans_t *tp, xfs_fsblock_t bno, xfs_extlen_t len) { xfs_alloc_arg_t args; int error; ASSERT(len != 0); memset(&args, 0, sizeof(xfs_alloc_arg_t)); args.tp = tp; args.mp = tp->t_mountp; args.agno = XFS_FSB_TO_AGNO(args.mp, bno); if (args.agno >= args.mp->m_sb.sb_agcount) re...
functions
void xfs_alloc_busy_insert( struct xfs_trans *tp, xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, unsigned int flags) { struct xfs_busy_extent *new; struct xfs_busy_extent *busyp; struct xfs_perag *pag; struct rb_node **rbp; struct rb_node *parent = NULL; new = kmem_zalloc(sizeof(struct xfs_...
functions
else if (new->bno > busyp->bno) { rbp = &(*rbp)->rb_right; ASSERT(bno >= busyp->bno + busyp->length); }
functions
int xfs_alloc_busy_search( struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len) { struct xfs_perag *pag; struct rb_node *rbp; struct xfs_busy_extent *busyp; int match = 0; pag = xfs_perag_get(mp, agno); spin_lock(&pag->pagb_lock); rbp = pag->pagb_tree.rb_node; while (rb...