Lines Matching full:write
106 * enum sysctl_writes_mode - supported sysctl write modes
108 * @SYSCTL_WRITES_LEGACY: each write syscall must fully contain the sysctl value
116 * sent to the write syscall. If dealing with strings respect the file
121 * These write modes control how current file position affects the behavior of
122 * updating sysctl values through the proc interface on each write.
146 static int _proc_do_string(char *data, int maxlen, int write, in _proc_do_string() argument
157 if (write) { in _proc_do_string()
245 * @write: %TRUE if this is a write to the sysctl file
259 int proc_dostring(const struct ctl_table *table, int write, in proc_dostring() argument
262 if (write) in proc_dostring()
265 return _proc_do_string(table->data, table->maxlen, write, buffer, lenp, in proc_dostring()
429 int write, void *data) in do_proc_dointvec_conv() argument
431 if (write) { in do_proc_dointvec_conv()
456 int write, void *data) in do_proc_douintvec_conv() argument
458 if (write) { in do_proc_douintvec_conv()
472 int write, void *buffer, in __do_proc_dointvec() argument
475 int write, void *data), in __do_proc_dointvec()
482 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_dointvec()
494 if (write) { in __do_proc_dointvec()
507 if (write) { in __do_proc_dointvec()
532 if (!write && !first && left && !err) in __do_proc_dointvec()
534 if (write && !err && left) in __do_proc_dointvec()
536 if (write && first) in __do_proc_dointvec()
544 static int do_proc_dointvec(const struct ctl_table *table, int write, in do_proc_dointvec() argument
547 int write, void *data), in do_proc_dointvec()
550 return __do_proc_dointvec(table->data, table, write, in do_proc_dointvec()
560 int write, void *data), in do_proc_douintvec_w() argument
615 int write, void *data), in do_proc_douintvec_r() argument
643 int write, void *buffer, in __do_proc_douintvec() argument
647 int write, void *data), in __do_proc_douintvec()
652 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_douintvec()
672 if (write) in __do_proc_douintvec()
678 int do_proc_douintvec(const struct ctl_table *table, int write, in do_proc_douintvec() argument
682 int write, void *data), in do_proc_douintvec()
685 return __do_proc_douintvec(table->data, table, write, in do_proc_douintvec()
690 * proc_dobool - read/write a bool
692 * @write: %TRUE if this is a write to the sysctl file
705 int proc_dobool(const struct ctl_table *table, int write, void *buffer, in proc_dobool() argument
721 res = proc_dointvec(&tmp, write, buffer, lenp, ppos); in proc_dobool()
724 if (write) in proc_dobool()
732 * @write: %TRUE if this is a write to the sysctl file
742 int proc_dointvec(const struct ctl_table *table, int write, void *buffer, in proc_dointvec() argument
745 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL); in proc_dointvec()
751 * @write: %TRUE if this is a write to the sysctl file
761 int proc_douintvec(const struct ctl_table *table, int write, void *buffer, in proc_douintvec() argument
764 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec()
772 static int proc_taint(const struct ctl_table *table, int write, in proc_taint() argument
779 if (write && !capable(CAP_SYS_ADMIN)) in proc_taint()
784 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); in proc_taint()
788 if (write) { in proc_taint()
827 int write, void *data) in do_proc_dointvec_minmax_conv() argument
835 int *ip = write ? &tmp : valp; in do_proc_dointvec_minmax_conv()
837 ret = do_proc_dointvec_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_minmax_conv()
841 if (write) { in do_proc_dointvec_minmax_conv()
854 * @write: %TRUE if this is a write to the sysctl file
865 * Returns 0 on success or -EINVAL on write when the range check fails.
867 int proc_dointvec_minmax(const struct ctl_table *table, int write, in proc_dointvec_minmax() argument
874 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_minmax()
894 int write, void *data) in do_proc_douintvec_minmax_conv() argument
899 /* write via temporary local uint for bounds-checking */ in do_proc_douintvec_minmax_conv()
900 unsigned int *up = write ? &tmp : valp; in do_proc_douintvec_minmax_conv()
902 ret = do_proc_douintvec_conv(lvalp, up, write, data); in do_proc_douintvec_minmax_conv()
906 if (write) { in do_proc_douintvec_minmax_conv()
920 * @write: %TRUE if this is a write to the sysctl file
934 * Returns 0 on success or -ERANGE on write when the range check fails.
936 int proc_douintvec_minmax(const struct ctl_table *table, int write, in proc_douintvec_minmax() argument
943 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec_minmax()
950 * @write: %TRUE if this is a write to the sysctl file
962 * Returns 0 on success or an error on write when the range check fails.
964 int proc_dou8vec_minmax(const struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
990 res = do_proc_douintvec(&tmp, write, buffer, lenp, ppos, in proc_dou8vec_minmax()
994 if (write) in proc_dou8vec_minmax()
1001 static int sysrq_sysctl_handler(const struct ctl_table *table, int write, in sysrq_sysctl_handler() argument
1008 ret = __do_proc_dointvec(&tmp, table, write, buffer, in sysrq_sysctl_handler()
1010 if (ret || !write) in sysrq_sysctl_handler()
1013 if (write) in sysrq_sysctl_handler()
1021 const struct ctl_table *table, int write, in __do_proc_doulongvec_minmax() argument
1030 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_doulongvec_minmax()
1041 if (write) { in __do_proc_doulongvec_minmax()
1053 if (write) { in __do_proc_doulongvec_minmax()
1082 if (!write && !first && left && !err) in __do_proc_doulongvec_minmax()
1084 if (write && !err) in __do_proc_doulongvec_minmax()
1086 if (write && first) in __do_proc_doulongvec_minmax()
1094 static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write, in do_proc_doulongvec_minmax() argument
1098 return __do_proc_doulongvec_minmax(table->data, table, write, in do_proc_doulongvec_minmax()
1105 * @write: %TRUE if this is a write to the sysctl file
1118 int proc_doulongvec_minmax(const struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1121 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); in proc_doulongvec_minmax()
1127 * @write: %TRUE if this is a write to the sysctl file
1141 int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1144 return do_proc_doulongvec_minmax(table, write, buffer, in proc_doulongvec_ms_jiffies_minmax()
1151 int write, void *data) in do_proc_dointvec_jiffies_conv() argument
1153 if (write) { in do_proc_dointvec_jiffies_conv()
1177 int write, void *data) in do_proc_dointvec_userhz_jiffies_conv() argument
1179 if (write) { in do_proc_dointvec_userhz_jiffies_conv()
1200 int write, void *data) in do_proc_dointvec_ms_jiffies_conv() argument
1202 if (write) { in do_proc_dointvec_ms_jiffies_conv()
1224 int *valp, int write, void *data) in do_proc_dointvec_ms_jiffies_minmax_conv() argument
1232 int *ip = write ? &tmp : valp; in do_proc_dointvec_ms_jiffies_minmax_conv()
1234 ret = do_proc_dointvec_ms_jiffies_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_ms_jiffies_minmax_conv()
1238 if (write) { in do_proc_dointvec_ms_jiffies_minmax_conv()
1250 * @write: %TRUE if this is a write to the sysctl file
1262 int proc_dointvec_jiffies(const struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1265 return do_proc_dointvec(table,write,buffer,lenp,ppos, in proc_dointvec_jiffies()
1269 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies_minmax() argument
1276 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies_minmax()
1283 * @write: %TRUE if this is a write to the sysctl file
1295 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1298 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_userhz_jiffies()
1305 * @write: %TRUE if this is a write to the sysctl file
1318 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, void *buffer, in proc_dointvec_ms_jiffies() argument
1321 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies()
1325 static int proc_do_cad_pid(const struct ctl_table *table, int write, void *buffer, in proc_do_cad_pid() argument
1334 r = __do_proc_dointvec(&tmp, table, write, buffer, in proc_do_cad_pid()
1336 if (r || !write) in proc_do_cad_pid()
1348 * proc_do_large_bitmap - read/write from/to a large bitmap
1350 * @write: %TRUE if this is a write to the sysctl file
1364 int proc_do_large_bitmap(const struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1374 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) { in proc_do_large_bitmap()
1379 if (write) { in proc_do_large_bitmap()
1480 if (write) { in proc_do_large_bitmap()
1496 int proc_dostring(const struct ctl_table *table, int write, in proc_dostring() argument
1502 int proc_dobool(const struct ctl_table *table, int write, in proc_dobool() argument
1508 int proc_dointvec(const struct ctl_table *table, int write, in proc_dointvec() argument
1514 int proc_douintvec(const struct ctl_table *table, int write, in proc_douintvec() argument
1520 int proc_dointvec_minmax(const struct ctl_table *table, int write, in proc_dointvec_minmax() argument
1526 int proc_douintvec_minmax(const struct ctl_table *table, int write, in proc_douintvec_minmax() argument
1532 int proc_dou8vec_minmax(const struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
1538 int proc_dointvec_jiffies(const struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1544 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies_minmax() argument
1550 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1556 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies() argument
1562 int proc_doulongvec_minmax(const struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1568 int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1574 int proc_do_large_bitmap(const struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1583 int proc_do_static_key(const struct ctl_table *table, int write, in proc_do_static_key() argument
1597 if (write && !capable(CAP_SYS_ADMIN)) in proc_do_static_key()
1602 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in proc_do_static_key()
1603 if (write && !ret) { in proc_do_static_key()