diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 14629687c..aeafe2332 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15077,7 +15077,7 @@ out_unlock: /* Abstract vfs_unlink() for different kernel versions (as possible) */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) -void scst_vfs_unlink_and_put(struct nameidata *nd) +void scst_vfs_unlink_and_put_nd(struct nameidata *nd) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) vfs_unlink(nd->dentry->d_parent->d_inode, nd->dentry); @@ -15089,7 +15089,8 @@ void scst_vfs_unlink_and_put(struct nameidata *nd) path_put(&nd->path); #endif } -#else +#endif + void scst_vfs_unlink_and_put(struct path *path) { #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \ @@ -15102,7 +15103,6 @@ void scst_vfs_unlink_and_put(struct path *path) #endif path_put(path); } -#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) void scst_path_put(struct nameidata *nd) @@ -15221,7 +15221,7 @@ int scst_remove_file(const char *name) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) res = path_lookup(name, 0, &nd); if (!res) - scst_vfs_unlink_and_put(&nd); + scst_vfs_unlink_and_put_nd(&nd); else TRACE_DBG("Unable to lookup file '%s' - error %d", name, res); #else diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 5c1703374..d539d200d 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -1024,7 +1024,7 @@ write_error_close: rc = path_lookup(dev->pr_file_name, 0, &nd); if (!rc) - scst_vfs_unlink_and_put(&nd); + scst_vfs_unlink_and_put_nd(&nd); else TRACE_PR("Unable to lookup '%s' - error %d", dev->pr_file_name, rc); diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 8a51f94d6..b2226fad8 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -766,10 +766,9 @@ int scst_pr_init(struct scst_device *dev); void scst_pr_cleanup(struct scst_device *dev); #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) -void scst_vfs_unlink_and_put(struct nameidata *nd); -#else -void scst_vfs_unlink_and_put(struct path *path); +void scst_vfs_unlink_and_put_nd(struct nameidata *nd); #endif +void scst_vfs_unlink_and_put(struct path *path); int scst_copy_file(const char *src, const char *dest);