Lines Matching full:write

155  * enum sysctl_writes_mode - supported sysctl write modes
157 * @SYSCTL_WRITES_LEGACY: each write syscall must fully contain the sysctl value
165 * sent to the write syscall. If dealing with strings respect the file
170 * These write modes control how current file position affects the behavior of
171 * updating sysctl values through the proc interface on each write.
206 static int bpf_stats_handler(struct ctl_table *table, int write, in bpf_stats_handler() argument
220 if (write && !capable(CAP_SYS_ADMIN)) in bpf_stats_handler()
225 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in bpf_stats_handler()
226 if (write && !ret && val != saved_val) { in bpf_stats_handler()
244 static int _proc_do_string(char *data, int maxlen, int write, in _proc_do_string() argument
255 if (write) { in _proc_do_string()
343 * @write: %TRUE if this is a write to the sysctl file
357 int proc_dostring(struct ctl_table *table, int write, in proc_dostring() argument
360 if (write) in proc_dostring()
363 return _proc_do_string(table->data, table->maxlen, write, buffer, lenp, in proc_dostring()
527 int write, void *data) in do_proc_dointvec_conv() argument
529 if (write) { in do_proc_dointvec_conv()
554 int write, void *data) in do_proc_douintvec_conv() argument
556 if (write) { in do_proc_douintvec_conv()
570 int write, void *buffer, in __do_proc_dointvec() argument
573 int write, void *data), in __do_proc_dointvec()
580 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_dointvec()
592 if (write) { in __do_proc_dointvec()
605 if (write) { in __do_proc_dointvec()
630 if (!write && !first && left && !err) in __do_proc_dointvec()
632 if (write && !err && left) in __do_proc_dointvec()
634 if (write && first) in __do_proc_dointvec()
642 static int do_proc_dointvec(struct ctl_table *table, int write, in do_proc_dointvec() argument
645 int write, void *data), in do_proc_dointvec()
648 return __do_proc_dointvec(table->data, table, write, in do_proc_dointvec()
658 int write, void *data), in do_proc_douintvec_w() argument
713 int write, void *data), in do_proc_douintvec_r() argument
741 int write, void *buffer, in __do_proc_douintvec() argument
745 int write, void *data), in __do_proc_douintvec()
750 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_douintvec()
770 if (write) in __do_proc_douintvec()
776 static int do_proc_douintvec(struct ctl_table *table, int write, in do_proc_douintvec() argument
780 int write, void *data), in do_proc_douintvec()
783 return __do_proc_douintvec(table->data, table, write, in do_proc_douintvec()
790 * @write: %TRUE if this is a write to the sysctl file
800 int proc_dointvec(struct ctl_table *table, int write, void *buffer, in proc_dointvec() argument
803 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL); in proc_dointvec()
808 int write, void *buffer, size_t *lenp, loff_t *ppos) in proc_dointvec_minmax_warn_RT_change() argument
812 if (!IS_ENABLED(CONFIG_PREEMPT_RT) || !write) in proc_dointvec_minmax_warn_RT_change()
813 return proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_warn_RT_change()
816 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_warn_RT_change()
830 * @write: %TRUE if this is a write to the sysctl file
840 int proc_douintvec(struct ctl_table *table, int write, void *buffer, in proc_douintvec() argument
843 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec()
851 static int proc_taint(struct ctl_table *table, int write, in proc_taint() argument
858 if (write && !capable(CAP_SYS_ADMIN)) in proc_taint()
863 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); in proc_taint()
867 if (write) { in proc_taint()
891 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, in proc_dointvec_minmax_sysadmin() argument
894 if (write && !capable(CAP_SYS_ADMIN)) in proc_dointvec_minmax_sysadmin()
897 return proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_sysadmin()
917 int write, void *data) in do_proc_dointvec_minmax_conv() argument
925 int *ip = write ? &tmp : valp; in do_proc_dointvec_minmax_conv()
927 ret = do_proc_dointvec_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_minmax_conv()
931 if (write) { in do_proc_dointvec_minmax_conv()
944 * @write: %TRUE if this is a write to the sysctl file
955 * Returns 0 on success or -EINVAL on write when the range check fails.
957 int proc_dointvec_minmax(struct ctl_table *table, int write, in proc_dointvec_minmax() argument
964 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_minmax()
984 int write, void *data) in do_proc_douintvec_minmax_conv() argument
989 /* write via temporary local uint for bounds-checking */ in do_proc_douintvec_minmax_conv()
990 unsigned int *up = write ? &tmp : valp; in do_proc_douintvec_minmax_conv()
992 ret = do_proc_douintvec_conv(lvalp, up, write, data); in do_proc_douintvec_minmax_conv()
996 if (write) { in do_proc_douintvec_minmax_conv()
1010 * @write: %TRUE if this is a write to the sysctl file
1024 * Returns 0 on success or -ERANGE on write when the range check fails.
1026 int proc_douintvec_minmax(struct ctl_table *table, int write, in proc_douintvec_minmax() argument
1033 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec_minmax()
1039 int write, void *data) in do_proc_dopipe_max_size_conv() argument
1041 if (write) { in do_proc_dopipe_max_size_conv()
1057 static int proc_dopipe_max_size(struct ctl_table *table, int write, in proc_dopipe_max_size() argument
1060 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_dopipe_max_size()
1078 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, in proc_dointvec_minmax_coredump() argument
1081 int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_coredump()
1088 static int proc_dostring_coredump(struct ctl_table *table, int write, in proc_dostring_coredump() argument
1091 int error = proc_dostring(table, write, buffer, lenp, ppos); in proc_dostring_coredump()
1099 static int sysrq_sysctl_handler(struct ctl_table *table, int write, in sysrq_sysctl_handler() argument
1106 ret = __do_proc_dointvec(&tmp, table, write, buffer, in sysrq_sysctl_handler()
1108 if (ret || !write) in sysrq_sysctl_handler()
1111 if (write) in sysrq_sysctl_handler()
1119 int write, void *buffer, size_t *lenp, loff_t *ppos, in __do_proc_doulongvec_minmax() argument
1127 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_doulongvec_minmax()
1138 if (write) { in __do_proc_doulongvec_minmax()
1150 if (write) { in __do_proc_doulongvec_minmax()
1178 if (!write && !first && left && !err) in __do_proc_doulongvec_minmax()
1180 if (write && !err) in __do_proc_doulongvec_minmax()
1182 if (write && first) in __do_proc_doulongvec_minmax()
1190 static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, in do_proc_doulongvec_minmax() argument
1194 return __do_proc_doulongvec_minmax(table->data, table, write, in do_proc_doulongvec_minmax()
1201 * @write: %TRUE if this is a write to the sysctl file
1214 int proc_doulongvec_minmax(struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1217 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); in proc_doulongvec_minmax()
1223 * @write: %TRUE if this is a write to the sysctl file
1237 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1240 return do_proc_doulongvec_minmax(table, write, buffer, in proc_doulongvec_ms_jiffies_minmax()
1247 int write, void *data) in do_proc_dointvec_jiffies_conv() argument
1249 if (write) { in do_proc_dointvec_jiffies_conv()
1270 int write, void *data) in do_proc_dointvec_userhz_jiffies_conv() argument
1272 if (write) { in do_proc_dointvec_userhz_jiffies_conv()
1293 int write, void *data) in do_proc_dointvec_ms_jiffies_conv() argument
1295 if (write) { in do_proc_dointvec_ms_jiffies_conv()
1319 * @write: %TRUE if this is a write to the sysctl file
1331 int proc_dointvec_jiffies(struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1334 return do_proc_dointvec(table,write,buffer,lenp,ppos, in proc_dointvec_jiffies()
1341 * @write: %TRUE if this is a write to the sysctl file
1353 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1356 return do_proc_dointvec(table,write,buffer,lenp,ppos, in proc_dointvec_userhz_jiffies()
1363 * @write: %TRUE if this is a write to the sysctl file
1376 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void *buffer, in proc_dointvec_ms_jiffies() argument
1379 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies()
1383 static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer, in proc_do_cad_pid() argument
1392 r = __do_proc_dointvec(&tmp, table, write, buffer, in proc_do_cad_pid()
1394 if (r || !write) in proc_do_cad_pid()
1406 * proc_do_large_bitmap - read/write from/to a large bitmap
1408 * @write: %TRUE if this is a write to the sysctl file
1422 int proc_do_large_bitmap(struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1433 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) { in proc_do_large_bitmap()
1438 if (write) { in proc_do_large_bitmap()
1539 if (write) { in proc_do_large_bitmap()
1555 int proc_dostring(struct ctl_table *table, int write, in proc_dostring() argument
1561 int proc_dointvec(struct ctl_table *table, int write, in proc_dointvec() argument
1567 int proc_douintvec(struct ctl_table *table, int write, in proc_douintvec() argument
1573 int proc_dointvec_minmax(struct ctl_table *table, int write, in proc_dointvec_minmax() argument
1579 int proc_douintvec_minmax(struct ctl_table *table, int write, in proc_douintvec_minmax() argument
1585 int proc_dointvec_jiffies(struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1591 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1597 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, in proc_dointvec_ms_jiffies() argument
1603 int proc_doulongvec_minmax(struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1609 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1615 int proc_do_large_bitmap(struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1624 int proc_do_static_key(struct ctl_table *table, int write, in proc_do_static_key() argument
1638 if (write && !capable(CAP_SYS_ADMIN)) in proc_do_static_key()
1643 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in proc_do_static_key()
1644 if (write && !ret) { in proc_do_static_key()