Lines Matching defs:buf
1113 static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
1116 char *start = buf;
1119 return sprintf(buf, "[disabled]\n");
1144 buf += sprintf(buf, "[%s] ", hibernation_modes[i]);
1146 buf += sprintf(buf, "%s ", hibernation_modes[i]);
1149 buf += sprintf(buf, "\n");
1150 return buf - start;
1153 static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n)
1165 p = memchr(buf, '\n', n);
1166 len = p ? p - buf : n;
1170 if (len == strlen(hibernation_modes[i]) && !strncmp(buf, hibernation_modes[i], len)) {
1207 static ssize_t resume_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
1209 return sprintf(buf, "%d:%d\n", MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
1212 static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n)
1218 if (len && buf[len - 1] == '\n') {
1221 name = kstrndup(buf, len, GFP_KERNEL);
1243 static ssize_t resume_offset_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
1245 return sprintf(buf, "%llu\n", (unsigned long long)swsusp_resume_block);
1248 static ssize_t resume_offset_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n)
1253 rc = kstrtoull(buf, 0, &offset);
1264 static ssize_t image_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
1266 return sprintf(buf, "%lu\n", image_size);
1269 static ssize_t image_size_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n)
1273 if (sscanf(buf, "%lu", &size) == 1) {
1283 static ssize_t reserved_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
1285 return sprintf(buf, "%lu\n", reserved_size);
1288 static ssize_t reserved_size_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n)
1292 if (sscanf(buf, "%lu", &size) == 1) {