Lines Matching refs: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,
157 if (write) {
245 * @write: %TRUE if this is a write to the sysctl file
259 int proc_dostring(const struct ctl_table *table, int write,
262 if (write)
265 return _proc_do_string(table->data, table->maxlen, write, buffer, lenp,
429 int write, void *data)
431 if (write) {
456 int write, void *data)
458 if (write) {
472 int write, void *buffer,
475 int write, void *data),
482 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) {
494 if (write) {
507 if (write) {
532 if (!write && !first && left && !err)
534 if (write && !err && left)
536 if (write && first)
544 static int do_proc_dointvec(const struct ctl_table *table, int write,
547 int write, void *data),
550 return __do_proc_dointvec(table->data, table, write,
560 int write, void *data),
615 int write, void *data),
643 int write, void *buffer,
647 int write, void *data),
652 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) {
672 if (write)
678 int do_proc_douintvec(const struct ctl_table *table, int write,
682 int write, void *data),
685 return __do_proc_douintvec(table->data, table, write,
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,
721 res = proc_dointvec(&tmp, write, buffer, lenp, ppos);
724 if (write)
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,
745 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);
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,
764 return do_proc_douintvec(table, write, buffer, lenp, ppos,
772 static int proc_taint(const struct ctl_table *table, int write,
779 if (write && !capable(CAP_SYS_ADMIN))
784 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
788 if (write) {
827 int write, void *data)
835 int *ip = write ? &tmp : valp;
837 ret = do_proc_dointvec_conv(negp, lvalp, ip, write, data);
841 if (write) {
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,
874 return do_proc_dointvec(table, write, buffer, lenp, ppos,
894 int write, void *data)
899 /* write via temporary local uint for bounds-checking */
900 unsigned int *up = write ? &tmp : valp;
902 ret = do_proc_douintvec_conv(lvalp, up, write, data);
906 if (write) {
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,
943 return do_proc_douintvec(table, write, buffer, lenp, ppos,
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,
990 res = do_proc_douintvec(&tmp, write, buffer, lenp, ppos,
994 if (write)
1001 static int sysrq_sysctl_handler(const struct ctl_table *table, int write,
1008 ret = __do_proc_dointvec(&tmp, table, write, buffer,
1010 if (ret || !write)
1013 if (write)
1021 const struct ctl_table *table, int write,
1030 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
1041 if (write) {
1053 if (write) {
1082 if (!write && !first && left && !err)
1084 if (write && !err)
1086 if (write && first)
1094 static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write,
1098 return __do_proc_doulongvec_minmax(table->data, table, write,
1105 * @write: %TRUE if this is a write to the sysctl file
1118 int proc_doulongvec_minmax(const struct ctl_table *table, int write,
1121 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
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,
1144 return do_proc_doulongvec_minmax(table, write, buffer,
1151 int write, void *data)
1153 if (write) {
1177 int write, void *data)
1179 if (write) {
1200 int write, void *data)
1202 if (write) {
1224 int *valp, int write, void *data)
1232 int *ip = write ? &tmp : valp;
1234 ret = do_proc_dointvec_ms_jiffies_conv(negp, lvalp, ip, write, data);
1238 if (write) {
1250 * @write: %TRUE if this is a write to the sysctl file
1262 int proc_dointvec_jiffies(const struct ctl_table *table, int write,
1265 return do_proc_dointvec(table,write,buffer,lenp,ppos,
1269 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
1276 return do_proc_dointvec(table, write, buffer, lenp, ppos,
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,
1298 return do_proc_dointvec(table, write, buffer, lenp, ppos,
1305 * @write: %TRUE if this is a write to the sysctl file
1317 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, void *buffer,
1320 return do_proc_dointvec(table, write, buffer, lenp, ppos,
1324 static int proc_do_cad_pid(const struct ctl_table *table, int write, void *buffer,
1333 r = __do_proc_dointvec(&tmp, table, write, buffer,
1335 if (r || !write)
1347 * proc_do_large_bitmap - read/write from/to a large bitmap
1349 * @write: %TRUE if this is a write to the sysctl file
1363 int proc_do_large_bitmap(const struct ctl_table *table, int write,
1373 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) {
1378 if (write) {
1479 if (write) {
1495 int proc_dostring(const struct ctl_table *table, int write,
1501 int proc_dobool(const struct ctl_table *table, int write,
1507 int proc_dointvec(const struct ctl_table *table, int write,
1513 int proc_douintvec(const struct ctl_table *table, int write,
1519 int proc_dointvec_minmax(const struct ctl_table *table, int write,
1525 int proc_douintvec_minmax(const struct ctl_table *table, int write,
1531 int proc_dou8vec_minmax(const struct ctl_table *table, int write,
1537 int proc_dointvec_jiffies(const struct ctl_table *table, int write,
1543 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
1549 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write,
1555 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write,
1561 int proc_doulongvec_minmax(const struct ctl_table *table, int write,
1567 int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
1573 int proc_do_large_bitmap(const struct ctl_table *table, int write,
1582 int proc_do_static_key(const struct ctl_table *table, int write,
1596 if (write && !capable(CAP_SYS_ADMIN))
1601 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
1602 if (write && !ret) {