git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4342 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-06-11 19:11:45 +00:00
parent f7627f7e67
commit 2e8ee2d548
3 changed files with 13 additions and 7 deletions

View File

@@ -3346,7 +3346,6 @@ static int __dev_user_set_opt(struct scst_user_dev *dev,
dev->queue_alg = opt->queue_alg;
dev->swp = opt->swp;
dev->tas = opt->tas;
dev->tst = opt->tst;
dev->d_sense = opt->d_sense;
dev->has_own_order_mgmt = opt->has_own_order_mgmt;
if (dev->sdev != NULL) {

View File

@@ -4041,15 +4041,23 @@ static void vdisk_task_mgmt_fn_done(struct scst_mgmt_cmd *mcmd,
/* Restore default values */
struct scst_device *dev = tgt_dev->dev;
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
int rc;
dev->tst = DEF_TST;
dev->d_sense = DEF_DSENSE;
dev->swp = DEF_SWP;
dev->tas = DEF_TAS;
if (virt_dev->wt_flag && !virt_dev->nv_cache)
dev->queue_alg = DEF_QUEUE_ALG_WT;
else
dev->queue_alg = DEF_QUEUE_ALG;
dev->swp = DEF_SWP;
dev->tas = DEF_TAS;
rc = vdisk_set_wt(virt_dev, DEF_WRITE_THROUGH);
if (rc != 0) {
PRINT_CRIT_ERROR("Unable to reset caching mode to %d",
DEF_WRITE_THROUGH);
}
spin_lock(&virt_dev->flags_lock);
virt_dev->prevent_allow_medium_removal = 0;

View File

@@ -8500,22 +8500,21 @@ int scst_copy_file(const char *src, const char *dest)
goto out;
}
TRACE_PR("Copying '%s' into '%s'", src, dest);
TRACE_DBG("Copying '%s' into '%s'", src, dest);
set_fs(KERNEL_DS);
file_src = filp_open(src, O_RDONLY, 0);
if (IS_ERR(file_src)) {
res = PTR_ERR(file_src);
TRACE_PR("Unable to open file '%s' - error %d", src,
res);
TRACE_DBG("Unable to open file '%s' - error %d", src, res);
goto out_free;
}
file_dest = filp_open(dest, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (IS_ERR(file_dest)) {
res = PTR_ERR(file_dest);
TRACE_PR("Unable to open backup file '%s' - error %d", dest,
TRACE_DBG("Unable to open backup file '%s' - error %d", dest,
res);
goto out_close;
}