mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 05:36:22 +00:00
scst: Remove superfluous get_fs() and set_fs() calls
Calling set_fs(KERNEL_DS) before calling path_lookup() or kern_path() is not necessary since the arguments of these functions point at kernel data. Hence remove the get_fs() / set_fs() calls from around these function calls. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9187 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -10081,12 +10081,9 @@ static int __init vdev_check_mode_pages_path(void)
|
||||
#else
|
||||
struct path path;
|
||||
#endif
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
|
||||
res = path_lookup(VDEV_MODE_PAGES_DIR, 0, &nd);
|
||||
if (res == 0)
|
||||
@@ -10101,12 +10098,8 @@ static int __init vdev_check_mode_pages_path(void)
|
||||
"disabled. You should create this directory manually "
|
||||
"or reinstall SCST", VDEV_MODE_PAGES_DIR, res);
|
||||
vdev_saved_mode_pages_enabled = false;
|
||||
goto out_setfs;
|
||||
}
|
||||
|
||||
out_setfs:
|
||||
set_fs(old_fs);
|
||||
|
||||
res = 0; /* always succeed */
|
||||
|
||||
TRACE_EXIT_RES(res);
|
||||
|
||||
@@ -15235,12 +15235,9 @@ int scst_remove_file(const char *name)
|
||||
#else
|
||||
struct path path;
|
||||
#endif
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
|
||||
res = path_lookup(name, 0, &nd);
|
||||
if (!res)
|
||||
@@ -15255,8 +15252,6 @@ int scst_remove_file(const char *name)
|
||||
TRACE_DBG("Unable to lookup file '%s' - error %d", name, res);
|
||||
#endif
|
||||
|
||||
set_fs(old_fs);
|
||||
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user