struct lustre_handle *lockhs = NULL;
int rc, flags = 0;
+ if (sbi->ll_flags & LL_SBI_NOLCK) {
+ *lockhs_p = NULL;
+ RETURN(0);
+ }
+
OBD_ALLOC(lockhs, md->lmd_stripe_count * sizeof(*lockhs));
if (lockhs == NULL)
RETURN(-ENOMEM);
struct ll_sb_info *sbi = ll_i2sbi(inode);
int rc;
+ if (sbi->ll_flags & LL_SBI_NOLCK)
+ RETURN(0);
+
+ if (lockhs == NULL) {
+ LBUG();
+ RETURN(-EINVAL);
+ }
+
rc = obd_cancel(&sbi->ll_osc_conn, md, mode, lockhs);
if (rc != ELDLM_OK) {
CERROR("lock cancel: %d\n", rc);
ssize_t retval;
ENTRY;
- if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK)) {
+ if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
+ sbi->ll_flags & LL_SBI_NOLCK) {
OBD_ALLOC(lockhs, md->lmd_stripe_count * sizeof(*lockhs));
if (!lockhs)
RETURN(-ENOMEM);
if (retval > 0)
ll_update_atime(inode);
- if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK)) {
+ if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
+ sbi->ll_flags & LL_SBI_NOLCK) {
err = obd_cancel(&sbi->ll_osc_conn, md, LCK_PR, lockhs);
if (err != ELDLM_OK) {
CERROR("lock cancel: err: %d\n", err);
obdo_to_inode(inode, &oa, oa.o_valid);
}
- if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK)) {
+ if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
+ sbi->ll_flags & LL_SBI_NOLCK) {
OBD_ALLOC(lockhs, md->lmd_stripe_count * sizeof(*lockhs));
if (!lockhs)
GOTO(out_eof, retval = -ENOMEM);
retval = generic_file_write(file, buf, count, ppos);
- if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK)) {
+ if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK) ||
+ sbi->ll_flags & LL_SBI_NOLCK) {
err = obd_cancel(&sbi->ll_osc_conn, md, LCK_PW, lockhs);
if (err != ELDLM_OK) {
CERROR("lock cancel: err: %d\n", err);