*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
seq_printf(m, "%s ", changelog_type2str(i));
i++;
}
+ seq_putc(m, '\n');
return 0;
}
int rc;
ENTRY;
- if (count >= PAGE_CACHE_SIZE)
+ if (count >= PAGE_SIZE)
RETURN(-EINVAL);
- OBD_ALLOC(kernbuf, PAGE_CACHE_SIZE);
+ OBD_ALLOC(kernbuf, PAGE_SIZE);
if (kernbuf == NULL)
RETURN(-ENOMEM);
if (copy_from_user(kernbuf, buffer, count))
if (rc == 0)
rc = count;
out:
- OBD_FREE(kernbuf, PAGE_CACHE_SIZE);
+ OBD_FREE(kernbuf, PAGE_SIZE);
return rc;
}
LPROC_SEQ_FOPS(mdd_changelog_mask);
rec = (struct llog_changelog_user_rec *)hdr;
- seq_printf(m, CHANGELOG_USER_PREFIX"%-3d "LPU64"\n",
+ seq_printf(m, CHANGELOG_USER_PREFIX"%-3d %llu\n",
rec->cur_id, rec->cur_endrec);
return 0;
}
cur = mdd->mdd_cl.mc_index;
spin_unlock(&mdd->mdd_cl.mc_lock);
- seq_printf(m, "current index: "LPU64"\n", cur);
+ seq_printf(m, "current index: %llu\n", cur);
seq_printf(m, "%-5s %s\n", "ID", "index");
llog_cat_process(&env, ctxt->loc_handle, lprocfs_changelog_users_cb,
rc = mdd_changelog_size_ctxt(&env, mdd, LLOG_CHANGELOG_USER_ORIG_CTXT,
&tmp);
- seq_printf(m, LPU64"\n", tmp);
+ seq_printf(m, "%llu\n", tmp);
lu_env_fini(&env);
return rc;
}
{
struct seq_file *m = file->private_data;
struct mdd_device *mdd = m->private;
- int val, rc;
+ int rc;
+ __s64 val;
- LASSERT(mdd != NULL);
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
+ LASSERT(mdd != NULL);
+ rc = lprocfs_str_to_s64(buffer, count, &val);
+ if (rc)
+ return rc;
- mdd->mdd_sync_permission = !!val;
- return count;
+ mdd->mdd_sync_permission = !!val;
+
+ return count;
}
LPROC_SEQ_FOPS(mdd_sync_perm);
{
struct seq_file *m = file->private_data;
struct mdd_device *mdd = m->private;
- __u32 val;
+ __s64 val;
int rc;
LASSERT(mdd != NULL);
- rc = lprocfs_write_helper(buffer, count, &val);
+ rc = lprocfs_str_to_s64(buffer, count, &val);
if (rc != 0)
return rc;
+ if (val < 0 || val > INT_MAX)
+ return -ERANGE;
rc = lfsck_set_speed(mdd->mdd_bottom, val);
return rc != 0 ? rc : count;
{
struct seq_file *m = file->private_data;
struct mdd_device *mdd = m->private;
- __u32 val;
+ __s64 val;
int rc;
LASSERT(mdd != NULL);
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc == 0)
- rc = lfsck_set_windows(mdd->mdd_bottom, val);
+ rc = lprocfs_str_to_s64(buffer, count, &val);
+ if (rc)
+ return rc;
+ if (val < 0 || val > INT_MAX)
+ return -ERANGE;
+
+ rc = lfsck_set_windows(mdd->mdd_bottom, val);
return rc != 0 ? rc : count;
}