type
stringclasses
5 values
content
stringlengths
9
163k
functions
else if (bno > busyp->bno) { if (bno < busyp->bno + busyp->length) match = -1; rbp = rbp->rb_right; }
functions
bool xfs_alloc_busy_update_extent( struct xfs_mount *mp, struct xfs_perag *pag, struct xfs_busy_extent *busyp, xfs_agblock_t fbno, xfs_extlen_t flen, bool userdata) { xfs_agblock_t fend = fbno + flen; xfs_agblock_t bbno = busyp->bno; xfs_agblock_t bend = bbno + busyp->length; if (busyp->flags & XFS_AL...
functions
else if (bbno >= fbno && bend <= fend) { rb_erase(&busyp->rb_node, &pag->pagb_tree); busyp->length = 0; return false; }
functions
else if (fend < bend) { busyp->bno = fend; }
functions
else if (bbno < fbno) { busyp->length = fbno - busyp->bno; }
functions
void xfs_alloc_busy_reuse( struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t fbno, xfs_extlen_t flen, bool userdata) { struct xfs_perag *pag; struct rb_node *rbp; ASSERT(flen > 0); pag = xfs_perag_get(mp, agno); spin_lock(&pag->pagb_lock); restart: rbp = pag->pagb_tree.rb_node; while (rbp) { ...
functions
else if (fbno >= bend) { rbp = rbp->rb_right; continue; }
functions
void xfs_alloc_busy_trim( struct xfs_alloc_arg *args, xfs_agblock_t bno, xfs_extlen_t len, xfs_agblock_t *rbno, xfs_extlen_t *rlen) { xfs_agblock_t fbno; xfs_extlen_t flen; struct rb_node *rbp; ASSERT(len > 0); spin_lock(&args->pag->pagb_lock); restart: fbno = bno; flen = len; rbp = args->pag->pag...
functions
else if (fbno >= bend) { rbp = rbp->rb_right; continue; }
functions
else if (bend >= fend) { fend = bbno; }
functions
else if (fend - bend >= args->maxlen * 4) { fbno = bend; }
functions
else if (bbno - fbno >= args->minlen) { fend = bbno; }
functions
void xfs_alloc_busy_clear_one( struct xfs_mount *mp, struct xfs_perag *pag, struct xfs_busy_extent *busyp) { if (busyp->length) { trace_xfs_alloc_busy_clear(mp, busyp->agno, busyp->bno, busyp->length); rb_erase(&busyp->rb_node, &pag->pagb_tree); }
functions
void xfs_alloc_busy_clear( struct xfs_mount *mp, struct list_head *list, bool do_discard) { struct xfs_busy_extent *busyp, *n; struct xfs_perag *pag = NULL; xfs_agnumber_t agno = NULLAGNUMBER; list_for_each_entry_safe(busyp, n, list, list) { if (busyp->agno != agno) { if (pag) { spin_unlock(&pag->pa...
functions
int xfs_busy_extent_ag_cmp( void *priv, struct list_head *a, struct list_head *b) { return container_of(a, struct xfs_busy_extent, list)->agno - container_of(b, struct xfs_busy_extent, list)->agno; }
functions
void net_route_named_msg(struct sk_buff *buf) { struct tipc_msg *msg = buf_msg(buf); u32 dnode; u32 dport; if (!msg_named(msg)) { kfree_skb(buf); return; }
functions
void tipc_net_route_msg(struct sk_buff *buf) { struct tipc_msg *msg; u32 dnode; if (!buf) return; msg = buf_msg(buf); dnode = msg_short(msg) ? tipc_own_addr : msg_destnode(msg); if (tipc_in_scope(dnode, tipc_own_addr)) { if (msg_isdata(msg)) { if (msg_mcast(msg)) tipc_port_recv_mcast(buf, NULL); ...
functions
int tipc_net_start(u32 addr) { char addr_string[16]; tipc_subscr_stop(); tipc_cfg_stop(); tipc_own_addr = addr; tipc_named_reinit(); tipc_port_reinit(); tipc_bclink_init(); tipc_k_signal((Handler)tipc_subscr_start, 0); tipc_k_signal((Handler)tipc_cfg_init, 0); info("Started in network mode\n"); info("Ow...
functions
void tipc_net_stop(void) { struct tipc_node *node, *t_node; if (!tipc_own_addr) return; write_lock_bh(&tipc_net_lock); tipc_bearer_stop(); tipc_bclink_stop(); list_for_each_entry_safe(node, t_node, &tipc_node_list, list) tipc_node_delete(node); write_unlock_bh(&tipc_net_lock); info("Left network mode\n"); ...
includes
#include <linux/module.h>
includes
#include <linux/init.h>
defines
#define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \
defines
#define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \
defines
#define _OMAP2430_BALLENTRY(M0, bb, bt) \
defines
#define omap2430_pop_ball NULL
functions
__init omap2430_mux_init(struct omap_board_mux *board_subset, int flags) { struct omap_ball *package_balls = NULL; switch (flags & OMAP_PACKAGE_MASK) { case OMAP_PACKAGE_ZAC: package_balls = omap2430_pop_ball; break; default: pr_warning("mux: No ball data available for omap2420 package\n"); }
functions
int dsa_verify_key(dsa_key *key, int *stat) { void *tmp, *tmp2; int res, err; LTC_ARGCHK(key != NULL); LTC_ARGCHK(stat != NULL); /* default to an invalid key */ *stat = 0; /* first make sure key->q and key->p are prime */ if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { ...
includes
#include <linux/sched.h>
includes
#include <linux/module.h>
includes
#include <linux/init.h>
includes
#include <linux/clk.h>
includes
#include <linux/io.h>
includes
#include <linux/wakelock.h>
includes
#include <linux/time.h>
includes
#include <linux/kernel_stat.h>
includes
#include <linux/rtc.h>
includes
#include <linux/irq.h>
includes
#include <linux/time.h>
includes
#include <linux/wakelock.h>
includes
#include <../clock.h>
includes
#include <../clock-local.h>
includes
#include <mach/pm.h>
includes
#include <linux/vmalloc.h>
includes
#include <mach/board.h>
includes
#include <mach/rpm.h>
includes
#include <mach/perflock.h>
includes
#include <mach/rpm-8960.h>
includes
#include <mach/msm_xo.h>
defines
#define HTC_PM_STATSTIC_DELAY 10000
defines
#define arch_idle_time(cpu) 0
defines
#define MAX_PID 32768
defines
#define NUM_BUSY_THREAD_CHECK 5
structs
struct st_htc_idle_statistic { u32 count; u32 time; };
functions
void htc_idle_stat_clear(void) { memset(htc_idle_Stat, 0, sizeof(htc_idle_Stat)); }
functions
void htc_idle_stat_add(int sleep_mode, u32 time) { if (smp_processor_id() != 0) return; switch (sleep_mode) { case MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT: htc_idle_Stat[0].count++; htc_idle_Stat[0].time += time; break; case MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE: htc_idle_Stat[1].count++; htc_idle_St...
functions
void htc_idle_stat_show(u32 total_time) { int i = 0; u32 idle_time = 0; total_time *= 1000; for (i = 0 ; i < 3 ; i++) { if (htc_idle_Stat[i].count) { idle_time += htc_idle_Stat[i].time; printk(KERN_INFO "[K] C%d: %d %dms\n", i, htc_idle_Stat[i].count, htc_idle_Stat[i].time / 1000); }
functions
void htc_xo_block_clks_count_clear(void) { memset(count_xo_block_clk_array, 0, sizeof(count_xo_block_clk_array)); }
functions
void htc_xo_block_clks_count(void) { /* Temp mark it*/ #if 0 int ret, i; ret = msm_clock_require_tcxo(msm_pm_clocks_no_tcxo_shutdown, MAX_NR_CLKS); if (ret) { int blk_xo = 0; for_each_set_bit(i, msm_pm_clocks_no_tcxo_shutdown, MAX_NR_CLKS) { blk_xo = local_clk_src_xo(i); if (blk_xo) count_xo_block_clk_...
functions
void htc_xo_block_clks_count_show(void) { /* Temp mark it*/ #if 0 int ret, i; ret = msm_clock_require_tcxo(msm_pm_clocks_no_tcxo_shutdown, MAX_NR_CLKS); if (ret) { char clk_name[20] = "\0"; for_each_set_bit(i, msm_pm_clocks_no_tcxo_shutdown, MAX_NR_CLKS) { if (count_xo_block_clk_array[i] > 0) { clk_name[0...
functions
void htc_xo_vddmin_stat_show(void) { uint32_t xo_count = 0; uint64_t xo_time = 0; uint32_t vddmin_count = 0; uint64_t vddmin_time = 0; if (htc_get_xo_vdd_min_info(&xo_count, &xo_time, &vddmin_count, &vddmin_time)) { if (xo_count > previous_xo_count) { printk(KERN_INFO "[K] XO: %u, %llums\n", xo_count-previous...
functions
void htc_pm_monitor_work(struct work_struct *work) { struct timespec ts; struct rtc_time tm; if (htc_pm_monitor_wq == NULL) return; getnstimeofday(&ts); rtc_time_to_tm(ts.tv_sec - (sys_tz.tz_minuteswest * 60), &tm); printk(KERN_INFO "[K] [PM] hTC PM Statistic "); printk(KERN_INFO "[K] %02d-%02d %02d:%02d:%02...
functions
int findBiggestInRange(int *array, int max_limit_idx) { int largest_idx = 0, i; for (i = 0 ; i < MAX_PID ; i++) { if (array[i] > array[largest_idx] && (max_limit_idx == -1 || array[i] < array[max_limit_idx])) largest_idx = i; }
functions
void sorting(int *source, int *output) { int i; for (i = 0 ; i < NUM_BUSY_THREAD_CHECK ; i++) { if (i == 0) output[i] = findBiggestInRange(source, -1); else output[i] = findBiggestInRange(source, output[i-1]); }
functions
void get_all_cpu_stat(struct cpu_usage_stat *cpu_stat) { int i; cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; cputime64_t guest, guest_nice; if (!cpu_stat) return; user = nice = system = idle = iowait = irq = softirq = steal = cputime64_zero; guest = guest_nice = cputime64_zero; for_e...
functions
void htc_kernel_top(void) { struct task_struct *p; int top_loading[NUM_BUSY_THREAD_CHECK], i; unsigned long user_time, system_time, io_time; unsigned long irq_time, idle_time, delta_time; ulong flags; struct task_cputime cputime; int dump_top_stack = 0; if (task_ptr_array == NULL || curr_proc_delta == NULL ...
functions
void htc_pm_monitor_init(void) { if (htc_pm_monitor_wq == NULL) return; queue_delayed_work(htc_pm_monitor_wq, &htc_pm_delayed_work, msecs_to_jiffies(msm_htc_util_delay_time)); spin_lock_init(&lock); prev_proc_stat = vmalloc(sizeof(int) * MAX_PID); curr_proc_delta = vmalloc(sizeof(int) * MAX_PID); task_ptr_ar...
functions
void htc_monitor_init(void) { if (htc_pm_monitor_wq == NULL) { /* Create private workqueue... */ htc_pm_monitor_wq = create_workqueue("htc_pm_monitor_wq"); printk(KERN_INFO "[K] Create HTC private workqueue(0x%x)...\n", (unsigned int)htc_pm_monitor_wq); }
includes
#include <linux/kernel.h>
includes
#include <linux/file.h>
includes
#include <linux/fs.h>
includes
#include <linux/slab.h>
includes
#include <linux/export.h>
includes
#include <linux/namei.h>
includes
#include <linux/sched.h>
includes
#include <linux/writeback.h>
includes
#include <linux/syscalls.h>
includes
#include <linux/linkage.h>
includes
#include <linux/pagemap.h>
includes
#include <linux/quotaops.h>
includes
#include <linux/backing-dev.h>
includes
#include <linux/statfs.h>
includes
#include <trace/events/mmcio.h>
defines
#define VALID_FLAGS (SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| \
defines
#define FLAG_ASYNC_FSYNC 0x1
defines
#define LOW_STORAGE_THRESHOLD 786432
structs
struct fsync_work { struct work_struct work; char pathname[256]; struct list_head list; };
functions
int __sync_filesystem(struct super_block *sb, int wait) { if (sb->s_bdi == &noop_backing_dev_info) return 0; if (sb->s_qcop && sb->s_qcop->quota_sync) sb->s_qcop->quota_sync(sb, -1, wait); if (wait) sync_inodes_sb(sb); else writeback_inodes_sb(sb, WB_REASON_SYNC); if (sb->s_op->sync_fs) sb->s_op->sync...
functions
int sync_filesystem(struct super_block *sb) { int ret; WARN_ON(!rwsem_is_locked(&sb->s_umount)); if (sb->s_flags & MS_RDONLY) return 0; if (atomic_read(&vfs_emergency_remount)) { pr_info("%s: force sync fs in wait mode\n", __func__); ret = __sync_filesystem(sb, 1); }
functions
void sync_one_sb(struct super_block *sb, void *arg) { if (!(sb->s_flags & MS_RDONLY)) __sync_filesystem(sb, *(int *)arg); }
functions
void sync_filesystems(int wait) { iterate_supers(sync_one_sb, &wait); }
functions
void do_sync_work(struct work_struct *work) { sync_filesystems(0); sync_filesystems(0); printk("Emergency Sync complete\n"); kfree(work); }
functions
void emergency_sync(void) { struct work_struct *work; work = kmalloc(sizeof(*work), GFP_ATOMIC); if (work) { INIT_WORK(work, do_sync_work); schedule_work(work); }
functions
int vfs_fsync_range(struct file *file, loff_t start, loff_t end, int datasync) { int err; if (!file->f_op || !file->f_op->fsync) return -EINVAL; trace_vfs_fsync(file); err = file->f_op->fsync(file, start, end, datasync); trace_vfs_fsync_done(file); return err; }
functions
int vfs_fsync(struct file *file, int datasync) { return vfs_fsync_range(file, 0, LLONG_MAX, datasync); }
functions
int async_fsync(struct file *file, int fd) { struct inode *inode = file->f_mapping->host; struct super_block *sb = inode->i_sb; struct kstatfs st; if ((sb->fsync_flags & FLAG_ASYNC_FSYNC) == 0) return 0; if (!emmc_perf_degr()) return 0; if (fd_statfs(fd, &st)) return 0; if (st.f_bfree > LOW_STORAGE_THRE...
functions
int do_async_fsync(char *pathname) { struct file *file; int ret; file = filp_open(pathname, O_RDWR, 0); if (IS_ERR(file)) { pr_debug("%s: can't open %s\n", __func__, pathname); return -EBADF; }
functions
void do_afsync_work(struct work_struct *work) { struct fsync_work *fwork = container_of(work, struct fsync_work, work); int ret = -EBADF; pr_debug("afsync: %s\n", fwork->pathname); mutex_lock(&afsync_lock); list_del(&fwork->list); mutex_unlock(&afsync_lock); ret = do_async_fsync(fwork->pathname); if (ret != 0...
functions
int do_fsync(unsigned int fd, int datasync) { struct file *file; int ret = -EBADF; #ifdef CONFIG_ASYNC_FSYNC struct fsync_work *fwork, *tmp; #endif file = fget(fd); if (file) { ktime_t fsync_t, fsync_diff; char pathname[256], *path; path = d_path(&(file->f_path), pathname, sizeof(pathname)); if (IS_ERR(...
functions
int generic_write_sync(struct file *file, loff_t pos, loff_t count) { if (!(file->f_flags & O_DSYNC) && !IS_SYNC(file->f_mapping->host)) return 0; return vfs_fsync_range(file, pos, pos + count - 1, (file->f_flags & __O_SYNC) ? 0 : 1); }
functions
long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes, long flags) { return SYSC_sync_file_range((int) fd, offset, nbytes, (unsigned int) flags); }