Revert "[RAMEN9610-10521] IB/hfi1: convert to debugfs_file_get() and -put()"
authorYuseok Kim <yuseok21.kim@samsung.com>
Fri, 25 Jan 2019 16:28:16 +0000 (01:28 +0900)
committerhskang <hs1218.kang@samsung.com>
Sat, 26 Jan 2019 06:33:12 +0000 (15:33 +0900)
This reverts commit 444c51cb8ab6d30a289dad51df66a8aa29da551e.

Change-Id: I5955c0886c236dc859abbc763c03a354a305df89

drivers/infiniband/hw/hfi1/debugfs.c

index 8ab2c40b13b271fba24de26b997c4d3839098dc2..f661b387e916ccb09e83cd29fc438ff9ac7756ec 100644 (file)
@@ -71,13 +71,13 @@ static ssize_t hfi1_seq_read(
        loff_t *ppos)
 {
        struct dentry *d = file->f_path.dentry;
+       int srcu_idx;
        ssize_t r;
 
-       r = debugfs_file_get(d);
-       if (unlikely(r))
-               return r;
-       r = seq_read(file, buf, size, ppos);
-       debugfs_file_put(d);
+       r = debugfs_use_file_start(d, &srcu_idx);
+       if (likely(!r))
+               r = seq_read(file, buf, size, ppos);
+       debugfs_use_file_finish(srcu_idx);
        return r;
 }
 
@@ -87,13 +87,13 @@ static loff_t hfi1_seq_lseek(
        int whence)
 {
        struct dentry *d = file->f_path.dentry;
+       int srcu_idx;
        loff_t r;
 
-       r = debugfs_file_get(d);
-       if (unlikely(r))
-               return r;
-       r = seq_lseek(file, offset, whence);
-       debugfs_file_put(d);
+       r = debugfs_use_file_start(d, &srcu_idx);
+       if (likely(!r))
+               r = seq_lseek(file, offset, whence);
+       debugfs_use_file_finish(srcu_idx);
        return r;
 }