aboutsummaryrefslogtreecommitdiffstats
path: root/fs/debugfs/file.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/debugfs/file.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'fs/debugfs/file.c')
-rw-r--r--fs/debugfs/file.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 0210898458b2..90f76575c056 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -43,6 +43,7 @@ const struct file_operations debugfs_file_operations = {
43 .read = default_read_file, 43 .read = default_read_file,
44 .write = default_write_file, 44 .write = default_write_file,
45 .open = default_open, 45 .open = default_open,
46 .llseek = noop_llseek,
46}; 47};
47 48
48static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd) 49static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd)
@@ -427,26 +428,17 @@ static ssize_t write_file_bool(struct file *file, const char __user *user_buf,
427 size_t count, loff_t *ppos) 428 size_t count, loff_t *ppos)
428{ 429{
429 char buf[32]; 430 char buf[32];
430 int buf_size; 431 size_t buf_size;
432 bool bv;
431 u32 *val = file->private_data; 433 u32 *val = file->private_data;
432 434
433 buf_size = min(count, (sizeof(buf)-1)); 435 buf_size = min(count, (sizeof(buf)-1));
434 if (copy_from_user(buf, user_buf, buf_size)) 436 if (copy_from_user(buf, user_buf, buf_size))
435 return -EFAULT; 437 return -EFAULT;
436 438
437 switch (buf[0]) { 439 if (strtobool(buf, &bv) == 0)
438 case 'y': 440 *val = bv;
439 case 'Y': 441
440 case '1':
441 *val = 1;
442 break;
443 case 'n':
444 case 'N':
445 case '0':
446 *val = 0;
447 break;
448 }
449
450 return count; 442 return count;
451} 443}
452 444
@@ -454,6 +446,7 @@ static const struct file_operations fops_bool = {
454 .read = read_file_bool, 446 .read = read_file_bool,
455 .write = write_file_bool, 447 .write = write_file_bool,
456 .open = default_open, 448 .open = default_open,
449 .llseek = default_llseek,
457}; 450};
458 451
459/** 452/**
@@ -498,6 +491,7 @@ static ssize_t read_file_blob(struct file *file, char __user *user_buf,
498static const struct file_operations fops_blob = { 491static const struct file_operations fops_blob = {
499 .read = read_file_blob, 492 .read = read_file_blob,
500 .open = default_open, 493 .open = default_open,
494 .llseek = default_llseek,
501}; 495};
502 496
503/** 497/**