JSFiddle - React, Tailwind, and code Playground
HTML
<pre>
<code />
</pre>
CSS
body
{
background: black;
color: lime;
}
JavaScript
ry {
$(function() {
var testString = "int acct_parm[3] = {4, 2, 30};\n#define RESUME (acct_parm[0]) /* >foo% free space - resume */\n#define SUSPEND (acct_parm[1]) /* <foo% free space - suspend */\n#define ACCT_TIMEOUT (acct_parm[2]) /* foo second timeout between checks */\n\n/*\n * External references and all of the globals.\n */\nstatic void do_acct_process(struct bsd_acct_struct *acct,\n struct pid_namespace *ns, struct file *);\n\n/*\n * This structure is used so that all the data protected by lock\n * can be placed in the same cache line as the lock. This primes\n * the cache line to have the data after getting the lock.\n */\nstruct bsd_acct_struct {\n volatile int active;\n volatile int needcheck;\n struct file *file;\n struct pid_namespace *ns;\n struct timer_list timer;\n struct list_head list;\n};\n\nstatic DEFINE_SPINLOCK(acct_lock);\nstatic LIST_HEAD(acct_list);\n\n/*\n * Called whenever the timer says to check the free space.\n */\nstatic void acct_timeout(unsigned long x)\n{\n struct bsd_acct_struct *acct = (struct bsd_acct_struct *)x;\n acct->needcheck = 1;\n}\n\n/*\n * Check the amount of free space and suspend/resume accordingly.\n */\nstatic int check_free_space(struct bsd_acct_struct *acct, struct file *file)\n{\n struct kstatfs sbuf;\n int res;\n int act;\n sector_t resume;\n sector_t suspend;\n\n spin_lock(&acct_lock);\n res = acct->active;\n if (!file || !acct->needcheck)\n goto out;\n spin_unlock(&acct_lock);\n\n /* May block */\n if (vfs_statfs(&file->f_path, &sbuf))\n return res;\n suspend = sbuf.f_blocks * SUSPEND;\n resume = sbuf.f_blocks * RESUME;\n\n sector_div(suspend, 100);\n sector_div(resume, 100);\n\n if (sbuf.f_bavail <= suspend)\n act = -1;\n else if (sbuf.f_bavail >= resume)\n act = 1;\n else\n act = 0;\n\n /*\n * If some joker...