From: nikita Date: Tue, 18 Oct 2005 19:27:26 +0000 (+0000) Subject: Forgotten chunks of 7133 patch. X-Git-Tag: v1_7_100~1^103~4^2~260^2~25 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=229c430dd90c3c6b9238b19ce794fa61db3e6ab2;p=fs%2Flustre-release.git Forgotten chunks of 7133 patch. --- diff --git a/lustre/include/linux/lustre_lite.h b/lustre/include/linux/lustre_lite.h index e6bb40b..28ee37b 100644 --- a/lustre/include/linux/lustre_lite.h +++ b/lustre/include/linux/lustre_lite.h @@ -94,6 +94,7 @@ struct lustre_rw_params { * to put it in. */ static inline void lustre_build_lock_params(int cmd, unsigned long open_flags, + __u64 connect_flags, loff_t pos, ssize_t len, struct lustre_rw_params *params) { @@ -108,21 +109,19 @@ static inline void lustre_build_lock_params(int cmd, unsigned long open_flags, if (cmd == OBD_BRW_WRITE && (open_flags & O_APPEND)) { params->lrp_policy.l_extent.start = 0; params->lrp_policy.l_extent.end = OBD_OBJECT_EOF; - } else { -#ifdef __KERNEL__ - /* - * nothing special for the kernel. In the future llite may use - * OST-side locks for small writes into highly contended - * files. - */ -#else + } else if (LIBLUSTRE_CLIENT && (connect_flags & OBD_CONNECT_SRVLOCK)) { /* * liblustre: OST-side locking for all non-O_APPEND * reads/writes. */ params->lrp_lock_mode = LCK_NL; params->lrp_brw_flags = OBD_BRW_SRVLOCK; -#endif + } else { + /* + * nothing special for the kernel. In the future llite may use + * OST-side locks for small writes into highly contended + * files. + */ } params->lrp_ast_flags = (open_flags & O_NONBLOCK) ? LDLM_FL_BLOCK_NOWAIT : 0; diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index 39a0800..5bd5642 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -586,8 +586,9 @@ ssize_t llu_file_prwv(const struct iovec *iovec, int iovlen, if (pos + len > lli->lli_maxbytes) RETURN(-ERANGE); - lustre_build_lock_params(session->lis_cmd, - lli->lli_open_flags, pos, len, &p); + lustre_build_lock_params(session->lis_cmd, lli->lli_open_flags, + lli->lli_sbi->ll_connect_flags, + pos, len, &p); iogroup = get_io_group(inode, max_io_pages(len, iovlen), &p); if (IS_ERR(iogroup))