Lines Matching full:write

90  * enum sysctl_writes_mode - supported sysctl write modes
92 * @SYSCTL_WRITES_LEGACY: each write syscall must fully contain the sysctl value
100 * sent to the write syscall. If dealing with strings respect the file
105 * These write modes control how current file position affects the behavior of
106 * updating sysctl values through the proc interface on each write.
124 static int _proc_do_string(char *data, int maxlen, int write, in _proc_do_string() argument
135 if (write) { in _proc_do_string()
223 * @write: %TRUE if this is a write to the sysctl file
237 int proc_dostring(const struct ctl_table *table, int write, in proc_dostring() argument
240 if (write) in proc_dostring()
243 return _proc_do_string(table->data, table->maxlen, write, buffer, lenp, in proc_dostring()
407 int write, void *data) in do_proc_dointvec_conv() argument
409 if (write) { in do_proc_dointvec_conv()
434 int write, void *data) in do_proc_douintvec_conv() argument
436 if (write) { in do_proc_douintvec_conv()
450 int write, void *buffer, in __do_proc_dointvec() argument
453 int write, void *data), in __do_proc_dointvec()
460 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_dointvec()
472 if (write) { in __do_proc_dointvec()
485 if (write) { in __do_proc_dointvec()
510 if (!write && !first && left && !err) in __do_proc_dointvec()
512 if (write && !err && left) in __do_proc_dointvec()
514 if (write && first) in __do_proc_dointvec()
522 static int do_proc_dointvec(const struct ctl_table *table, int write, in do_proc_dointvec() argument
525 int write, void *data), in do_proc_dointvec()
528 return __do_proc_dointvec(table->data, table, write, in do_proc_dointvec()
538 int write, void *data), in do_proc_douintvec_w() argument
593 int write, void *data), in do_proc_douintvec_r() argument
621 int write, void *buffer, in __do_proc_douintvec() argument
625 int write, void *data), in __do_proc_douintvec()
630 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_douintvec()
650 if (write) in __do_proc_douintvec()
656 int do_proc_douintvec(const struct ctl_table *table, int write, in do_proc_douintvec() argument
660 int write, void *data), in do_proc_douintvec()
663 return __do_proc_douintvec(table->data, table, write, in do_proc_douintvec()
668 * proc_dobool - read/write a bool
670 * @write: %TRUE if this is a write to the sysctl file
683 int proc_dobool(const struct ctl_table *table, int write, void *buffer, in proc_dobool() argument
699 res = proc_dointvec(&tmp, write, buffer, lenp, ppos); in proc_dobool()
702 if (write) in proc_dobool()
710 * @write: %TRUE if this is a write to the sysctl file
720 int proc_dointvec(const struct ctl_table *table, int write, void *buffer, in proc_dointvec() argument
723 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL); in proc_dointvec()
729 * @write: %TRUE if this is a write to the sysctl file
739 int proc_douintvec(const struct ctl_table *table, int write, void *buffer, in proc_douintvec() argument
742 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec()
750 static int proc_taint(const struct ctl_table *table, int write, in proc_taint() argument
757 if (write && !capable(CAP_SYS_ADMIN)) in proc_taint()
762 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); in proc_taint()
766 if (write) { in proc_taint()
805 int write, void *data) in do_proc_dointvec_minmax_conv() argument
813 int *ip = write ? &tmp : valp; in do_proc_dointvec_minmax_conv()
815 ret = do_proc_dointvec_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_minmax_conv()
819 if (write) { in do_proc_dointvec_minmax_conv()
832 * @write: %TRUE if this is a write to the sysctl file
843 * Returns 0 on success or -EINVAL on write when the range check fails.
845 int proc_dointvec_minmax(const struct ctl_table *table, int write, in proc_dointvec_minmax() argument
852 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_minmax()
872 int write, void *data) in do_proc_douintvec_minmax_conv() argument
877 /* write via temporary local uint for bounds-checking */ in do_proc_douintvec_minmax_conv()
878 unsigned int *up = write ? &tmp : valp; in do_proc_douintvec_minmax_conv()
880 ret = do_proc_douintvec_conv(lvalp, up, write, data); in do_proc_douintvec_minmax_conv()
884 if (write) { in do_proc_douintvec_minmax_conv()
898 * @write: %TRUE if this is a write to the sysctl file
912 * Returns 0 on success or -ERANGE on write when the range check fails.
914 int proc_douintvec_minmax(const struct ctl_table *table, int write, in proc_douintvec_minmax() argument
921 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec_minmax()
928 * @write: %TRUE if this is a write to the sysctl file
940 * Returns 0 on success or an error on write when the range check fails.
942 int proc_dou8vec_minmax(const struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
968 res = do_proc_douintvec(&tmp, write, buffer, lenp, ppos, in proc_dou8vec_minmax()
972 if (write) in proc_dou8vec_minmax()
979 static int sysrq_sysctl_handler(const struct ctl_table *table, int write, in sysrq_sysctl_handler() argument
986 ret = __do_proc_dointvec(&tmp, table, write, buffer, in sysrq_sysctl_handler()
988 if (ret || !write) in sysrq_sysctl_handler()
991 if (write) in sysrq_sysctl_handler()
999 const struct ctl_table *table, int write, in __do_proc_doulongvec_minmax() argument
1008 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_doulongvec_minmax()
1019 if (write) { in __do_proc_doulongvec_minmax()
1031 if (write) { in __do_proc_doulongvec_minmax()
1060 if (!write && !first && left && !err) in __do_proc_doulongvec_minmax()
1062 if (write && !err) in __do_proc_doulongvec_minmax()
1064 if (write && first) in __do_proc_doulongvec_minmax()
1072 static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write, in do_proc_doulongvec_minmax() argument
1076 return __do_proc_doulongvec_minmax(table->data, table, write, in do_proc_doulongvec_minmax()
1083 * @write: %TRUE if this is a write to the sysctl file
1096 int proc_doulongvec_minmax(const struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1099 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); in proc_doulongvec_minmax()
1105 * @write: %TRUE if this is a write to the sysctl file
1119 int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1122 return do_proc_doulongvec_minmax(table, write, buffer, in proc_doulongvec_ms_jiffies_minmax()
1129 int write, void *data) in do_proc_dointvec_jiffies_conv() argument
1131 if (write) { in do_proc_dointvec_jiffies_conv()
1155 int write, void *data) in do_proc_dointvec_userhz_jiffies_conv() argument
1157 if (write) { in do_proc_dointvec_userhz_jiffies_conv()
1178 int write, void *data) in do_proc_dointvec_ms_jiffies_conv() argument
1180 if (write) { in do_proc_dointvec_ms_jiffies_conv()
1202 int *valp, int write, void *data) in do_proc_dointvec_ms_jiffies_minmax_conv() argument
1210 int *ip = write ? &tmp : valp; in do_proc_dointvec_ms_jiffies_minmax_conv()
1212 ret = do_proc_dointvec_ms_jiffies_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_ms_jiffies_minmax_conv()
1216 if (write) { in do_proc_dointvec_ms_jiffies_minmax_conv()
1228 * @write: %TRUE if this is a write to the sysctl file
1240 int proc_dointvec_jiffies(const struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1243 return do_proc_dointvec(table,write,buffer,lenp,ppos, in proc_dointvec_jiffies()
1247 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies_minmax() argument
1254 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies_minmax()
1261 * @write: %TRUE if this is a write to the sysctl file
1273 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1276 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_userhz_jiffies()
1283 * @write: %TRUE if this is a write to the sysctl file
1295 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, void *buffer, in proc_dointvec_ms_jiffies() argument
1298 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies()
1302 static int proc_do_cad_pid(const struct ctl_table *table, int write, void *buffer, in proc_do_cad_pid() argument
1311 r = __do_proc_dointvec(&tmp, table, write, buffer, in proc_do_cad_pid()
1313 if (r || !write) in proc_do_cad_pid()
1325 * proc_do_large_bitmap - read/write from/to a large bitmap
1327 * @write: %TRUE if this is a write to the sysctl file
1341 int proc_do_large_bitmap(const struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1351 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) { in proc_do_large_bitmap()
1356 if (write) { in proc_do_large_bitmap()
1457 if (write) { in proc_do_large_bitmap()
1473 int proc_dostring(const struct ctl_table *table, int write, in proc_dostring() argument
1479 int proc_dobool(const struct ctl_table *table, int write, in proc_dobool() argument
1485 int proc_dointvec(const struct ctl_table *table, int write, in proc_dointvec() argument
1491 int proc_douintvec(const struct ctl_table *table, int write, in proc_douintvec() argument
1497 int proc_dointvec_minmax(const struct ctl_table *table, int write, in proc_dointvec_minmax() argument
1503 int proc_douintvec_minmax(const struct ctl_table *table, int write, in proc_douintvec_minmax() argument
1509 int proc_dou8vec_minmax(const struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
1515 int proc_dointvec_jiffies(const struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1521 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies_minmax() argument
1527 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1533 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies() argument
1539 int proc_doulongvec_minmax(const struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1545 int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1551 int proc_do_large_bitmap(const struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1560 int proc_do_static_key(const struct ctl_table *table, int write, in proc_do_static_key() argument
1574 if (write && !capable(CAP_SYS_ADMIN)) in proc_do_static_key()
1579 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in proc_do_static_key()
1580 if (write && !ret) { in proc_do_static_key()