Skip to content

Commit 6edb568

Browse files
Fabian Fredericktorvalds
authored andcommitted
fs/dlm/lockspace.c: convert simple_str to kstr
Replace obsolete functions. Signed-off-by: Fabian Frederick <[email protected]> Cc: Christine Caulfield <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4f4c337 commit 6edb568

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

fs/dlm/lockspace.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ static struct task_struct * scand_task;
3535
static ssize_t dlm_control_store(struct dlm_ls *ls, const char *buf, size_t len)
3636
{
3737
ssize_t ret = len;
38-
int n = simple_strtol(buf, NULL, 0);
38+
int n;
39+
int rc = kstrtoint(buf, 0, &n);
3940

41+
if (rc)
42+
return rc;
4043
ls = dlm_find_lockspace_local(ls->ls_local_handle);
4144
if (!ls)
4245
return -EINVAL;
@@ -57,7 +60,10 @@ static ssize_t dlm_control_store(struct dlm_ls *ls, const char *buf, size_t len)
5760

5861
static ssize_t dlm_event_store(struct dlm_ls *ls, const char *buf, size_t len)
5962
{
60-
ls->ls_uevent_result = simple_strtol(buf, NULL, 0);
63+
int rc = kstrtoint(buf, 0, &ls->ls_uevent_result);
64+
65+
if (rc)
66+
return rc;
6167
set_bit(LSFL_UEVENT_WAIT, &ls->ls_flags);
6268
wake_up(&ls->ls_uevent_wait);
6369
return len;
@@ -70,7 +76,10 @@ static ssize_t dlm_id_show(struct dlm_ls *ls, char *buf)
7076

7177
static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len)
7278
{
73-
ls->ls_global_id = simple_strtoul(buf, NULL, 0);
79+
int rc = kstrtouint(buf, 0, &ls->ls_global_id);
80+
81+
if (rc)
82+
return rc;
7483
return len;
7584
}
7685

@@ -81,7 +90,11 @@ static ssize_t dlm_nodir_show(struct dlm_ls *ls, char *buf)
8190

8291
static ssize_t dlm_nodir_store(struct dlm_ls *ls, const char *buf, size_t len)
8392
{
84-
int val = simple_strtoul(buf, NULL, 0);
93+
int val;
94+
int rc = kstrtoint(buf, 0, &val);
95+
96+
if (rc)
97+
return rc;
8598
if (val == 1)
8699
set_bit(LSFL_NODIR, &ls->ls_flags);
87100
return len;

0 commit comments

Comments
 (0)