• Home
  • Raw
  • Download

Lines Matching refs:buf

62 static int kobject_action_type(const char *buf, size_t count,  in kobject_action_type()  argument
71 if (count && (buf[count-1] == '\n' || buf[count-1] == '\0')) in kobject_action_type()
77 args_start = strnchr(buf, count, ' '); in kobject_action_type()
79 count_first = args_start - buf; in kobject_action_type()
85 if (strncmp(kobject_actions[action], buf, count_first) != 0) in kobject_action_type()
99 static const char *action_arg_word_end(const char *buf, const char *buf_end, in action_arg_word_end() argument
102 const char *next = buf; in action_arg_word_end()
108 if (next == buf) in action_arg_word_end()
114 static int kobject_action_args(const char *buf, size_t count, in kobject_action_args() argument
122 if (count && (buf[count - 1] == '\n' || buf[count - 1] == '\0')) in kobject_action_args()
133 if (count < UUID_STRING_LEN || !uuid_is_valid(buf) || in kobject_action_args()
134 add_uevent_var(env, "SYNTH_UUID=%.*s", UUID_STRING_LEN, buf)) in kobject_action_args()
141 next = buf + UUID_STRING_LEN; in kobject_action_args()
142 buf_end = buf + count - 1; in kobject_action_args()
153 buf = next; in kobject_action_args()
154 next = action_arg_word_end(buf, buf_end, '='); in kobject_action_args()
157 key_len = next - buf; in kobject_action_args()
163 buf = next; in kobject_action_args()
164 next = action_arg_word_end(buf, buf_end, ' '); in kobject_action_args()
169 key_len, key, (int) (next - buf), buf)) in kobject_action_args()
192 int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count) in kobject_synth_uevent() argument
201 r = kobject_action_type(buf, count, &action, &action_args); in kobject_synth_uevent()
213 count - (action_args - buf), &env); in kobject_synth_uevent()
256 len = strlcpy(&env->buf[env->buflen], subsystem, in init_uevent_argv()
257 sizeof(env->buf) - env->buflen); in init_uevent_argv()
258 if (len >= (sizeof(env->buf) - env->buflen)) { in init_uevent_argv()
264 env->argv[1] = &env->buf[env->buflen]; in init_uevent_argv()
297 skb_put_data(skb, env->buf, env->buflen); in alloc_uevent_skb()
664 len = vsnprintf(&env->buf[env->buflen], in add_uevent_var()
665 sizeof(env->buf) - env->buflen, in add_uevent_var()
669 if (len >= (sizeof(env->buf) - env->buflen)) { in add_uevent_var()
674 env->envp[env->envp_idx++] = &env->buf[env->buflen]; in add_uevent_var()
685 char buf[sizeof("SEQNUM=") + 21]; in uevent_net_broadcast() local
690 ret = snprintf(buf, sizeof(buf), "SEQNUM=%llu", ++uevent_seqnum); in uevent_net_broadcast()
691 if (ret < 0 || (size_t)ret >= sizeof(buf)) in uevent_net_broadcast()
707 skb_put_data(skbc, buf, ret); in uevent_net_broadcast()