Function report |
Source Code:kernel\sysctl.c |
Create Date:2022-07-28 09:11:46 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:proc_do_large_bitmap - read/write from/to a large bitmap*@table: the sysctl table*@write: %TRUE if this is a write to the sysctl file*@buffer: the user buffer*@lenp: the size of the user buffer*@ppos: file position* The bitmap is stored at table->data and
Proto:int proc_do_large_bitmap(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct ctl_table * | table | |
int | write | |
void __user * | buffer | |
size_t * | lenp | |
loff_t * | ppos |
3169 | err = 0 |
3170 | first = 1 |
3172 | bitmap_len = maxlen |
3174 | unsigned long * tmp_bitmap = NULL |
3177 | If Not bitmap || Not bitmap_len || Not left || ppos && Not write Then |
3178 | lenp = 0 |
3179 | Return 0 |
3182 | If write Then |
3184 | skipped = 0 |
3192 | p = kbuf = memdup_user_nul(buffer, left) |
3196 | tmp_bitmap = bitmap_zalloc(bitmap_len, GFP_KERNEL) |
3197 | If Not tmp_bitmap Then |
3199 | Return -ENOMEM |
3201 | proc_skip_char( & p, & left, '\n') |
3208 | saved_left = left |
3217 | left = saved_left |
3218 | Break |
3221 | If err Then Break |
3223 | If val_a >= bitmap_len || neg Then |
3229 | If left Then |
3234 | If c == '-' Then |
3243 | left = saved_left |
3244 | Break |
3247 | If err Then Break |
3249 | If val_b >= bitmap_len || neg || val_a > val_b Then |
3254 | If left Then |
3260 | bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1) |
3261 | first = 0 |
3262 | proc_skip_char( & p, & left, '\n') |
3266 | Else |
3267 | bit_b = 0 |
3271 | If bit_a >= bitmap_len Then Break |
3273 | bit_b = Find the next zero bit in a memory region. - 1 |
3276 | If Not first Then |
3277 | err = proc_put_char( & buffer, & left, ',') |
3278 | If err Then Break |
3282 | If err Then Break |
3285 | err = proc_put_char( & buffer, & left, '-') |
3286 | If err Then Break |
3289 | If err Then Break |
3293 | first = 0 |
3293 | bit_b++ |
3295 | If Not err Then err = proc_put_char( & buffer, & left, '\n') |
3299 | If Not err Then |
3300 | If write Then |
3301 | If ppos Then bitmap_or(bitmap, bitmap, tmp_bitmap, bitmap_len) |
3303 | Else bitmap_copy(bitmap, tmp_bitmap, bitmap_len) |
3310 | bitmap_free(tmp_bitmap) |
3311 | Return err |
Name | Describe |
---|---|
proc_watchdog_cpumask | The cpumask is the mask of possible cpus that the watchdog can run* on, not the mask of cpus it is actually running on. This allows the* user to specify a mask that will include cpus that have not yet* been brought online, if desired. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |