Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
b=22359 fix t_id for the recovery thread
[fs/lustre-release.git]
/
lustre
/
obdclass
/
llog_ioctl.c
diff --git
a/lustre/obdclass/llog_ioctl.c
b/lustre/obdclass/llog_ioctl.c
index
d1c3fa5
..
b7e1843
100644
(file)
--- a/
lustre/obdclass/llog_ioctl.c
+++ b/
lustre/obdclass/llog_ioctl.c
@@
-103,9
+103,9
@@
static int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
if (ioc_data && (ioc_data->ioc_inllen1)) {
l = 0;
remains = ioc_data->ioc_inllen4 +
if (ioc_data && (ioc_data->ioc_inllen1)) {
l = 0;
remains = ioc_data->ioc_inllen4 +
- size_round(ioc_data->ioc_inllen1) +
- size_round(ioc_data->ioc_inllen2) +
- size_round(ioc_data->ioc_inllen3);
+
cfs_
size_round(ioc_data->ioc_inllen1) +
+
cfs_
size_round(ioc_data->ioc_inllen2) +
+
cfs_
size_round(ioc_data->ioc_inllen3);
from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
@@
-147,6
+147,7
@@
static int llog_check_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
case OST_RAID1_REC:
case MDS_UNLINK_REC:
case MDS_SETATTR_REC:
case OST_RAID1_REC:
case MDS_UNLINK_REC:
case MDS_SETATTR_REC:
+ case MDS_SETATTR64_REC:
case OBD_CFG_REC:
case LLOG_HDR_MAGIC: {
l = snprintf(out, remains, "[index]: %05d [type]: "
case OBD_CFG_REC:
case LLOG_HDR_MAGIC: {
l = snprintf(out, remains, "[index]: %05d [type]: "
@@
-192,9
+193,9
@@
static int llog_print_cb(struct llog_handle *handle, struct llog_rec_hdr *rec,
if (ioc_data->ioc_inllen1) {
l = 0;
remains = ioc_data->ioc_inllen4 +
if (ioc_data->ioc_inllen1) {
l = 0;
remains = ioc_data->ioc_inllen4 +
- size_round(ioc_data->ioc_inllen1) +
- size_round(ioc_data->ioc_inllen2) +
- size_round(ioc_data->ioc_inllen3);
+
cfs_
size_round(ioc_data->ioc_inllen1) +
+
cfs_
size_round(ioc_data->ioc_inllen2) +
+
cfs_
size_round(ioc_data->ioc_inllen3);
from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
from = simple_strtol(ioc_data->ioc_inlbuf2, &endp, 0);
if (*endp != '\0')
RETURN(-EINVAL);
@@
-243,7
+244,7
@@
static int llog_remove_log(struct llog_handle *cat, struct llog_logid *logid)
int rc, index = 0;
ENTRY;
int rc, index = 0;
ENTRY;
- down_write(&cat->lgh_lock);
+
cfs_
down_write(&cat->lgh_lock);
rc = llog_cat_id2handle(cat, &log, logid);
if (rc) {
CDEBUG(D_IOCTL, "cannot find log #"LPX64"#"LPX64"#%08x\n",
rc = llog_cat_id2handle(cat, &log, logid);
if (rc) {
CDEBUG(D_IOCTL, "cannot find log #"LPX64"#"LPX64"#%08x\n",
@@
-262,7
+263,7
@@
static int llog_remove_log(struct llog_handle *cat, struct llog_logid *logid)
rc = llog_cancel_rec(cat, index);
out:
llog_free_handle(log);
rc = llog_cancel_rec(cat, index);
out:
llog_free_handle(log);
- up_write(&cat->lgh_lock);
+
cfs_
up_write(&cat->lgh_lock);
RETURN(rc);
}
RETURN(rc);
}
@@
-313,7
+314,7
@@
int llog_ioctl(struct llog_ctxt *ctxt, int cmd, struct obd_ioctl_data *data)
case OBD_IOC_LLOG_INFO: {
int l;
int remains = data->ioc_inllen2 +
case OBD_IOC_LLOG_INFO: {
int l;
int remains = data->ioc_inllen2 +
- size_round(data->ioc_inllen1);
+
cfs_
size_round(data->ioc_inllen1);
char *out = data->ioc_bulk;
l = snprintf(out, remains,
char *out = data->ioc_bulk;
l = snprintf(out, remains,
@@
-363,9
+364,9
@@
int llog_ioctl(struct llog_ctxt *ctxt, int cmd, struct obd_ioctl_data *data)
GOTO(out_close, err = -EINVAL);
if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
GOTO(out_close, err = -EINVAL);
if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
- down_write(&handle->lgh_lock);
+
cfs_
down_write(&handle->lgh_lock);
err = llog_cancel_rec(handle, cookie.lgc_index);
err = llog_cancel_rec(handle, cookie.lgc_index);
- up_write(&handle->lgh_lock);
+
cfs_
up_write(&handle->lgh_lock);
GOTO(out_close, err);
}
GOTO(out_close, err);
}
@@
-432,16
+433,14
@@
int llog_catalog_list(struct obd_device *obd, int count,
ENTRY;
size = sizeof(*idarray) * count;
ENTRY;
size = sizeof(*idarray) * count;
- OBD_ALLOC(idarray, size);
+ OBD_
VM
ALLOC(idarray, size);
if (!idarray)
RETURN(-ENOMEM);
if (!idarray)
RETURN(-ENOMEM);
- memset(idarray, 0, size);
- rc = llog_get_cat_list(obd, obd, name, count, idarray);
- if (rc) {
- OBD_FREE(idarray, size);
- RETURN(rc);
- }
+ cfs_mutex_down(&obd->obd_olg.olg_cat_processing);
+ rc = llog_get_cat_list(obd, name, 0, count, idarray);
+ if (rc)
+ GOTO(out, rc);
out = data->ioc_bulk;
remains = data->ioc_inllen1;
out = data->ioc_bulk;
remains = data->ioc_inllen1;
@@
-457,8
+456,12
@@
int llog_catalog_list(struct obd_device *obd, int count,
break;
}
}
break;
}
}
- OBD_FREE(idarray, size);
- RETURN(0);
+out:
+ /* release semaphore */
+ cfs_mutex_up(&obd->obd_olg.olg_cat_processing);
+
+ OBD_VFREE(idarray, size);
+ RETURN(rc);
}
EXPORT_SYMBOL(llog_catalog_list);
}
EXPORT_SYMBOL(llog_catalog_list);