Fix fops write buf printk bug, improve fops file name further

This commit is contained in:
Ciro Santilli
2017-05-26 09:09:24 +01:00
parent d38baa2358
commit d424380fe6
3 changed files with 12 additions and 12 deletions

View File

@@ -83,11 +83,11 @@ static ssize_t fop_write(struct file *file, const char __user *buf, size_t len,
ret = -EFAULT;
} else {
ret = len;
printk(KERN_INFO "buf = %.*s\n", (int)len, data + *off);
*off += ret;
}
}
}
printk(KERN_INFO "buf = %.*s\n", (int)len, data + *off);
printk(KERN_INFO "ret = %lld\n", (long long)ret);
return ret;
}
@@ -144,7 +144,7 @@ int init_module(void)
printk(KERN_ALERT "debugfs_create_dir failed");
return -1;
}
file = debugfs_create_file("fops", 0666, dir, NULL, &fops);
file = debugfs_create_file("f", 0666, dir, NULL, &fops);
if (!file) {
printk(KERN_ALERT "debugfs_create_file failed");
return -1;