RETURN(0);
}
-int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
+static int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
void *data)
{
struct obd_ioctl_data *ioc_data = (struct obd_ioctl_data *)data;
if (to > 0 && cur_index > to)
RETURN(-LLOG_EEMPTY);
}
- if (le32_to_cpu(handle->lgh_hdr->llh_flags) & LLOG_F_IS_CAT) {
+ if (handle->lgh_hdr->llh_flags & cpu_to_le32(LLOG_F_IS_CAT)) {
struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
struct llog_handle *log_handle;
- if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) {
+ if (rec->lrh_type != cpu_to_le32(LLOG_LOGID_MAGIC)) {
l = snprintf(out, remains,
"[index]: %05d [type]: %02x [len]: %04d failed\n",
cur_index, le32_to_cpu(rec->lrh_type),
if (to > 0 && cur_index > to)
RETURN(-LLOG_EEMPTY);
- if (le32_to_cpu(handle->lgh_hdr->llh_flags) & LLOG_F_IS_CAT) {
+ if (handle->lgh_hdr->llh_flags & cpu_to_le32(LLOG_F_IS_CAT)) {
struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
- if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) {
+ if (rec->lrh_type != cpu_to_le32(LLOG_LOGID_MAGIC)) {
CERROR("invalid record in catalog\n");
RETURN(-EINVAL);
}
RETURN(rc);
}
-int llog_delete_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
+static int llog_delete_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
void *data)
{
struct llog_logid_rec *lir = (struct llog_logid_rec*)rec;
int rc;
- if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC)
+ if (rec->lrh_type != cpu_to_le32(LLOG_LOGID_MAGIC))
return (-EINVAL);
rc = llog_remove_log(handle, &lir->lid_id);
struct llog_logid plain;
char *endp;
- if (!(le32_to_cpu(handle->lgh_hdr->llh_flags) & LLOG_F_IS_CAT))
+ if (!(handle->lgh_hdr->llh_flags & cpu_to_le32(LLOG_F_IS_CAT)))
GOTO(out_close, err = -EINVAL);
err = str2logid(&plain, data->ioc_inlbuf2, data->ioc_inllen2);
case OBD_IOC_LLOG_REMOVE: {
struct llog_logid plain;
- if (!(le32_to_cpu(handle->lgh_hdr->llh_flags) & LLOG_F_IS_CAT))
+ if (!(handle->lgh_hdr->llh_flags & cpu_to_le32(LLOG_F_IS_CAT)))
GOTO(out_close, err = -EINVAL);
if (data->ioc_inlbuf2) {
out_close:
if (handle->lgh_hdr &&
- le32_to_cpu(handle->lgh_hdr->llh_flags) & LLOG_F_IS_CAT)
+ handle->lgh_hdr->llh_flags & cpu_to_le32(LLOG_F_IS_CAT))
llog_cat_put(handle);
else
llog_close(handle);