From dan.carpenter at oracle.com Tue Aug 1 11:10:58 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Tue, 1 Aug 2017 14:10:58 +0300 Subject: [lustre-devel] [bug report] staging: lustre: lov: Ensure correct operation for large object sizes Message-ID: <20170801111058.xlmx7tmvmfkyihxh@mwanda> Hello Nathaniel Clark, The patch 476f575cf070: "staging: lustre: lov: Ensure correct operation for large object sizes" from Jul 26, 2017, leads to the following static checker warning: drivers/staging/lustre/lustre/lov/lov_ea.c:207 lsm_unpackmd_common() warn: signed overflow undefined. 'min_stripe_maxbytes * stripe_count < min_stripe_maxbytes' drivers/staging/lustre/lustre/lov/lov_ea.c 148 static int lsm_unpackmd_common(struct lov_obd *lov, 149 struct lov_stripe_md *lsm, 150 struct lov_mds_md *lmm, 151 struct lov_ost_data_v1 *objects) 152 { 153 loff_t min_stripe_maxbytes = 0; ^^^^^^ loff_t is long long. 154 unsigned int stripe_count; 155 struct lov_oinfo *loi; 156 loff_t lov_bytes; 157 unsigned int i; 158 159 /* 160 * This supposes lov_mds_md_v1/v3 first fields are 161 * are the same 162 */ 163 lmm_oi_le_to_cpu(&lsm->lsm_oi, &lmm->lmm_oi); 164 lsm->lsm_stripe_size = le32_to_cpu(lmm->lmm_stripe_size); 165 lsm->lsm_pattern = le32_to_cpu(lmm->lmm_pattern); 166 lsm->lsm_layout_gen = le16_to_cpu(lmm->lmm_layout_gen); 167 lsm->lsm_pool_name[0] = '\0'; 168 169 stripe_count = lsm_is_released(lsm) ? 0 : lsm->lsm_stripe_count; 170 171 for (i = 0; i < stripe_count; i++) { 172 loi = lsm->lsm_oinfo[i]; 173 ostid_le_to_cpu(&objects[i].l_ost_oi, &loi->loi_oi); 174 loi->loi_ost_idx = le32_to_cpu(objects[i].l_ost_idx); 175 loi->loi_ost_gen = le32_to_cpu(objects[i].l_ost_gen); 176 if (lov_oinfo_is_dummy(loi)) 177 continue; 178 179 if (loi->loi_ost_idx >= lov->desc.ld_tgt_count && 180 !lov2obd(lov)->obd_process_conf) { 181 CERROR("%s: OST index %d more than OST count %d\n", 182 (char *)lov->desc.ld_uuid.uuid, 183 loi->loi_ost_idx, lov->desc.ld_tgt_count); 184 lov_dump_lmm_v1(D_WARNING, lmm); 185 return -EINVAL; 186 } 187 188 if (!lov->lov_tgts[loi->loi_ost_idx]) { 189 CERROR("%s: OST index %d missing\n", 190 (char *)lov->desc.ld_uuid.uuid, 191 loi->loi_ost_idx); 192 lov_dump_lmm_v1(D_WARNING, lmm); 193 continue; 194 } 195 196 lov_bytes = lov_tgt_maxbytes(lov->lov_tgts[loi->loi_ost_idx]); 197 if (min_stripe_maxbytes == 0 || lov_bytes < min_stripe_maxbytes) 198 min_stripe_maxbytes = lov_bytes; 199 } 200 201 if (min_stripe_maxbytes == 0) 202 min_stripe_maxbytes = LUSTRE_EXT3_STRIPE_MAXBYTES; 203 204 stripe_count = lsm->lsm_stripe_count ?: lov->desc.ld_tgt_count; 205 lov_bytes = min_stripe_maxbytes * stripe_count; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is undefined in C. 206 207 if (lov_bytes < min_stripe_maxbytes) /* handle overflow */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ So this might be wrong. 208 lsm->lsm_maxbytes = MAX_LFS_FILESIZE; 209 else 210 lsm->lsm_maxbytes = lov_bytes; 211 212 return 0; 213 } regards, dan carpenter From cakturk at gmail.com Tue Aug 1 23:12:29 2017 From: cakturk at gmail.com (Cihangir Akturk) Date: Wed, 2 Aug 2017 02:12:29 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally Message-ID: <1501629149-6081-1-git-send-email-cakturk@gmail.com> Instead of using the locked variable as a helper to determine the state of the mutex cld->cld_lock, expand the scope of the recover_cld variable and assign to the cld->cld_recover variable depending on whether the value of the recover_cld variable is valid or not. As a bonus, code size is slightly reduced. before: text data bss dec hex filename 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o after: text data bss dec hex filename 26140 2256 4208 32604 7f5c drivers/staging/lustre/lustre/mgc/mgc_request.o Additionally silences the following warning reported by coccinelle: drivers/staging/lustre/lustre/mgc/mgc_request.c:359:2-12: second lock on line 365 Signed-off-by: Cihangir Akturk --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index eee0b66..6718474 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, struct config_llog_data *cld; struct config_llog_data *sptlrpc_cld; struct config_llog_data *params_cld; - bool locked = false; + struct config_llog_data *recover_cld = ERR_PTR(-EINVAL); char seclogname[32]; char *ptr; int rc; @@ -338,8 +338,6 @@ config_log_add(struct obd_device *obd, char *logname, LASSERT(lsi->lsi_lmd); if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { - struct config_llog_data *recover_cld; - ptr = strrchr(seclogname, '-'); if (ptr) { *ptr = 0; @@ -355,14 +353,11 @@ config_log_add(struct obd_device *obd, char *logname, rc = PTR_ERR(recover_cld); goto out_cld; } - - mutex_lock(&cld->cld_lock); - locked = true; - cld->cld_recover = recover_cld; } - if (!locked) - mutex_lock(&cld->cld_lock); + mutex_lock(&cld->cld_lock); + if (!IS_ERR(recover_cld)) + cld->cld_recover = recover_cld; cld->cld_params = params_cld; cld->cld_sptlrpc = sptlrpc_cld; mutex_unlock(&cld->cld_lock); -- 2.7.4 From neilb at suse.com Wed Aug 2 03:06:18 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:06:18 +1000 Subject: [lustre-devel] [PATCH 0/6] dcache/namei fixes for lustre Message-ID: <150164273003.13199.7841976922211510658.stgit@noble> This series is a revised version of two patches I sent previously (one of which was sadly broken). That patch has been broken into multiple parts for easy review. The other is included unchanged as the last of this series. I was drawn to look at this code due to the tests on DCACHE_DISCONNECTED which are often wrong, and it turns out they are used wrongly in lustre too. Fixing one led to some clean-up. Fixing the other is straight forward. A particular change here from the previous posting is the first patch which tests for DCACHE_PAR_LOOKUP in ll_dcompare(). Without this patch, two threads can be looking up the same name in a given directory in parallel. This parallelism lead to my concerns about needing improved locking in ll_splice_alias(). Instead of improving the locking, I now avoid the need for it by fixing ll_dcompare. This code passes basic "smoke tests". Note that the cast to "struct dentry *" in the first patch is because we have a "const struct dentry *" but d_in_lookup() requires a pointer to a non-const structure. I'll send a separate patch to change d_in_lookup(). --- NeilBrown (6): staging: lustre: llite: handle DCACHE_PAR_LOOKUP in ll_dcompare staging: lustre: llite: use d_splice_alias for directories. staging: lustre: llite: remove directory-specific code from ll_find_alias() staging: lluste: llite: simplify ll_find_alias() staging: lustre: llite: refine ll_find_alias based on d_exact_alias staging: lustre: llite: fix incorrect DCACHE_DISCONNECTED test drivers/staging/lustre/lustre/llite/dcache.c | 10 +++ .../staging/lustre/lustre/llite/llite_internal.h | 2 - drivers/staging/lustre/lustre/llite/namei.c | 60 ++++++++++---------- 3 files changed, 40 insertions(+), 32 deletions(-) -- Signature From neilb at suse.com Wed Aug 2 03:06:18 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:06:18 +1000 Subject: [lustre-devel] [PATCH 1/6] staging: lustre: llite: handle DCACHE_PAR_LOOKUP in ll_dcompare In-Reply-To: <150164273003.13199.7841976922211510658.stgit@noble> References: <150164273003.13199.7841976922211510658.stgit@noble> Message-ID: <150164317820.13199.2285361769402624601.stgit@noble> ll_dcompare is used in two slightly different contexts. It is called (from __d_lookup, __d_lookup_rcu, and d_exact_alias) to compare a name against a dentry that is already in the dcache. It is also called (from d_alloc_parallel) to compare a name against a dentry that is not in the dcache yet, but is part of an active "lookup" or "atomic_open" call. In the first case we need to avoid matching against "invalid" dentries as a match implies something about ldlm locks which is not accurate. In the second case we need to allow matching against "invalid" dentries as the dentry will always be invalid (set by ll_d_init()) but we still want to guard against multiple concurrent lookups of the same name. d_alloc_parallel() will repeat the call to ll_dcompare() after the lookup has finished, and if the dentry is still invalid, the whole d_alloc_parallel() process is repeated. This assures us that it is safe to report success whenever d_in_lookup(). With this patch, there will never be two threads concurrently in ll_lookup_nd(), looking up the same name in the same directory. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/dcache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index d20425fb8cbe..7cfe0babf99e 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -73,6 +73,12 @@ static void ll_release(struct dentry *de) * an AST before calling d_revalidate_it(). The dentry still exists (marked * INVALID) so d_lookup() matches it, but we have no lock on it (so * lock_match() fails) and we spin around real_lookup(). + * + * This race doesn't apply to lookups in d_alloc_parallel(), and for + * those we want to ensure that only one dentry with a given name is + * in ll_lookup_nd() at a time. So allow invalid dentries to match + * while d_in_lookup(). We will be called again when the lookup + * completes, and can give a different answer then. */ static int ll_dcompare(const struct dentry *dentry, unsigned int len, const char *str, @@ -92,6 +98,10 @@ static int ll_dcompare(const struct dentry *dentry, if (d_mountpoint((struct dentry *)dentry)) return 0; + /* ensure exclusion against parallel lookup of the same name */ + if (d_in_lookup((struct dentry*)dentry)) + return 0; + if (d_lustre_invalid(dentry)) return 1; From neilb at suse.com Wed Aug 2 03:06:18 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:06:18 +1000 Subject: [lustre-devel] [PATCH 2/6] staging: lustre: llite: use d_splice_alias for directories. In-Reply-To: <150164273003.13199.7841976922211510658.stgit@noble> References: <150164273003.13199.7841976922211510658.stgit@noble> Message-ID: <150164317822.13199.4133063936298364252.stgit@noble> In the Linux dcache a directory only ever has one dentry, so d_splice_alias() can be used by ll_splice_alias() for directories. It will find the one dentry whether it is DCACHE_DISCONNECTED or IS_ROOT() or d_lustre_invalid(). Separating out the directories from non-directories will allow us to simplify the non-directory code. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/namei.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index a208a8b02c2c..5ac340a8ad6f 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -432,7 +432,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) */ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) { - if (inode) { + if (inode && !S_ISDIR(inode->i_mode)) { struct dentry *new = ll_find_alias(inode, de); if (new) { @@ -443,8 +443,13 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) new, d_inode(new), d_count(new), new->d_flags); return new; } + d_add(de, inode); + } else { + struct dentry *new = d_splice_alias(inode, de); + + if (new) + de = new; } - d_add(de, inode); CDEBUG(D_DENTRY, "Add dentry %p inode %p refc %d flags %#x\n", de, d_inode(de), d_count(de), de->d_flags); return de; From neilb at suse.com Wed Aug 2 03:06:18 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:06:18 +1000 Subject: [lustre-devel] [PATCH 3/6] staging: lustre: llite: remove directory-specific code from ll_find_alias() In-Reply-To: <150164273003.13199.7841976922211510658.stgit@noble> References: <150164273003.13199.7841976922211510658.stgit@noble> Message-ID: <150164317825.13199.17532329520884202645.stgit@noble> Now that ll_find_alias() is never called for directories, we can remove code that only applies to directories. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/namei.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 5ac340a8ad6f..329038a10a07 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -378,21 +378,15 @@ void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2) } /* - * try to reuse three types of dentry: - * 1. unhashed alias, this one is unhashed by d_invalidate (but it may be valid - * by concurrent .revalidate). - * 2. INVALID alias (common case for no valid ldlm lock held, but this flag may - * be cleared by others calling d_lustre_revalidate). - * 3. DISCONNECTED alias. + * Try to reuse unhashed or invalidated dentries. */ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) { - struct dentry *alias, *discon_alias, *invalid_alias; + struct dentry *alias, *invalid_alias; if (hlist_empty(&inode->i_dentry)) return NULL; - discon_alias = NULL; invalid_alias = NULL; spin_lock(&inode->i_lock); @@ -400,22 +394,18 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) LASSERT(alias != dentry); spin_lock(&alias->d_lock); - if ((alias->d_flags & DCACHE_DISCONNECTED) && - S_ISDIR(inode->i_mode)) - /* LASSERT(last_discon == NULL); LU-405, bz 20055 */ - discon_alias = alias; - else if (alias->d_parent == dentry->d_parent && - alias->d_name.hash == dentry->d_name.hash && - alias->d_name.len == dentry->d_name.len && - memcmp(alias->d_name.name, dentry->d_name.name, - dentry->d_name.len) == 0) + if (alias->d_parent == dentry->d_parent && + alias->d_name.hash == dentry->d_name.hash && + alias->d_name.len == dentry->d_name.len && + memcmp(alias->d_name.name, dentry->d_name.name, + dentry->d_name.len) == 0) invalid_alias = alias; spin_unlock(&alias->d_lock); if (invalid_alias) break; } - alias = invalid_alias ?: discon_alias ?: NULL; + alias = invalid_alias ?: NULL; if (alias) { spin_lock(&alias->d_lock); dget_dlock(alias); From neilb at suse.com Wed Aug 2 03:06:18 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:06:18 +1000 Subject: [lustre-devel] [PATCH 4/6] staging: lluste: llite: simplify ll_find_alias() In-Reply-To: <150164273003.13199.7841976922211510658.stgit@noble> References: <150164273003.13199.7841976922211510658.stgit@noble> Message-ID: <150164317827.13199.14294676526176745668.stgit@noble> Now that ll_find_alias is only searching for one type of dentry, we can return as soon as we find it. This allows substantial simplification, and brings the bonus that we don't need to take the d_lock again just to increment the ref-count. We can increment it immediately that the dentry is found. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/namei.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 329038a10a07..51838eed501a 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -382,13 +382,11 @@ void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2) */ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) { - struct dentry *alias, *invalid_alias; + struct dentry *alias; if (hlist_empty(&inode->i_dentry)) return NULL; - invalid_alias = NULL; - spin_lock(&inode->i_lock); hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { LASSERT(alias != dentry); @@ -398,22 +396,17 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) alias->d_name.hash == dentry->d_name.hash && alias->d_name.len == dentry->d_name.len && memcmp(alias->d_name.name, dentry->d_name.name, - dentry->d_name.len) == 0) - invalid_alias = alias; - spin_unlock(&alias->d_lock); - - if (invalid_alias) - break; - } - alias = invalid_alias ?: NULL; - if (alias) { - spin_lock(&alias->d_lock); - dget_dlock(alias); + dentry->d_name.len) == 0) { + dget_dlock(alias); + spin_unlock(&alias->d_lock); + spin_unlock(&inode->i_lock); + return alias; + } spin_unlock(&alias->d_lock); } spin_unlock(&inode->i_lock); - return alias; + return NULL; } /* From neilb at suse.com Wed Aug 2 03:06:18 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:06:18 +1000 Subject: [lustre-devel] [PATCH 5/6] staging: lustre: llite: refine ll_find_alias based on d_exact_alias In-Reply-To: <150164273003.13199.7841976922211510658.stgit@noble> References: <150164273003.13199.7841976922211510658.stgit@noble> Message-ID: <150164317830.13199.7922794950934772864.stgit@noble> The task of ll_find_alias() is now very similar to d_exact_alias(). We cannot use that function directory, but we can copy much of the structure so that the similarities and differences are more obvious. Examining d_exact_alias() shows that the d_lock spinlock does not need to be held as much as it currently is. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/namei.c | 30 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 51838eed501a..8ed24ec1255d 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -379,6 +379,10 @@ void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2) /* * Try to reuse unhashed or invalidated dentries. + * This is very similar to d_exact_alias(), and any changes in one should be + * considered for inclusion in the other. The differences are that we don't + * need an unhashed alias, and we don't want d_compare to be used for + * comparison. */ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) { @@ -390,19 +394,25 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) spin_lock(&inode->i_lock); hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { LASSERT(alias != dentry); + /* + * Don't need alias->d_lock here, because aliases with + * d_parent == entry->d_parent are not subject to name or + * parent changes, because the parent inode i_mutex is held. + */ - spin_lock(&alias->d_lock); - if (alias->d_parent == dentry->d_parent && - alias->d_name.hash == dentry->d_name.hash && - alias->d_name.len == dentry->d_name.len && + if (alias->d_parent != dentry->d_parent) + continue; + if (alias->d_name.hash != dentry->d_name.hash) + continue; + if (alias->d_name.len != dentry->d_name.len || memcmp(alias->d_name.name, dentry->d_name.name, - dentry->d_name.len) == 0) { - dget_dlock(alias); - spin_unlock(&alias->d_lock); - spin_unlock(&inode->i_lock); - return alias; - } + dentry->d_name.len) != 0) + continue; + spin_lock(&alias->d_lock); + dget_dlock(alias); spin_unlock(&alias->d_lock); + spin_unlock(&inode->i_lock); + return alias; } spin_unlock(&inode->i_lock); From neilb at suse.com Wed Aug 2 03:06:18 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:06:18 +1000 Subject: [lustre-devel] [PATCH 6/6] staging: lustre: llite: fix incorrect DCACHE_DISCONNECTED test In-Reply-To: <150164273003.13199.7841976922211510658.stgit@noble> References: <150164273003.13199.7841976922211510658.stgit@noble> Message-ID: <150164317832.13199.6113390117004813683.stgit@noble> It is almost always wrong to test DCACHE_DISCONNECTED, except in "exportfs" code. The flag tells us that this dentry *might* not be connected to the root through a chain of d_parent links. Following the d_parent to an IS_ROOT() dentry *might* find one that is on the s_anon list rather than s_root. The code here needs to know if it is safe to call __d_drop(), and the correct test is "!IS_ROOT(dentry)". If an dentry IS_ROOT(), then it might be the filesystem root, or it might be the root of a DCACHE_DISCONNECTED tree, and so be on the s_anon list. In these two cases it should not be __d_drop()ed. If !IS_ROOT(), then the dentry is attached to its parent through d_subdir, and can safely be unhashed. Signed-off-by: NeilBrown --- .../staging/lustre/lustre/llite/llite_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index cd3311abf999..4854985bf4d3 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -1299,7 +1299,7 @@ static inline void d_lustre_invalidate(struct dentry *dentry, int nested) * If we unhashed such a dentry, unmount would not be able to find * it and busy inodes would be reported. */ - if (d_count(dentry) == 0 && !(dentry->d_flags & DCACHE_DISCONNECTED)) + if (d_count(dentry) == 0 && !IS_ROOT(dentry)) __d_drop(dentry); spin_unlock(&dentry->d_lock); } From neilb at suse.com Wed Aug 2 03:26:11 2017 From: neilb at suse.com (NeilBrown) Date: Wed, 02 Aug 2017 13:26:11 +1000 Subject: [lustre-devel] [PATCH] staging: lustre: fix minor typos in comments In-Reply-To: <20170719082955.GA30088@kroah.com> References: <150041997277.20736.17112251996623587423.stgit@noble> <150042040735.20736.6997246449635538567.stgit@noble> <20170719082955.GA30088@kroah.com> Message-ID: <87379aveek.fsf@notabene.neil.brown.name> Fix minor typos in comments. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/llite/namei.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 8ed24ec1255d..7a1133661a65 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -488,7 +488,7 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, *de = alias; if (!it_disposition(it, DISP_LOOKUP_NEG)) { - /* we have lookup look - unhide dentry */ + /* We have the "lookup" lock, so unhide dentry */ if (bits & MDS_INODELOCK_LOOKUP) d_lustre_revalidate(*de); } else if (!it_disposition(it, DISP_OPEN_CREATE)) { diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index 3eb66cea65db..ae97c6f1aeb0 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -1030,7 +1030,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it, * If we're performing a creation, that means that unless the creation * failed with EEXIST, we should fake up a negative dentry. * - * For everything else, we want to lookup to succeed. + * For everything else, we want the lookup to succeed. * * One additional note: if CREATE or OPEN succeeded, we add an extra * reference to the request because we need to keep it around until @@ -1040,7 +1040,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it, * exactly what it_status refers to. * * If DISP_OPEN_OPEN is set, then it_status refers to the open() call, - * otherwise if DISP_OPEN_CREATE is set, then it status is the + * otherwise if DISP_OPEN_CREATE is set, then it_status is the * creation failure mode. In either case, one of DISP_LOOKUP_NEG or * DISP_LOOKUP_POS will be set, indicating whether the child lookup * was successful. -- 2.12.2 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 832 bytes Desc: not available URL: From dan.carpenter at oracle.com Wed Aug 2 08:52:29 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Wed, 2 Aug 2017 11:52:29 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally In-Reply-To: <1501629149-6081-1-git-send-email-cakturk@gmail.com> References: <1501629149-6081-1-git-send-email-cakturk@gmail.com> Message-ID: <20170802085229.etni5p3sjf4wsx4x@mwanda> I guess that does look a bit simpler. Reviewed-by: Dan Carpenter regards, dan carpenter From bhumirks at gmail.com Thu Aug 3 09:12:48 2017 From: bhumirks at gmail.com (Bhumika Goyal) Date: Thu, 3 Aug 2017 14:42:48 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: obd: make echo_lock_ops const Message-ID: <1501751568-5662-1-git-send-email-bhumirks@gmail.com> Declare echo_lock_ops object of type cl_lock_operations as const as it is only passed to the function cl_lock_slice_add. The corresponding argument is of type const, so make the object const. Signed-off-by: Bhumika Goyal --- drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 1c4a8fe..b3fbc3c 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -319,7 +319,7 @@ static void echo_lock_fini(const struct lu_env *env, kmem_cache_free(echo_lock_kmem, ecl); } -static struct cl_lock_operations echo_lock_ops = { +static const struct cl_lock_operations echo_lock_ops = { .clo_fini = echo_lock_fini, }; -- 1.9.1 From andreas.dilger at intel.com Thu Aug 3 13:41:15 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Thu, 3 Aug 2017 13:41:15 +0000 Subject: [lustre-devel] Design proposal for client-side compression In-Reply-To: References: <1483967258.2622.24.camel@informatik.uni-hamburg.de> <1484223328.3937.60.camel@informatik.uni-hamburg.de> <1484749185.3965.114.camel@informatik.uni-hamburg.de> <1487254536.4777.51.camel@informatik.uni-hamburg.de> <1500650130.3158.6.camel@informatik.uni-hamburg.de> <1500992740.4728.5.camel@informatik.uni-hamburg.de> <1501143960.3412.3.camel@informatik.uni-hamburg.de> <1501235847.3412.12.camel@informatik.uni-hamburg.de> <1501254736.3412.16.camel@informatik.uni-hamburg.de> Message-ID: <72B5372C-E274-44AD-8C7A-FAFE988F9323@intel.com> Patrick, If you consider over-the-wire compression only, you could probably treat it the same as a crypto algorithm that decompresses the data at the server? Unfortunately, I haven't looked at either the crypto or compression code closely, but one would think that they could share a fair amount of infrastructure. Cheers, Andreas On Jul 28, 2017, at 18:53, Patrick Farrell > wrote: Ah, OK. Reading this, I understand now that your intention is to keep the data compressed on disk - I hadn't thought through the implications of that fully. There's obviously a lot of benefit from that. That said, it seems like it would be relatively straightforward to make a version of this that uncompressed the data on arrival at the server, simply unpacking that buffer before writing it to disk. (Straightforward, that is, once the actual compression/decompression code is ready...) That obviously takes more CPU on the server side and does not reduce the space required, but... If you don't mind, when you consider the performant version of the compression code to be ready for at least testing, I'd like to see the code so I can try out the on-the-wire-only compression idea. It might have significant benefits for a case of interest to me, and if it worked well, it could (long term) probably coexist with the larger on-disk compression idea. (Since who knows if we'll ever implement the whole thing for ldiskfs.) Thanks again for engaging with me on this. - Patrick ________________________________ From: Anna Fuchs > Sent: Friday, July 28, 2017 10:12:16 AM To: Patrick Farrell; Xiong, Jinshan Cc: Matthew Ahrens; Zhuravlev, Alexey; lustre-devel Subject: Re: [lustre-devel] Design proposal for client-side compression > Ah. As it turns out, much more complicated than I anticipated. > Thanks for explaining... > > I have no expertise in compression algorithms, so that I will have to > just watch from the sidelines. Good luck. > > When you are further along, I remain interested in helping out with > the Lustre side of things. > > One more question - Do you have a plan to make this work *without* > the ZFS integration as well, for those using ldiskfs? That seems > straightforward enough - compress/decompress at send and recieve time > - even if the benefits would be smaller, but not everyone (Cray, > f.x.) is using ZFS, so I'm very interested in something that would > help ldiskfs as well. (Which is not to say don't do the deeper > integration with ZFS. Just that we'd like something available for > ldiskfs too.) I fear it is also much more complicated :) At the very beginning of the project proposal we hoped we wouldn't need to touch the server so much. It turned out wrong, moreover we have to modify not only the Lustre server, but also pretty much the backend itself. We chose ZFS since it already provides a lot of infrastructure that we would need to implement completely new in ldiskfs. Since, at least for me, it is a research project, ldiskfs is out of scope. Once we proved the concept, one could re-implement the whole compression stack for ldiskfs. So it is not impossible, but not our focus for this project. Nevertheless we tried to keep our changes as far as possible not very backend specific. For example we need some additional information to be stored per compressed chunk. One possibility would be to change the block pointer of ZFS and add those fields, but I don't think anyone except of us would like the BP to be modified :) So we decided to store them as a header for every chunk. For ldiskfs, since one would need to implement everything from scratch anyway, one might not need that header, but take the required fields into account from the beginning and add them to ldiskfs' "block pointer". For that reason, we wanted to leave the compressed data "headerless" on client-side, and add the header only on the server side if the corresponding backend requires it. Well, we did it, and it even works sometimes, but it looks horrible and is really counterintuitive. We send less data from client than lands on the OST, recalculate offsets, since we add the header during receiving on server side, recalculate the sent and received sizes, shift buffers by offsets and so on. The only advantage of this approach is client's independence from backend. We decided the price is too high. So now, I will construct the chunk with the header just after compressing the data on client-side, get rid of all those offset stuff on the server. But ldiskfs will have to deal with that ZFS-motivated details. However, a light version of compression could work with smaller changes to ldiskfs, when we only allow a completely compressed or not compressed files and allow potential performance drops for broken read- ahead (due to gaps within the data). Hope it is somehow more clear now. Regards, Anna _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.dilger at intel.com Thu Aug 3 13:41:12 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Thu, 3 Aug 2017 13:41:12 +0000 Subject: [lustre-devel] HSM partial archive/restore In-Reply-To: References: Message-ID: <7B037A9A-BF93-400D-AFC1-AAD4E9B4DC97@intel.com> I've thought about partial HSM archive/restore a few times in conjunction with composite layouts. It wouldn't be too hard to create PFL/composite layouts for chunks of the file arbitrarily (e.g. every 10GB for very large files) so that the file can be restored partially or incrementally or in parallel from multiple tapes. This may also be useful for File Level Redundancy, so that the file can be resync'd in chunks if only part of the file is lost. On the Lustre side, PFL has implemented virtually all of the support needed to do this in the 2.10 release. For HSM this might involve putting the HSM archive information into the composite layout itself, so that different archive identifiers (UUIDs) can be stored for different extents of the file, or possibly different archived replica versions of the file. That would need some work, and integration with the copy tools and coordinator to be able to understand components that represent partially-restored files. Cheers, Andreas On Jul 27, 2017, at 21:16, Patrick Farrell > wrote: Hello all, There has been some prior conversation around HSM partial archive/restore (Seagate at LUG'17: http://cdn.opensfs.org/wp-content/uploads/2017/06/LUG-2017-Lustre-HSM-for-HPC-High-Speed-Distributed-Data-Mover-r1.11.pdf With complex file layouts and fallocate support being called out as requirements for enabling this. But as far as I can tell, this has not progressed to any concrete design work. Is this correct? Is there work happening somewhere I'm not aware of? If not, is there interest in starting some? Cray has interest in this, and could help drive such a project, though we would need outside assistance (particularly with design) since we have no internal expertise relating to complex layouts. Regards, - Patrick _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From paf at cray.com Thu Aug 3 15:55:07 2017 From: paf at cray.com (Patrick Farrell) Date: Thu, 3 Aug 2017 15:55:07 +0000 Subject: [lustre-devel] Design proposal for client-side compression In-Reply-To: <72B5372C-E274-44AD-8C7A-FAFE988F9323@intel.com> References: <1483967258.2622.24.camel@informatik.uni-hamburg.de> <1484223328.3937.60.camel@informatik.uni-hamburg.de> <1484749185.3965.114.camel@informatik.uni-hamburg.de> <1487254536.4777.51.camel@informatik.uni-hamburg.de> <1500650130.3158.6.camel@informatik.uni-hamburg.de> <1500992740.4728.5.camel@informatik.uni-hamburg.de> <1501143960.3412.3.camel@informatik.uni-hamburg.de> <1501235847.3412.12.camel@informatik.uni-hamburg.de> <1501254736.3412.16.camel@informatik.uni-hamburg.de> , <72B5372C-E274-44AD-8C7A-FAFE988F9323@intel.com> Message-ID: Yes, agreed. After digging in to it a bit, though, the crypto code proved harder to adjust/add to than I expected, so I've tentatively decided I'd like to piggyback off of what Anna and company do. At the very least, I would like their version of the compression algorithm, so it seemed best to wait and see what form their code takes. If it's easily tweakable to do what I'd like, then I will likely just do that. (If nothing else, I badly need to prototype this idea to see how workable it is before getting serious, so I will do that in the easiest way possible...) If their code isn't easily adjustable to this, I plan to take their improved algorithm and go back to using the crypto infrastructure (effectively adding a new crypto mode). ________________________________ From: Dilger, Andreas Sent: Thursday, August 3, 2017 8:41:15 AM To: Patrick Farrell Cc: Anna Fuchs; Xiong, Jinshan; Matthew Ahrens; Zhuravlev, Alexey; lustre-devel Subject: Re: [lustre-devel] Design proposal for client-side compression Patrick, If you consider over-the-wire compression only, you could probably treat it the same as a crypto algorithm that decompresses the data at the server? Unfortunately, I haven't looked at either the crypto or compression code closely, but one would think that they could share a fair amount of infrastructure. Cheers, Andreas On Jul 28, 2017, at 18:53, Patrick Farrell > wrote: Ah, OK. Reading this, I understand now that your intention is to keep the data compressed on disk - I hadn't thought through the implications of that fully. There's obviously a lot of benefit from that. That said, it seems like it would be relatively straightforward to make a version of this that uncompressed the data on arrival at the server, simply unpacking that buffer before writing it to disk. (Straightforward, that is, once the actual compression/decompression code is ready...) That obviously takes more CPU on the server side and does not reduce the space required, but... If you don't mind, when you consider the performant version of the compression code to be ready for at least testing, I'd like to see the code so I can try out the on-the-wire-only compression idea. It might have significant benefits for a case of interest to me, and if it worked well, it could (long term) probably coexist with the larger on-disk compression idea. (Since who knows if we'll ever implement the whole thing for ldiskfs.) Thanks again for engaging with me on this. - Patrick ________________________________ From: Anna Fuchs > Sent: Friday, July 28, 2017 10:12:16 AM To: Patrick Farrell; Xiong, Jinshan Cc: Matthew Ahrens; Zhuravlev, Alexey; lustre-devel Subject: Re: [lustre-devel] Design proposal for client-side compression > Ah. As it turns out, much more complicated than I anticipated. > Thanks for explaining... > > I have no expertise in compression algorithms, so that I will have to > just watch from the sidelines. Good luck. > > When you are further along, I remain interested in helping out with > the Lustre side of things. > > One more question - Do you have a plan to make this work *without* > the ZFS integration as well, for those using ldiskfs? That seems > straightforward enough - compress/decompress at send and recieve time > - even if the benefits would be smaller, but not everyone (Cray, > f.x.) is using ZFS, so I'm very interested in something that would > help ldiskfs as well. (Which is not to say don't do the deeper > integration with ZFS. Just that we'd like something available for > ldiskfs too.) I fear it is also much more complicated :) At the very beginning of the project proposal we hoped we wouldn't need to touch the server so much. It turned out wrong, moreover we have to modify not only the Lustre server, but also pretty much the backend itself. We chose ZFS since it already provides a lot of infrastructure that we would need to implement completely new in ldiskfs. Since, at least for me, it is a research project, ldiskfs is out of scope. Once we proved the concept, one could re-implement the whole compression stack for ldiskfs. So it is not impossible, but not our focus for this project. Nevertheless we tried to keep our changes as far as possible not very backend specific. For example we need some additional information to be stored per compressed chunk. One possibility would be to change the block pointer of ZFS and add those fields, but I don't think anyone except of us would like the BP to be modified :) So we decided to store them as a header for every chunk. For ldiskfs, since one would need to implement everything from scratch anyway, one might not need that header, but take the required fields into account from the beginning and add them to ldiskfs' "block pointer". For that reason, we wanted to leave the compressed data "headerless" on client-side, and add the header only on the server side if the corresponding backend requires it. Well, we did it, and it even works sometimes, but it looks horrible and is really counterintuitive. We send less data from client than lands on the OST, recalculate offsets, since we add the header during receiving on server side, recalculate the sent and received sizes, shift buffers by offsets and so on. The only advantage of this approach is client's independence from backend. We decided the price is too high. So now, I will construct the chunk with the header just after compressing the data on client-side, get rid of all those offset stuff on the server. But ldiskfs will have to deal with that ZFS-motivated details. However, a light version of compression could work with smaller changes to ldiskfs, when we only allow a completely compressed or not compressed files and allow potential performance drops for broken read- ahead (due to gaps within the data). Hope it is somehow more clear now. Regards, Anna _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsimmons at infradead.org Thu Aug 3 16:52:44 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 3 Aug 2017 17:52:44 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally In-Reply-To: <1501629149-6081-1-git-send-email-cakturk@gmail.com> References: <1501629149-6081-1-git-send-email-cakturk@gmail.com> Message-ID: > Instead of using the locked variable as a helper to determine the state > of the mutex cld->cld_lock, expand the scope of the recover_cld variable > and assign to the cld->cld_recover variable depending on whether the > value of the recover_cld variable is valid or not. > > As a bonus, code size is slightly reduced. > > before: > text data bss dec hex filename > 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o > > after: > text data bss dec hex filename > 26140 2256 4208 32604 7f5c drivers/staging/lustre/lustre/mgc/mgc_request.o > > Additionally silences the following warning reported by coccinelle: > > drivers/staging/lustre/lustre/mgc/mgc_request.c:359:2-12: second lock on > line 365 > > Signed-off-by: Cihangir Akturk > --- > drivers/staging/lustre/lustre/mgc/mgc_request.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c > index eee0b66..6718474 100644 > --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c > +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c > @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, > struct config_llog_data *cld; > struct config_llog_data *sptlrpc_cld; > struct config_llog_data *params_cld; > - bool locked = false; > + struct config_llog_data *recover_cld = ERR_PTR(-EINVAL); > char seclogname[32]; > char *ptr; > int rc; Why not just set it to NULL? > @@ -338,8 +338,6 @@ config_log_add(struct obd_device *obd, char *logname, > > LASSERT(lsi->lsi_lmd); > if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { > - struct config_llog_data *recover_cld; > - > ptr = strrchr(seclogname, '-'); > if (ptr) { > *ptr = 0; > @@ -355,14 +353,11 @@ config_log_add(struct obd_device *obd, char *logname, > rc = PTR_ERR(recover_cld); > goto out_cld; > } > - > - mutex_lock(&cld->cld_lock); > - locked = true; > - cld->cld_recover = recover_cld; > } > > - if (!locked) > - mutex_lock(&cld->cld_lock); > + mutex_lock(&cld->cld_lock); > + if (!IS_ERR(recover_cld)) Don't need this test if by default recover_cld = NULL. > + cld->cld_recover = recover_cld; > cld->cld_params = params_cld; > cld->cld_sptlrpc = sptlrpc_cld; > mutex_unlock(&cld->cld_lock); > -- > 2.7.4 > > _______________________________________________ > devel mailing list > devel at linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > From jsimmons at infradead.org Thu Aug 3 17:06:54 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 3 Aug 2017 18:06:54 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally In-Reply-To: References: <1501629149-6081-1-git-send-email-cakturk@gmail.com> Message-ID: > > Instead of using the locked variable as a helper to determine the state > > of the mutex cld->cld_lock, expand the scope of the recover_cld variable > > and assign to the cld->cld_recover variable depending on whether the > > value of the recover_cld variable is valid or not. > > > > As a bonus, code size is slightly reduced. > > > > before: > > text data bss dec hex filename > > 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > after: > > text data bss dec hex filename > > 26140 2256 4208 32604 7f5c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > Additionally silences the following warning reported by coccinelle: > > > > drivers/staging/lustre/lustre/mgc/mgc_request.c:359:2-12: second lock on > > line 365 > > > > Signed-off-by: Cihangir Akturk > > --- > > drivers/staging/lustre/lustre/mgc/mgc_request.c | 13 ++++--------- > > 1 file changed, 4 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > index eee0b66..6718474 100644 > > --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c > > +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, > > struct config_llog_data *cld; > > struct config_llog_data *sptlrpc_cld; > > struct config_llog_data *params_cld; > > - bool locked = false; > > + struct config_llog_data *recover_cld = ERR_PTR(-EINVAL); > > char seclogname[32]; > > char *ptr; > > int rc; > > Why not just set it to NULL? > > > @@ -338,8 +338,6 @@ config_log_add(struct obd_device *obd, char *logname, > > > > LASSERT(lsi->lsi_lmd); > > if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { > > - struct config_llog_data *recover_cld; > > - > > ptr = strrchr(seclogname, '-'); > > if (ptr) { > > *ptr = 0; > > @@ -355,14 +353,11 @@ config_log_add(struct obd_device *obd, char *logname, > > rc = PTR_ERR(recover_cld); > > goto out_cld; > > } > > - > > - mutex_lock(&cld->cld_lock); > > - locked = true; > > - cld->cld_recover = recover_cld; > > } > > > > - if (!locked) > > - mutex_lock(&cld->cld_lock); > > + mutex_lock(&cld->cld_lock); > > + if (!IS_ERR(recover_cld)) > > Don't need this test if by default recover_cld = NULL. > > > + cld->cld_recover = recover_cld; > > cld->cld_params = params_cld; > > cld->cld_sptlrpc = sptlrpc_cld; > > mutex_unlock(&cld->cld_lock); I forgot to mention another reason not to merge this patch. It could lead to future breakage by making people think it is okay to set the cld_XXXX items to ERR_PTR at the start of this function. In the cld_recover case it is last item process but if it wasn't then config_log_put(), which is called in the error path, does not test if it is a err ptr and would blow up. I have a patch that fixes this which I haven't pushed yet. That fix test if cld_XXX is NULL and returns right away. From jsimmons at infradead.org Thu Aug 3 17:26:24 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 3 Aug 2017 18:26:24 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: obd: make echo_lock_ops const In-Reply-To: <1501751568-5662-1-git-send-email-bhumirks@gmail.com> References: <1501751568-5662-1-git-send-email-bhumirks@gmail.com> Message-ID: > Declare echo_lock_ops object of type cl_lock_operations as const as it > is only passed to the function cl_lock_slice_add. The corresponding > argument is of type const, so make the object const. > Acked-by: James Simmons > Signed-off-by: Bhumika Goyal > --- > drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c > index 1c4a8fe..b3fbc3c 100644 > --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c > +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c > @@ -319,7 +319,7 @@ static void echo_lock_fini(const struct lu_env *env, > kmem_cache_free(echo_lock_kmem, ecl); > } > > -static struct cl_lock_operations echo_lock_ops = { > +static const struct cl_lock_operations echo_lock_ops = { > .clo_fini = echo_lock_fini, > }; > > -- > 1.9.1 > > From jsimmons at infradead.org Thu Aug 3 17:27:29 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 3 Aug 2017 18:27:29 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: declare fiemap_for_stripe static In-Reply-To: <1501647591-22277-1-git-send-email-dwittman@gmail.com> References: <1501647591-22277-1-git-send-email-dwittman@gmail.com> Message-ID: > Declare fiemap_for_stripe as static to fix sparse warnings: > > > warning: symbol 'fiemap_for_stripe' was not declared. Should it be > > static? Acked-by: James Simmons > Signed-off-by: David Wittman > --- > drivers/staging/lustre/lustre/lov/lov_object.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c > index 8fc0bcc..334ecb1 100644 > --- a/drivers/staging/lustre/lustre/lov/lov_object.c > +++ b/drivers/staging/lustre/lustre/lov/lov_object.c > @@ -1141,11 +1141,11 @@ struct fiemap_state { > bool fs_enough; > }; > > -int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj, > - struct lov_stripe_md *lsm, > - struct fiemap *fiemap, size_t *buflen, > - struct ll_fiemap_info_key *fmkey, int stripeno, > - struct fiemap_state *fs) > +static int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj, > + struct lov_stripe_md *lsm, > + struct fiemap *fiemap, size_t *buflen, > + struct ll_fiemap_info_key *fmkey, int stripeno, > + struct fiemap_state *fs) > { > struct cl_object *subobj; > struct lov_obd *lov = lu2lov_dev(obj->co_lu.lo_dev)->ld_lov; > -- > 2.7.4 > > _______________________________________________ > devel mailing list > devel at linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > From jsimmons at infradead.org Thu Aug 3 17:29:11 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 3 Aug 2017 18:29:11 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: fix minor typos in comments In-Reply-To: <87379aveek.fsf@notabene.neil.brown.name> References: <150041997277.20736.17112251996623587423.stgit@noble> <150042040735.20736.6997246449635538567.stgit@noble> <20170719082955.GA30088@kroah.com> <87379aveek.fsf@notabene.neil.brown.name> Message-ID: > Fix minor typos in comments. Acked-by: James Simmons > Signed-off-by: NeilBrown > --- > drivers/staging/lustre/lustre/llite/namei.c | 2 +- > drivers/staging/lustre/lustre/mdc/mdc_locks.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c > index 8ed24ec1255d..7a1133661a65 100644 > --- a/drivers/staging/lustre/lustre/llite/namei.c > +++ b/drivers/staging/lustre/lustre/llite/namei.c > @@ -488,7 +488,7 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, > *de = alias; > > if (!it_disposition(it, DISP_LOOKUP_NEG)) { > - /* we have lookup look - unhide dentry */ > + /* We have the "lookup" lock, so unhide dentry */ > if (bits & MDS_INODELOCK_LOOKUP) > d_lustre_revalidate(*de); > } else if (!it_disposition(it, DISP_OPEN_CREATE)) { > diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c > index 3eb66cea65db..ae97c6f1aeb0 100644 > --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c > +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c > @@ -1030,7 +1030,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it, > * If we're performing a creation, that means that unless the creation > * failed with EEXIST, we should fake up a negative dentry. > * > - * For everything else, we want to lookup to succeed. > + * For everything else, we want the lookup to succeed. > * > * One additional note: if CREATE or OPEN succeeded, we add an extra > * reference to the request because we need to keep it around until > @@ -1040,7 +1040,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it, > * exactly what it_status refers to. > * > * If DISP_OPEN_OPEN is set, then it_status refers to the open() call, > - * otherwise if DISP_OPEN_CREATE is set, then it status is the > + * otherwise if DISP_OPEN_CREATE is set, then it_status is the > * creation failure mode. In either case, one of DISP_LOOKUP_NEG or > * DISP_LOOKUP_POS will be set, indicating whether the child lookup > * was successful. > -- > 2.12.2 > > From cakturk at gmail.com Thu Aug 3 17:31:15 2017 From: cakturk at gmail.com (Cihangir Akturk) Date: Thu, 3 Aug 2017 20:31:15 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally In-Reply-To: References: <1501629149-6081-1-git-send-email-cakturk@gmail.com> Message-ID: <20170803173115.GA1061@mbp> On Thu, Aug 03, 2017 at 05:52:44PM +0100, James Simmons wrote: > > > Instead of using the locked variable as a helper to determine the state > > of the mutex cld->cld_lock, expand the scope of the recover_cld variable > > and assign to the cld->cld_recover variable depending on whether the > > value of the recover_cld variable is valid or not. > > > > As a bonus, code size is slightly reduced. > > > > before: > > text data bss dec hex filename > > 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > after: > > text data bss dec hex filename > > 26140 2256 4208 32604 7f5c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > Additionally silences the following warning reported by coccinelle: > > > > drivers/staging/lustre/lustre/mgc/mgc_request.c:359:2-12: second lock on > > line 365 > > > > Signed-off-by: Cihangir Akturk > > --- > > drivers/staging/lustre/lustre/mgc/mgc_request.c | 13 ++++--------- > > 1 file changed, 4 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > index eee0b66..6718474 100644 > > --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c > > +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, > > struct config_llog_data *cld; > > struct config_llog_data *sptlrpc_cld; > > struct config_llog_data *params_cld; > > - bool locked = false; > > + struct config_llog_data *recover_cld = ERR_PTR(-EINVAL); > > char seclogname[32]; > > char *ptr; > > int rc; > > Why not just set it to NULL? Hi, Because config_recover_log_add() function does not return NULL on error. And I don't think IS_ERR on NULL pointer returns true. Thanks. > > @@ -338,8 +338,6 @@ config_log_add(struct obd_device *obd, char *logname, > > > > LASSERT(lsi->lsi_lmd); > > if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { > > - struct config_llog_data *recover_cld; > > - > > ptr = strrchr(seclogname, '-'); > > if (ptr) { > > *ptr = 0; > > @@ -355,14 +353,11 @@ config_log_add(struct obd_device *obd, char *logname, > > rc = PTR_ERR(recover_cld); > > goto out_cld; > > } > > - > > - mutex_lock(&cld->cld_lock); > > - locked = true; > > - cld->cld_recover = recover_cld; > > } > > > > - if (!locked) > > - mutex_lock(&cld->cld_lock); > > + mutex_lock(&cld->cld_lock); > > + if (!IS_ERR(recover_cld)) > > Don't need this test if by default recover_cld = NULL. > > > + cld->cld_recover = recover_cld; > > cld->cld_params = params_cld; > > cld->cld_sptlrpc = sptlrpc_cld; > > mutex_unlock(&cld->cld_lock); > > -- > > 2.7.4 > > > > _______________________________________________ > > devel mailing list > > devel at linuxdriverproject.org > > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > > From dwittman at gmail.com Wed Aug 2 04:19:51 2017 From: dwittman at gmail.com (David Wittman) Date: Tue, 1 Aug 2017 23:19:51 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: declare fiemap_for_stripe static Message-ID: <1501647591-22277-1-git-send-email-dwittman@gmail.com> Declare fiemap_for_stripe as static to fix sparse warnings: > warning: symbol 'fiemap_for_stripe' was not declared. Should it be > static? Signed-off-by: David Wittman --- drivers/staging/lustre/lustre/lov/lov_object.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index 8fc0bcc..334ecb1 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -1141,11 +1141,11 @@ struct fiemap_state { bool fs_enough; }; -int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj, - struct lov_stripe_md *lsm, - struct fiemap *fiemap, size_t *buflen, - struct ll_fiemap_info_key *fmkey, int stripeno, - struct fiemap_state *fs) +static int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj, + struct lov_stripe_md *lsm, + struct fiemap *fiemap, size_t *buflen, + struct ll_fiemap_info_key *fmkey, int stripeno, + struct fiemap_state *fs) { struct cl_object *subobj; struct lov_obd *lov = lu2lov_dev(obj->co_lu.lo_dev)->ld_lov; -- 2.7.4 From cakturk at gmail.com Fri Aug 4 07:11:14 2017 From: cakturk at gmail.com (Cihangir Akturk) Date: Fri, 4 Aug 2017 10:11:14 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally In-Reply-To: <20170803173115.GA1061@mbp> References: <1501629149-6081-1-git-send-email-cakturk@gmail.com> <20170803173115.GA1061@mbp> Message-ID: <20170804071114.GA19799@yoga.localdomain> On Thu, Aug 03, 2017 at 08:31:15PM +0300, Cihangir Akturk wrote: > On Thu, Aug 03, 2017 at 05:52:44PM +0100, James Simmons wrote: > > > > > Instead of using the locked variable as a helper to determine the state > > > of the mutex cld->cld_lock, expand the scope of the recover_cld variable > > > and assign to the cld->cld_recover variable depending on whether the > > > value of the recover_cld variable is valid or not. > > > > > > As a bonus, code size is slightly reduced. > > > > > > before: > > > text data bss dec hex filename > > > 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > > > after: > > > text data bss dec hex filename > > > 26140 2256 4208 32604 7f5c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > > > Additionally silences the following warning reported by coccinelle: > > > > > > drivers/staging/lustre/lustre/mgc/mgc_request.c:359:2-12: second lock on > > > line 365 > > > > > > Signed-off-by: Cihangir Akturk > > > --- > > > drivers/staging/lustre/lustre/mgc/mgc_request.c | 13 ++++--------- > > > 1 file changed, 4 insertions(+), 9 deletions(-) > > > > > > diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > > index eee0b66..6718474 100644 > > > --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c > > > +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > > @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, > > > struct config_llog_data *cld; > > > struct config_llog_data *sptlrpc_cld; > > > struct config_llog_data *params_cld; > > > - bool locked = false; > > > + struct config_llog_data *recover_cld = ERR_PTR(-EINVAL); > > > char seclogname[32]; > > > char *ptr; > > > int rc; > > > > Why not just set it to NULL? > > Hi, > > Because config_recover_log_add() function does not return NULL on > error. And I don't think IS_ERR on NULL pointer returns true. Sorry, I've just realized I was wrong. Setting it to null makes perfect sense. Thanks. > > Thanks. > > > > @@ -338,8 +338,6 @@ config_log_add(struct obd_device *obd, char *logname, > > > > > > LASSERT(lsi->lsi_lmd); > > > if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { > > > - struct config_llog_data *recover_cld; > > > - > > > ptr = strrchr(seclogname, '-'); > > > if (ptr) { > > > *ptr = 0; > > > @@ -355,14 +353,11 @@ config_log_add(struct obd_device *obd, char *logname, > > > rc = PTR_ERR(recover_cld); > > > goto out_cld; > > > } > > > - > > > - mutex_lock(&cld->cld_lock); > > > - locked = true; > > > - cld->cld_recover = recover_cld; > > > } > > > > > > - if (!locked) > > > - mutex_lock(&cld->cld_lock); > > > + mutex_lock(&cld->cld_lock); > > > + if (!IS_ERR(recover_cld)) > > > > Don't need this test if by default recover_cld = NULL. > > > > > + cld->cld_recover = recover_cld; > > > cld->cld_params = params_cld; > > > cld->cld_sptlrpc = sptlrpc_cld; > > > mutex_unlock(&cld->cld_lock); > > > -- > > > 2.7.4 > > > > > > _______________________________________________ > > > devel mailing list > > > devel at linuxdriverproject.org > > > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > > > From oleg.drokin at intel.com Fri Aug 4 23:01:38 2017 From: oleg.drokin at intel.com (Oleg Drokin) Date: Fri, 4 Aug 2017 19:01:38 -0400 Subject: [lustre-devel] New tag 2.10.51 Message-ID: <9C643E57-9229-463B-B6C4-0466DC9726CB@intel.com> Hello! I tagged 2.10.51 in the master branch of the current community tree recently. The changelog is below. Additionally I am improving visibility into the landing process. You might have noticed there's a new branch master-next, this will contain patches currently undergoing integration testing for the next landing opportunity. Assuming all is well they would be landed. The branch is going to be rebased as needed to remove defective patches or to add new ones. Additional testing by all interested parties is welcome, that way we can preemptively find problems before they make it to the master branch making the tip of master branch more stable at all times. Alex Zhuravlev (2): LU-9305 osd: do not release pages twice LU-9683 ptlrpc: fix argument misorder Amir Shehata (2): LU-9729 lnet: correct locking in legacy add net LU-9203 lnet: fix lnet_cpt_of_md() Andreas Dilger (7): LU-9715 libcfs: crash in cpu_pattern parsing code LU-7631 tests: wait_osts_up waits for MDS precreates LU-9153 llog: consolidate common error checking LU-282 tests: remove extra logging from sanity 27 LU-9728 osd: use GFP_HIGHUSER for non-local IO LU-6051 utils: allow lfs_migrate to migrate links LU-7589 build: update checkpatch to ~4.13-rc1 kernel Andrew Perepechko (2): LU-9417 mdc: excessive memory consumption by the xattr cache LU-9716 osc: osc_extent_tree_dump0() implementation is suboptimal Andriy Skulysh (1): LU-6436 llite: NULL pointer dereference in cl_object_top() Arshad Hussain (1): LU-8885 tests: zconf_mount_clients() defect Bob Glossman (4): LU-9738 kernel: kernel update RHEL7.3 [3.10.0-514.26.2.el7] LU-9712 kernel: kernel update [SLES11 SP4 3.0.101-107] LU-9763 kernel: kernel update RHEL6.9 [2.6.32-696.6.3.el6] LU-9773 kernel: kernel update [SLES12 SP2 4.4.74-92.29] Bobi Jam (1): LU-3719 ldiskfs: adjust s_mb_prealloc_table_size correctly Brian J. Murrell (3): LU-9775 Look for kernel-devel in /usr/src/kernels LU-9731 kmods need to be limited to EL minor release kernel LU-9776 lustre-client cannot be installed if both client and server repos are configured Dmitry Eremin (4): LU-8703 libcfs: change CPT estimate algorithm LU-9183 llite: add support set_acl method in inode operations LU-9769 lnet: Fix lost lock LU-9439 scripts: add lnet script in .gitignore Doug Oucharek (1): LU-9500 lnd: Don't Page Align remote_addr with FastReg Emoly Liu (3): LU-9505 llapi: treat MDT index as a hex number LU-9657 llapi: check if the file layout is composite LU-9750 nrs: some code cleanup in NRS policies Fan Yong (7): LU-9514 ptlrpc: free reply buffer earlier for open RPC LU-9740 ldiskfs: more credits for non-append write LU-9753 ofd: 64-bits diff variable to avoid overflow LU-9545 lfsck: report "inconsistent" under dryrun mode LU-8760 lib: avoid unexpected out of order execution LU-7991 osd-zfs: remove obsolete quota code LU-9710 utils: adjust barrier_stat input/output Frank Zago (2): LU-7988 hsm: mark the cdt as stopped when its thread exits LU-7988 hsm: run HSM coordinator once per second at most Jadhav Vikram (5): LU-9219 tests: add missing mgs reformat to conf-sanity/56 LU-9511 utils: fix parallel_grouplock test timeout LU-9509 tests: fix compilebench timeout LU-9620 lod: protected ost pool count updation LU-9620 tests: test race between pool_list and pool_remove James Simmons (8): LU-6142 selftest: remove typedefs from lnet selftest LU-9183 llite: handle xattr with the xattr_handler infrastructure LU-9558 lnet: kernel socket accept takes new bool agrument LU-9019 target: migrate to 64 bit time LU-9019 lfsck: migrate to 64 bit time LU-9019 obdclass: migrate jobstats to 64 bit time LU-9558 llite: handle struct vm_operations changes LU-9558 llite: user enhanced getattr functionality in newer kernels Jian Yu (1): LU-9663 tests: replace “ls -s” with “stat -c '%s'” to get file size Jinshan Xiong (1): LU-7372 mgs: reprocess all locks at device fini Lai Siyao (3): LU-5106 statahead: support striped directory LU-5106 readdir: improve striped readdir LU-8935 ptlrpc: missing barrier before wake_up Li Xi (1): LU-9654 mdt: fix problem of RAoLU HSM policy Martin Schroeder (1): LU-9564 build: Add server-build for Ubuntu with Kernel 4.4.0 Mikhal Pershin (2): LU-3285 osc: prepare OSC code to be used from MDC LU-9184 ldlm: selective IBITS lock trying Nathaniel Clark (3): LU-6671 wireshark: Process mds_md entries LU-9772 utils: Enable new ZFS MMP on mkfs LU-4536 tests: Re-enable sanity/65ic Niu Yawei (4): LU-9274 ptlrpc: add replay request into unreplied list LU-9671 nodemap: restore client's IDs for OST_WRITE LU-9725 lwp: wait on deregister LU-7544 doc: improve setquota man page Oleg Drokin (4): LU-8066 obdclass : Add infrastructure for procfs to sysfs migration LU-8066 ptlrpc: migrate ptlrpc proc files to sysfs Revert "LU-9564 build: Add server-build for Ubuntu with Kernel 4.4.0" New tag 2.10.51 Parinay Kondekar (2): LU-7653 tests: replay-single/110f fails for mdts on same MDS LU-7129 tests: fsx with directio Patrick Farrell (3): LU-9749 llite: Reduce overhead for ll_do_fast_read LU-8346 obdclass: Set lc_version LU-9778 llite: Read ahead should return pages read Qian Yingjin (1): LU-8849 ofd: Client hanges on ladvise with large start values Quentin Bouget (1): LU-9345 tests: use hsm_remove with --mntpath for deleted files Rahul Deshmkuh (1): LU-9104 obd: Ignore unknown config param while mounting Saurabh Tandan (1): LU-9693 tests: Adding sanity test_42a & 42c to always_except Sebastien Buisson (2): LU-9220 gss: support Kerberos auth from unprivileged container LU-7760 ptlrpc: remove incorrect pid printing Sergey Cheremencev (1): LU-9442 osp: can't create IDIF fid number > 0xFFFFFFFF Steve Guminski (28): LU-6210 utils: Use C99 struct initializers in lfs_find() LU-6210 utils: Use C99 struct initializers in lfs_mv() LU-6210 utils: Use C99 struct initializers in mntdf() LU-6210 utils: Use C99 struct initializers in lfs_fid2path() LU-6210 utils: Use C99 struct initializers in lfs_hsm_state() LU-6210 utils: Use C99 initializers in lfs_get_ladvice() LU-6210 utils: Use C99 struct initializers in llverfs.c LU-6210 utils: Use C99 struct initializers in lr_reader.c LU-6210 utils: Use C99 struct initializers in lshowmount.c LU-6210 utils: Use C99 struct initializers in lustre_fsck.c LU-6210 utils: Use C99 initializer for lfsck_types_names LU-6210 utils: Use consistent naming for option strings LU-6210 utils: Use C99 struct initializer in lustre_rsync.c LU-6210 utils: Use C99 struct initializer in mkfs_lustre.c LU-6210 utils: Use C99 struct initializer for opt_map LU-6210 utils: Use C99 struct initializer in parse_opts() LU-6210 utils: Use C99 struct initializer for long_opt_start LU-6210 utils: Use C99 initializers in lfs_getstripe_internal LU-6210 utils: Use C99 struct initializers in lfs_setquota() LU-6210 utils: Use C99 struct initializers in lfs_hsm_request() LU-6210 utils: Use C99 initializer in jt_obd_md_common() LU-6210 utils: C99 initializer in llog_cancel_parse_optional() LU-6210 utils: Use C99 initializer in jt_nodemap_add_range() LU-6210 utils: Use C99 initializer in jt_nodemap_set_fileset() LU-6210 utils: Use C99 initializer in jt_nodemap_modify() LU-6210 utils: Use C99 initializer in jt_nodemap_add_idmap() LU-6210 utils: Use C99 initializer in jt_nodemap_del_idmap() LU-6210 utils: Use C99 struct initializer in mount_utils_zfs.c Vitaly Fertman (1): LU-8062 ptlrpc: increase sleep time in ptlrpc_request_bufs_pack() Wang Shilong (1): LU-9733 obd: fix fsname parsing From cakturk at gmail.com Mon Aug 7 10:43:00 2017 From: cakturk at gmail.com (Cihangir Akturk) Date: Mon, 7 Aug 2017 13:43:00 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: mgc: fix potential use after free in error path Message-ID: <1502102580-29556-1-git-send-email-cakturk@gmail.com> The config_log_add() function first calls config_log_put() with the variable 'cld' and then jumps to label 'out_cld', which will call the same function with the same 'cld' variable. However, at this point, 'cld' might have been already freed by the first invocation of config_log_put(). Even if we remove the invocation at that point, we will still get into trouble. This is because, in the error path, just below the label 'out_cld', we try to put 'params_cls' and 'sptlrpc_cld', which might also have been freed by config_log_put(). The point is that, config_llog_data::cld_sptlrpc and config_llog_data::cld_params members are assigned at the beginning of this function. To avoid this, do not call config_log_put() inside the else block, immediately jump to 'out_cld' instead. Moreover, remove assignments to config_llog_data::cld_sptlrpc and config_llog_data::cld_params at the beginning, since we already assign them below in the function with 'cld_lock' held. As an additional benefit, code size gets smaller. before: text data bss dec hex filename 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o after: text data bss dec hex filename 26092 2256 4208 32556 7f2c drivers/staging/lustre/lustre/mgc/mgc_request.o Signed-off-by: Cihangir Akturk --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index eee0b66..36c3049 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, struct config_llog_data *cld; struct config_llog_data *sptlrpc_cld; struct config_llog_data *params_cld; - bool locked = false; + struct config_llog_data *recover_cld = NULL; char seclogname[32]; char *ptr; int rc; @@ -333,20 +333,14 @@ config_log_add(struct obd_device *obd, char *logname, goto out_params; } - cld->cld_sptlrpc = sptlrpc_cld; - cld->cld_params = params_cld; - LASSERT(lsi->lsi_lmd); if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { - struct config_llog_data *recover_cld; - ptr = strrchr(seclogname, '-'); if (ptr) { *ptr = 0; } else { CERROR("%s: sptlrpc log name not correct, %s: rc = %d\n", obd->obd_name, seclogname, -EINVAL); - config_log_put(cld); rc = -EINVAL; goto out_cld; } @@ -355,14 +349,10 @@ config_log_add(struct obd_device *obd, char *logname, rc = PTR_ERR(recover_cld); goto out_cld; } - - mutex_lock(&cld->cld_lock); - locked = true; - cld->cld_recover = recover_cld; } - if (!locked) - mutex_lock(&cld->cld_lock); + mutex_lock(&cld->cld_lock); + cld->cld_recover = recover_cld; cld->cld_params = params_cld; cld->cld_sptlrpc = sptlrpc_cld; mutex_unlock(&cld->cld_lock); -- 2.7.4 From jsimmons at infradead.org Mon Aug 14 14:58:57 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 15:58:57 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: lnet: fix incorrect arguments order calling lstcon_session_new In-Reply-To: <20170719162036.21621-1-colin.king@canonical.com> References: <20170719162036.21621-1-colin.king@canonical.com> Message-ID: > From: Colin Ian King > > The arguments args->lstio_ses_force and args->lstio_ses_timeout are > in the incorrect order. Fix this by swapping them around. > > Detected by CoverityScan, CID#1226833 ("Arguments in wrong order") This patch is being tracked under https://jira.hpdd.intel.com/browse/LU-9869 I pushed the patch into our main test framework which passed testing. Just waiting for reviews. Thank you. > Signed-off-by: Colin Ian King > --- > drivers/staging/lustre/lnet/selftest/conctl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c > index 6ca7192b03b7..043eafb5ea40 100644 > --- a/drivers/staging/lustre/lnet/selftest/conctl.c > +++ b/drivers/staging/lustre/lnet/selftest/conctl.c > @@ -69,8 +69,8 @@ lst_session_new_ioctl(struct lstio_session_new_args *args) > rc = lstcon_session_new(name, > args->lstio_ses_key, > args->lstio_ses_feats, > - args->lstio_ses_force, > args->lstio_ses_timeout, > + args->lstio_ses_force, > args->lstio_ses_idp); > > LIBCFS_FREE(name, args->lstio_ses_nmlen + 1); > -- > 2.11.0 > > From jsimmons at infradead.org Mon Aug 14 15:01:17 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 16:01:17 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: lustre: Off by two in lmv_fid2path() In-Reply-To: <20170728144227.uml3x27mqug3ciox@mwanda> References: <20170728144227.uml3x27mqug3ciox@mwanda> Message-ID: > We want to concatonate join string one, a '/' character, string two and > then a NUL terminator. The destination buffer holds ori_gf->gf_pathlen > characters. The strlen() function returns the number of characters not > counting the NUL terminator. So we should be adding two extra spaces, > one for the foward slash and one for the NUL. > > Signed-off-by: Dan Carpenter > --- > Not tested. Please review this one carefully. This is a real bug which is impacting users. The bug is being tracked at https://jira.hpdd.intel.com/browse/LU-9863. It passed our test suite and its being reviewed. > diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c > index 64fcaef0bacd..70c58291814d 100644 > --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c > +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c > @@ -657,8 +657,8 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg, > char *ptr; > > ori_gf = karg; > - if (strlen(ori_gf->gf_path) + > - strlen(gf->gf_path) > ori_gf->gf_pathlen) { > + if (strlen(ori_gf->gf_path) + 1 + > + strlen(gf->gf_path) + 1 > ori_gf->gf_pathlen) { > rc = -EOVERFLOW; > goto out_fid2path; > } > From jsimmons at infradead.org Mon Aug 14 15:09:34 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 16:09:34 +0100 (BST) Subject: [lustre-devel] [bug report] staging: lustre: lov: Ensure correct operation for large object sizes In-Reply-To: <20170801111058.xlmx7tmvmfkyihxh@mwanda> References: <20170801111058.xlmx7tmvmfkyihxh@mwanda> Message-ID: > Hello Nathaniel Clark, > > The patch 476f575cf070: "staging: lustre: lov: Ensure correct > operation for large object sizes" from Jul 26, 2017, leads to the > following static checker warning: > > drivers/staging/lustre/lustre/lov/lov_ea.c:207 lsm_unpackmd_common() > warn: signed overflow undefined. 'min_stripe_maxbytes * stripe_count < min_stripe_maxbytes' > > drivers/staging/lustre/lustre/lov/lov_ea.c > 148 static int lsm_unpackmd_common(struct lov_obd *lov, > 149 struct lov_stripe_md *lsm, > 150 struct lov_mds_md *lmm, > 151 struct lov_ost_data_v1 *objects) > 152 { > 153 loff_t min_stripe_maxbytes = 0; > ^^^^^^ > loff_t is long long. > > 154 unsigned int stripe_count; > 155 struct lov_oinfo *loi; > 156 loff_t lov_bytes; > 157 unsigned int i; > 158 > 159 /* > 160 * This supposes lov_mds_md_v1/v3 first fields are > 161 * are the same > 162 */ > 163 lmm_oi_le_to_cpu(&lsm->lsm_oi, &lmm->lmm_oi); > 164 lsm->lsm_stripe_size = le32_to_cpu(lmm->lmm_stripe_size); > 165 lsm->lsm_pattern = le32_to_cpu(lmm->lmm_pattern); > 166 lsm->lsm_layout_gen = le16_to_cpu(lmm->lmm_layout_gen); > 167 lsm->lsm_pool_name[0] = '\0'; > 168 > 169 stripe_count = lsm_is_released(lsm) ? 0 : lsm->lsm_stripe_count; > 170 > 171 for (i = 0; i < stripe_count; i++) { > 172 loi = lsm->lsm_oinfo[i]; > 173 ostid_le_to_cpu(&objects[i].l_ost_oi, &loi->loi_oi); > 174 loi->loi_ost_idx = le32_to_cpu(objects[i].l_ost_idx); > 175 loi->loi_ost_gen = le32_to_cpu(objects[i].l_ost_gen); > 176 if (lov_oinfo_is_dummy(loi)) > 177 continue; > 178 > 179 if (loi->loi_ost_idx >= lov->desc.ld_tgt_count && > 180 !lov2obd(lov)->obd_process_conf) { > 181 CERROR("%s: OST index %d more than OST count %d\n", > 182 (char *)lov->desc.ld_uuid.uuid, > 183 loi->loi_ost_idx, lov->desc.ld_tgt_count); > 184 lov_dump_lmm_v1(D_WARNING, lmm); > 185 return -EINVAL; > 186 } > 187 > 188 if (!lov->lov_tgts[loi->loi_ost_idx]) { > 189 CERROR("%s: OST index %d missing\n", > 190 (char *)lov->desc.ld_uuid.uuid, > 191 loi->loi_ost_idx); > 192 lov_dump_lmm_v1(D_WARNING, lmm); > 193 continue; > 194 } > 195 > 196 lov_bytes = lov_tgt_maxbytes(lov->lov_tgts[loi->loi_ost_idx]); > 197 if (min_stripe_maxbytes == 0 || lov_bytes < min_stripe_maxbytes) > 198 min_stripe_maxbytes = lov_bytes; > 199 } > 200 > 201 if (min_stripe_maxbytes == 0) > 202 min_stripe_maxbytes = LUSTRE_EXT3_STRIPE_MAXBYTES; > 203 > 204 stripe_count = lsm->lsm_stripe_count ?: lov->desc.ld_tgt_count; > 205 lov_bytes = min_stripe_maxbytes * stripe_count; > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > This is undefined in C. > > 206 > 207 if (lov_bytes < min_stripe_maxbytes) /* handle overflow */ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > So this might be wrong. > > 208 lsm->lsm_maxbytes = MAX_LFS_FILESIZE; > 209 else > 210 lsm->lsm_maxbytes = lov_bytes; > 211 > 212 return 0; > 213 } Dan what exact command did you use to find this bug? We do use smatch to find these kinds of issues before patches land but some how we are missing this class from time to time. Just to let you know the bug is being tracked under https://jira.hpdd.intel.com/browse/LU-9862 We do have a patch as well under going testing and review. From jsimmons at infradead.org Mon Aug 14 15:22:11 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 16:22:11 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally In-Reply-To: <20170804071114.GA19799@yoga.localdomain> References: <1501629149-6081-1-git-send-email-cakturk@gmail.com> <20170803173115.GA1061@mbp> <20170804071114.GA19799@yoga.localdomain> Message-ID: > On Thu, Aug 03, 2017 at 08:31:15PM +0300, Cihangir Akturk wrote: > > On Thu, Aug 03, 2017 at 05:52:44PM +0100, James Simmons wrote: > > > > > > > Instead of using the locked variable as a helper to determine the state > > > > of the mutex cld->cld_lock, expand the scope of the recover_cld variable > > > > and assign to the cld->cld_recover variable depending on whether the > > > > value of the recover_cld variable is valid or not. > > > > > > > > As a bonus, code size is slightly reduced. > > > > > > > > before: > > > > text data bss dec hex filename > > > > 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > > > > > after: > > > > text data bss dec hex filename > > > > 26140 2256 4208 32604 7f5c drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > > > > > Additionally silences the following warning reported by coccinelle: > > > > > > > > drivers/staging/lustre/lustre/mgc/mgc_request.c:359:2-12: second lock on > > > > line 365 > > > > > > > > Signed-off-by: Cihangir Akturk > > > > --- > > > > drivers/staging/lustre/lustre/mgc/mgc_request.c | 13 ++++--------- > > > > 1 file changed, 4 insertions(+), 9 deletions(-) > > > > > > > > diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > > > index eee0b66..6718474 100644 > > > > --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c > > > > +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c > > > > @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, > > > > struct config_llog_data *cld; > > > > struct config_llog_data *sptlrpc_cld; > > > > struct config_llog_data *params_cld; > > > > - bool locked = false; > > > > + struct config_llog_data *recover_cld = ERR_PTR(-EINVAL); > > > > char seclogname[32]; > > > > char *ptr; > > > > int rc; > > > > > > Why not just set it to NULL? > > > > Hi, > > > > Because config_recover_log_add() function does not return NULL on > > error. And I don't think IS_ERR on NULL pointer returns true. > > Sorry, I've just realized I was wrong. Setting it to null makes > perfect sense. Setting it to NULL in this case is correct but you did point out a bug that exist in our newer code. Currently I have a patch that fixes config_log_put() so it return if its NULL but is doesn't check if its a ERR_PTR. I updated a patch I have with this fix so thank you for pointing it out. > > > > Thanks. > > > > > > @@ -338,8 +338,6 @@ config_log_add(struct obd_device *obd, char *logname, > > > > > > > > LASSERT(lsi->lsi_lmd); > > > > if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { > > > > - struct config_llog_data *recover_cld; > > > > - > > > > ptr = strrchr(seclogname, '-'); > > > > if (ptr) { > > > > *ptr = 0; > > > > @@ -355,14 +353,11 @@ config_log_add(struct obd_device *obd, char *logname, > > > > rc = PTR_ERR(recover_cld); > > > > goto out_cld; > > > > } > > > > - > > > > - mutex_lock(&cld->cld_lock); > > > > - locked = true; > > > > - cld->cld_recover = recover_cld; > > > > } > > > > > > > > - if (!locked) > > > > - mutex_lock(&cld->cld_lock); > > > > + mutex_lock(&cld->cld_lock); > > > > + if (!IS_ERR(recover_cld)) > > > > > > Don't need this test if by default recover_cld = NULL. > > > > > > > + cld->cld_recover = recover_cld; > > > > cld->cld_params = params_cld; > > > > cld->cld_sptlrpc = sptlrpc_cld; > > > > mutex_unlock(&cld->cld_lock); > > > > -- > > > > 2.7.4 > > > > > > > > _______________________________________________ > > > > devel mailing list > > > > devel at linuxdriverproject.org > > > > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > > > > > From jsimmons at infradead.org Mon Aug 14 15:25:03 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 16:25:03 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: mgc: fix potential use after free in error path In-Reply-To: <1502102580-29556-1-git-send-email-cakturk@gmail.com> References: <1502102580-29556-1-git-send-email-cakturk@gmail.com> Message-ID: On Mon, 7 Aug 2017, Cihangir Akturk wrote: > The config_log_add() function first calls config_log_put() with the > variable 'cld' and then jumps to label 'out_cld', which will call > the same function with the same 'cld' variable. However, at this > point, 'cld' might have been already freed by the first invocation > of config_log_put(). Even if we remove the invocation at that point, > we will still get into trouble. This is because, in the error path, > just below the label 'out_cld', we try to put 'params_cls' and > 'sptlrpc_cld', which might also have been freed by config_log_put(). > > The point is that, config_llog_data::cld_sptlrpc and > config_llog_data::cld_params members are assigned at the beginning > of this function. > > To avoid this, do not call config_log_put() inside the else block, > immediately jump to 'out_cld' instead. Moreover, remove assignments > to config_llog_data::cld_sptlrpc and config_llog_data::cld_params at > the beginning, since we already assign them below in the function > with 'cld_lock' held. > > As an additional benefit, code size gets smaller. > > before: > text data bss dec hex filename > 26188 2256 4208 32652 7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o > > after: > text data bss dec hex filename > 26092 2256 4208 32556 7f2c drivers/staging/lustre/lustre/mgc/mgc_request.o > > Signed-off-by: Cihangir Akturk > --- > drivers/staging/lustre/lustre/mgc/mgc_request.c | 16 +++------------- > 1 file changed, 3 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c > index eee0b66..36c3049 100644 > --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c > +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c > @@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname, > struct config_llog_data *cld; > struct config_llog_data *sptlrpc_cld; > struct config_llog_data *params_cld; > - bool locked = false; > + struct config_llog_data *recover_cld = NULL; > char seclogname[32]; > char *ptr; > int rc; > @@ -333,20 +333,14 @@ config_log_add(struct obd_device *obd, char *logname, > goto out_params; > } > > - cld->cld_sptlrpc = sptlrpc_cld; > - cld->cld_params = params_cld; > - > LASSERT(lsi->lsi_lmd); > if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) { > - struct config_llog_data *recover_cld; > - > ptr = strrchr(seclogname, '-'); > if (ptr) { > *ptr = 0; > } else { > CERROR("%s: sptlrpc log name not correct, %s: rc = %d\n", > obd->obd_name, seclogname, -EINVAL); > - config_log_put(cld); > rc = -EINVAL; > goto out_cld; > } > @@ -355,14 +349,10 @@ config_log_add(struct obd_device *obd, char *logname, > rc = PTR_ERR(recover_cld); > goto out_cld; > } > - > - mutex_lock(&cld->cld_lock); > - locked = true; > - cld->cld_recover = recover_cld; > } > > - if (!locked) > - mutex_lock(&cld->cld_lock); > + mutex_lock(&cld->cld_lock); > + cld->cld_recover = recover_cld; > cld->cld_params = params_cld; > cld->cld_sptlrpc = sptlrpc_cld; > mutex_unlock(&cld->cld_lock); > -- > 2.7.4 Reviewed-by: James Simmons From jsimmons at infradead.org Mon Aug 14 15:46:28 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:28 -0400 Subject: [lustre-devel] [PATCH 00/64] staging: lustre: uapi: normalize the lustre headers Message-ID: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> The headers for lustre/LNet for a long time lacked a clean separation in its internal headers which resulted in kernel specific data structures being exposed in user land code. This work unravels this mess and creates a clear separation between lustre kernel space and lustre user land. With this work done the include paths in the lustre kernel code can now be normalized. Ben Evans (4): staging: lustre: uapi: Move functions out of lustre_idl.h staging: lustre: uapi: return error code for ostid_set_id staging: lustre: uapi: update URL doc link in lustre_fid.h staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h James Simmons (60): staging: lustre: uapi: remove unused functions for lustre_fid.h staging: lustre: uapi: remove unused function in lustre_disk.h staging: lustre: uapi: remove userland version of obd_ioctl_*() staging: lustre: uapi: remove obd_ioctl_freedata() wrapper staging: lustre: uapi: remove obd_ioctl_popdata() wrapper staging: lustre: uapi: move obd_ioctl_getdata() declaration staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c staging: lustre: uapi: move lustre_ioctl.h to uapi directory staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h staging: lustre: uapi: cleanup headers for lustre_ioctl.h staging: lustre: uapi: label lustre_ioctl.h as a UAPI header staging: lustre: uapi: move kernel only prototypes out of lustre_param.h staging: lustre: uapi: remove included headers out of lustre_param.h staging: lustre: uapi: move lustre_param.h to uapi directory staging: lustre: uapi: label lustre_param.h as an uapi header staging: lustre: uapi: style cleanups for lustre_param.h staging: lustre: uapi: remove lustre_cfg_free wrapper staging: lustre: uapi: don't memory allocate in UAPI header staging: lustre: uapi: move lustre_cfg_string() to obd_config.c staging: lustre: obdclass: no need to check for kfree staging: lustre: uapi: move lustre_cfg.h to uapi directory staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h staging: lustre: uapi: change variable type to match staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL staging: lustre: uapi: style cleanup of lustre_cfg.h staging: lustre: uapi: label lustre_cfg.h as an uapi header staging: lustre: libcfs: remove htonl hack in libcfs.h staging: lustre: libcfs: remove LOGL and LOGU macros staging: lustre: libcfs: create libcfs_debug.h UAPI header staging: lustre: socklnd: create socklnd.h UAPI header staging: lustre: lnet: delete lnet.h staging: lustre: lnet: migrate headers to lnet uapi directory staging: lustre: libcfs: sort headers in libcfs.h staging: lustre: lnet: remove userland function prototype in lnetctl.h staging: lustre: lnet: remove BIT macro from lnetctl.h staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h staging: lustre: uapi: migrate remaining uapi headers to uapi directory staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL staging: lustre: uapi: use proper byteorder functions in lustre_idl.h staging: lustre: uapi: remove BIT macro from UAPI headers staging: lustre: fid: add include path to Makefile staging: lustre: fld: add include path to Makefile staging: lustre: ptlrpc: add include path to Makefile staging: lustre: llite: add include path to Makefile staging: lustre: lmv: add include path to Makefile staging: lustre: lov: add include path to Makefile staging: lustre: mdc: add include path to Makefile staging: lustre: mgc: add include path to Makefile staging: lustre: obdclass: add include path to Makefile staging: lustre: obdecho: add include path to Makefile staging: lustre: osc: add include path to Makefile staging: lustre: lustre: cleanup paths for lustre internal headers staging: lustre: lustre: cleanup paths for lustre UAPI headers staging: lustre: lnet: selftest: add include path to Makefile staging: lustre: lnet: add include path to Makefile staging: lustre: ko2iblnd: add include path to Makefile staging: lustre: ksocklnd: add include path to Makefile staging: lustre: libcfs: add include path to Makefile staging: lustre: libcfs: cleanup paths for libcfs headers staging: lustre: lnet: cleanup paths for all LNet headers .../staging/lustre/include/linux/libcfs/libcfs.h | 28 +- .../lustre/include/linux/libcfs/libcfs_debug.h | 104 +--- .../lustre/include/linux/libcfs/libcfs_private.h | 26 - drivers/staging/lustre/include/linux/lnet/api.h | 2 +- .../staging/lustre/include/linux/lnet/lib-lnet.h | 12 +- .../staging/lustre/include/linux/lnet/lib-types.h | 4 +- .../staging/lustre/include/linux/lnet/socklnd.h | 12 +- .../lustre/include/uapi/linux/lnet/libcfs_debug.h | 149 +++++ .../libcfs => uapi/linux/lnet}/libcfs_ioctl.h | 0 .../lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} | 4 +- .../lnet/types.h => uapi/linux/lnet/lnet-types.h} | 0 .../lustre/include/{ => uapi}/linux/lnet/lnetctl.h | 51 +- .../lustre/include/{ => uapi}/linux/lnet/lnetst.h | 0 .../lustre/include/{ => uapi}/linux/lnet/nidstr.h | 2 +- .../lnet/lnet.h => uapi/linux/lnet/socklnd.h} | 24 +- .../uapi/linux/lustre}/lustre_cfg.h | 188 +++--- .../lustre/include/uapi/linux/lustre/lustre_fid.h | 293 +++++++++ .../uapi/linux/lustre/lustre_fiemap.h} | 6 +- .../uapi/linux}/lustre/lustre_idl.h | 682 +-------------------- .../uapi/linux}/lustre/lustre_ioctl.h | 203 +----- .../uapi/linux/lustre/lustre_kernelcomm.h} | 6 +- .../include/uapi/linux/lustre/lustre_ostid.h | 235 +++++++ .../include/uapi/linux/lustre/lustre_param.h | 94 +++ .../uapi/linux}/lustre/lustre_user.h | 15 +- .../uapi/linux/lustre}/lustre_ver.h | 0 drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile | 3 + .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 5 +- drivers/staging/lustre/lnet/klnds/socklnd/Makefile | 3 + .../staging/lustre/lnet/klnds/socklnd/socklnd.h | 7 +- drivers/staging/lustre/lnet/libcfs/Makefile | 3 + drivers/staging/lustre/lnet/libcfs/debug.c | 2 +- drivers/staging/lustre/lnet/libcfs/fail.c | 2 +- drivers/staging/lustre/lnet/libcfs/hash.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_mem.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_string.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 2 +- .../lustre/lnet/libcfs/linux/linux-crypto.c | 4 +- .../lustre/lnet/libcfs/linux/linux-curproc.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-debug.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-mem.c | 2 +- .../lustre/lnet/libcfs/linux/linux-module.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-prim.c | 2 +- .../lustre/lnet/libcfs/linux/linux-tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/module.c | 9 +- drivers/staging/lustre/lnet/libcfs/prng.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.h | 2 +- drivers/staging/lustre/lnet/libcfs/workitem.c | 2 +- drivers/staging/lustre/lnet/lnet/Makefile | 3 + drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 4 +- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-eq.c | 3 +- drivers/staging/lustre/lnet/lnet/lib-md.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-me.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-msg.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-socket.c | 4 +- drivers/staging/lustre/lnet/lnet/lo.c | 3 +- drivers/staging/lustre/lnet/lnet/module.c | 5 +- drivers/staging/lustre/lnet/lnet/net_fault.c | 4 +- drivers/staging/lustre/lnet/lnet/nidstrings.c | 4 +- drivers/staging/lustre/lnet/lnet/peer.c | 4 +- drivers/staging/lustre/lnet/lnet/router.c | 3 +- drivers/staging/lustre/lnet/lnet/router_proc.c | 5 +- drivers/staging/lustre/lnet/selftest/Makefile | 3 + drivers/staging/lustre/lnet/selftest/conctl.c | 6 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 4 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 7 +- drivers/staging/lustre/lnet/selftest/console.c | 4 +- drivers/staging/lustre/lnet/selftest/console.h | 7 +- drivers/staging/lustre/lnet/selftest/rpc.h | 2 +- drivers/staging/lustre/lnet/selftest/selftest.h | 9 +- drivers/staging/lustre/lustre/Kconfig | 10 - drivers/staging/lustre/lustre/fid/Makefile | 3 + drivers/staging/lustre/lustre/fid/fid_internal.h | 4 +- drivers/staging/lustre/lustre/fid/fid_lib.c | 5 +- drivers/staging/lustre/lustre/fid/fid_request.c | 12 +- drivers/staging/lustre/lustre/fid/lproc_fid.c | 12 +- drivers/staging/lustre/lustre/fld/Makefile | 3 + drivers/staging/lustre/lustre/fld/fld_cache.c | 16 +- drivers/staging/lustre/lustre/fld/fld_internal.h | 8 +- drivers/staging/lustre/lustre/fld/fld_request.c | 18 +- drivers/staging/lustre/lustre/fld/lproc_fld.c | 14 +- drivers/staging/lustre/lustre/include/cl_object.h | 4 +- drivers/staging/lustre/lustre/include/llog_swab.h | 3 +- .../staging/lustre/lustre/include/lprocfs_status.h | 6 +- drivers/staging/lustre/lustre/include/lu_object.h | 6 +- .../staging/lustre/lustre/include/lustre_compat.h | 2 +- .../staging/lustre/lustre/include/lustre_debug.h | 4 +- .../staging/lustre/lustre/include/lustre_disk.h | 23 +- drivers/staging/lustre/lustre/include/lustre_dlm.h | 25 +- .../lustre/include/{lustre => }/lustre_errno.h | 0 .../staging/lustre/lustre/include/lustre_export.h | 6 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 84 ++- drivers/staging/lustre/lustre/include/lustre_fld.h | 5 +- .../staging/lustre/lustre/include/lustre_handles.h | 2 +- .../staging/lustre/lustre/include/lustre_import.h | 4 +- .../lustre/lustre/include/lustre_kernelcomm.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 12 +- drivers/staging/lustre/lustre/include/lustre_lmv.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 4 +- drivers/staging/lustre/lustre/include/lustre_mdc.h | 15 +- drivers/staging/lustre/lustre/include/lustre_mds.h | 11 +- drivers/staging/lustre/lustre/include/lustre_net.h | 28 +- drivers/staging/lustre/lustre/include/lustre_nrs.h | 2 +- .../staging/lustre/lustre/include/lustre_obdo.h | 2 +- .../staging/lustre/lustre/include/lustre_param.h | 109 ---- .../staging/lustre/lustre/include/lustre_swab.h | 8 +- drivers/staging/lustre/lustre/include/obd.h | 18 +- drivers/staging/lustre/lustre/include/obd_cksum.h | 6 +- drivers/staging/lustre/lustre/include/obd_class.h | 35 +- .../staging/lustre/lustre/include/obd_support.h | 6 +- drivers/staging/lustre/lustre/include/seq_range.h | 2 +- drivers/staging/lustre/lustre/ldlm/interval_tree.c | 6 +- drivers/staging/lustre/lustre/ldlm/l_lock.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 12 +- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 8 +- .../staging/lustre/lustre/ldlm/ldlm_inodebits.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 6 + drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 12 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 +- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_plain.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 8 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 34 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 6 +- drivers/staging/lustre/lustre/llite/Makefile | 3 + drivers/staging/lustre/lustre/llite/dcache.c | 6 +- drivers/staging/lustre/lustre/llite/dir.c | 22 +- drivers/staging/lustre/lustre/llite/file.c | 10 +- drivers/staging/lustre/lustre/llite/glimpse.c | 16 +- drivers/staging/lustre/lustre/llite/lcommon_cl.c | 35 +- drivers/staging/lustre/lustre/llite/lcommon_misc.c | 8 +- .../staging/lustre/lustre/llite/llite_internal.h | 20 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 21 +- drivers/staging/lustre/lustre/llite/lproc_llite.c | 4 +- drivers/staging/lustre/lustre/llite/namei.c | 7 +- drivers/staging/lustre/lustre/llite/range_lock.c | 2 +- drivers/staging/lustre/lustre/llite/range_lock.h | 4 +- drivers/staging/lustre/lustre/llite/rw.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 4 +- drivers/staging/lustre/lustre/llite/super25.c | 6 +- drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_internal.h | 4 +- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_lock.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_object.c | 4 +- drivers/staging/lustre/lustre/llite/xattr.c | 5 +- drivers/staging/lustre/lustre/llite/xattr_cache.c | 5 +- drivers/staging/lustre/lustre/lmv/Makefile | 3 + drivers/staging/lustre/lustre/lmv/lmv_fld.c | 15 +- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 17 +- drivers/staging/lustre/lustre/lmv/lmv_internal.h | 6 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 19 +- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 4 +- drivers/staging/lustre/lustre/lov/Makefile | 3 + .../staging/lustre/lustre/lov/lov_cl_internal.h | 6 +- drivers/staging/lustre/lustre/lov/lov_dev.c | 2 +- drivers/staging/lustre/lustre/lov/lov_ea.c | 6 +- drivers/staging/lustre/lustre/lov/lov_internal.h | 4 +- drivers/staging/lustre/lustre/lov/lov_merge.c | 4 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 40 +- drivers/staging/lustre/lustre/lov/lov_offset.c | 4 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 13 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 4 +- drivers/staging/lustre/lustre/lov/lov_request.c | 6 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 4 +- drivers/staging/lustre/lustre/mdc/Makefile | 3 + drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 4 +- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 10 +- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 22 +- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 4 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 25 +- drivers/staging/lustre/lustre/mgc/Makefile | 3 + drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 4 +- drivers/staging/lustre/lustre/mgc/mgc_internal.h | 11 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 23 +- drivers/staging/lustre/lustre/obdclass/Makefile | 3 + drivers/staging/lustre/lustre/obdclass/cl_io.c | 8 +- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 8 +- drivers/staging/lustre/lustre/obdclass/cl_object.c | 14 +- drivers/staging/lustre/lustre/obdclass/cl_page.c | 8 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 35 +- drivers/staging/lustre/lustre/obdclass/debug.c | 6 +- drivers/staging/lustre/lustre/obdclass/genops.c | 6 +- .../staging/lustre/lustre/obdclass/kernelcomm.c | 4 +- drivers/staging/lustre/lustre/obdclass/linkea.c | 6 +- .../lustre/lustre/obdclass/linux/linux-module.c | 100 ++- .../lustre/lustre/obdclass/linux/linux-sysctl.c | 6 +- drivers/staging/lustre/lustre/obdclass/llog.c | 6 +- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 2 +- .../staging/lustre/lustre/obdclass/llog_internal.h | 2 +- drivers/staging/lustre/lustre/obdclass/llog_obd.c | 4 +- drivers/staging/lustre/lustre/obdclass/llog_swab.c | 4 +- .../lustre/lustre/obdclass/lprocfs_counters.c | 4 +- .../lustre/lustre/obdclass/lprocfs_status.c | 6 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 20 +- drivers/staging/lustre/lustre/obdclass/lu_ref.c | 10 +- .../lustre/lustre/obdclass/lustre_handles.c | 6 +- .../staging/lustre/lustre/obdclass/lustre_peer.c | 14 +- .../staging/lustre/lustre/obdclass/obd_config.c | 74 ++- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 44 +- drivers/staging/lustre/lustre/obdclass/obdo.c | 6 +- .../staging/lustre/lustre/obdclass/statfs_pack.c | 8 +- drivers/staging/lustre/lustre/obdclass/uuid.c | 6 +- drivers/staging/lustre/lustre/obdecho/Makefile | 3 + .../staging/lustre/lustre/obdecho/echo_client.c | 31 +- drivers/staging/lustre/lustre/osc/Makefile | 3 + drivers/staging/lustre/lustre/osc/lproc_osc.c | 6 +- .../staging/lustre/lustre/osc/osc_cl_internal.h | 6 +- drivers/staging/lustre/lustre/osc/osc_dev.c | 2 +- drivers/staging/lustre/lustre/osc/osc_internal.h | 2 +- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- drivers/staging/lustre/lustre/osc/osc_lock.c | 4 +- drivers/staging/lustre/lustre/osc/osc_object.c | 9 +- drivers/staging/lustre/lustre/osc/osc_quota.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 32 +- drivers/staging/lustre/lustre/ptlrpc/Makefile | 3 + drivers/staging/lustre/lustre/ptlrpc/client.c | 12 +- drivers/staging/lustre/lustre/ptlrpc/connection.c | 6 +- drivers/staging/lustre/lustre/ptlrpc/errno.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/events.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/import.c | 16 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/llog_net.c | 6 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 12 +- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c | 6 +- .../staging/lustre/lustre/ptlrpc/pack_generic.c | 20 +- drivers/staging/lustre/lustre/ptlrpc/pers.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 4 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_module.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/recover.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/sec.c | 16 +- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 20 +- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 13 +- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 16 +- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 11 +- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 8 +- 250 files changed, 2089 insertions(+), 2182 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h rename drivers/staging/lustre/include/{linux/libcfs => uapi/linux/lnet}/libcfs_ioctl.h (100%) rename drivers/staging/lustre/include/{linux/lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} (97%) rename drivers/staging/lustre/include/{linux/lnet/types.h => uapi/linux/lnet/lnet-types.h} (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetctl.h (62%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetst.h (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/nidstr.h (98%) rename drivers/staging/lustre/include/{linux/lnet/lnet.h => uapi/linux/lnet/socklnd.h} (70%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_cfg.h (52%) create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h rename drivers/staging/lustre/{lustre/include/lustre/ll_fiemap.h => include/uapi/linux/lustre/lustre_fiemap.h} (96%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_idl.h (83%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h (63%) rename drivers/staging/lustre/{lustre/include/uapi_kernelcomm.h => include/uapi/linux/lustre/lustre_kernelcomm.h} (95%) create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_user.h (99%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_ver.h (100%) rename drivers/staging/lustre/lustre/include/{lustre => }/lustre_errno.h (100%) delete mode 100644 drivers/staging/lustre/lustre/include/lustre_param.h -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:37 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:37 -0400 Subject: [lustre-devel] [PATCH 09/64] staging: lustre: uapi: remove obd_ioctl_popdata() wrapper In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-10-git-send-email-jsimmons@infradead.org> Replace obd_ioctl_popdata() with direct copy_to_user() call. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_ioctl.h | 1 - drivers/staging/lustre/lustre/obdclass/class_obd.c | 18 +++++++----------- .../lustre/lustre/obdclass/linux/linux-module.c | 8 -------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index 7a61a00..da9a071 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -209,7 +209,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) } int obd_ioctl_getdata(char **buf, int *len, void __user *arg); -int obd_ioctl_popdata(void __user *arg, void *data, int len); /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 8cc1fdc..477d611 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -206,8 +206,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING, strlen(LUSTRE_VERSION_STRING) + 1); - err = obd_ioctl_popdata((void __user *)arg, data, len); - if (err) + if (copy_to_user((void __user *)arg, data, len)) err = -EFAULT; goto out; @@ -225,9 +224,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) goto out; } - err = obd_ioctl_popdata((void __user *)arg, data, - sizeof(*data)); - if (err) + if (copy_to_user((void __user *)arg, data, sizeof(*data))) err = -EFAULT; goto out; } @@ -263,8 +260,8 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) CDEBUG(D_IOCTL, "device name %s, dev %d\n", data->ioc_inlbuf1, dev); - err = obd_ioctl_popdata((void __user *)arg, data, - sizeof(*data)); + + if (copy_to_user((void __user *)arg, data, sizeof(*data))) if (err) err = -EFAULT; goto out; @@ -304,9 +301,9 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) (int)index, status, obd->obd_type->typ_name, obd->obd_name, obd->obd_uuid.uuid, atomic_read(&obd->obd_refcount)); - err = obd_ioctl_popdata((void __user *)arg, data, len); - err = 0; + if (copy_to_user((void __user *)arg, data, len)) + err = -EFAULT; goto out; } } @@ -361,8 +358,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) if (err) goto out; - err = obd_ioctl_popdata((void __user *)arg, data, len); - if (err) + if (copy_to_user((void __user *)arg, data, len)) err = -EFAULT; goto out; } diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index eb88bd9..3a394d2 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -151,14 +151,6 @@ int obd_ioctl_getdata(char **buf, int *len, void __user *arg) } EXPORT_SYMBOL(obd_ioctl_getdata); -int obd_ioctl_popdata(void __user *arg, void *data, int len) -{ - int err; - - err = copy_to_user(arg, data, len) ? -EFAULT : 0; - return err; -} - /* opening /dev/obd */ static int obd_class_open(struct inode *inode, struct file *file) { -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:30 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:30 -0400 Subject: [lustre-devel] [PATCH 02/64] staging: lustre: uapi: remove unused functions for lustre_fid.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-3-git-send-email-jsimmons@infradead.org> The inline function fid_is_namespace_visible and ost_fid_from_resid are only used for server code so we can remove it. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_fid.h | 29 ---------------------- 1 file changed, 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 6dc24a7..681f698 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -288,18 +288,6 @@ static inline int fid_is_quota(const struct lu_fid *fid) fid_seq(fid) == FID_SEQ_QUOTA_GLB; } -static inline int fid_is_namespace_visible(const struct lu_fid *fid) -{ - const __u64 seq = fid_seq(fid); - - /* Here, we cannot distinguish whether the normal FID is for OST - * object or not. It is caller's duty to check more if needed. - */ - return (!fid_is_last_id(fid) && - (fid_seq_is_norm(seq) || fid_seq_is_igif(seq))) || - fid_is_root(fid) || fid_is_dot_lustre(fid); -} - static inline int fid_seq_in_fldb(__u64 seq) { return fid_seq_is_igif(seq) || fid_seq_is_norm(seq) || @@ -522,23 +510,6 @@ static inline void ost_fid_build_resid(const struct lu_fid *fid, } } -static inline void ost_fid_from_resid(struct lu_fid *fid, - const struct ldlm_res_id *name, - int ost_idx) -{ - if (fid_seq_is_mdt0(name->name[LUSTRE_RES_ID_VER_OID_OFF])) { - /* old resid */ - struct ost_id oi; - - ostid_set_seq(&oi, name->name[LUSTRE_RES_ID_VER_OID_OFF]); - ostid_set_id(&oi, name->name[LUSTRE_RES_ID_SEQ_OFF]); - ostid_to_fid(fid, &oi, ost_idx); - } else { - /* new resid */ - fid_extract_from_res_name(fid, name); - } -} - /** * Flatten 128-bit FID values into a 64-bit value for use as an inode number. * For non-IGIF FIDs this starts just over 2^32, and continues without -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:32 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:32 -0400 Subject: [lustre-devel] [PATCH 04/64] staging: lustre: uapi: update URL doc link in lustre_fid.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-5-git-send-email-jsimmons@infradead.org> From: Ben Evans The wiki has been revived so update the URL about the FID design in lustre_fid.h. Signed-off-by: Ben Evans Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/22712 Reviewed-on: https://review.whamcloud.com/24569 Reviewed-by: James Simmons Reviewed-by: Frank Zago Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 681f698..0446bec 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -41,7 +41,7 @@ * * @{ * - * http://wiki.old.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs + * http://wiki.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs * describes the FID namespace and interoperability requirements for FIDs. * The important parts of that document are included here for reference. * -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:40 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:40 -0400 Subject: [lustre-devel] [PATCH 12/64] staging: lustre: uapi: move lustre_ioctl.h to uapi directory In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-13-git-send-email-jsimmons@infradead.org> Move the header lustre_ioctl.h to proper uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h | 5 ++--- drivers/staging/lustre/lustre/llite/dir.c | 2 +- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 +- drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- 12 files changed, 13 insertions(+), 14 deletions(-) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h (98%) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h similarity index 98% rename from drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 8585302..880dd92 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -29,13 +29,12 @@ #define LUSTRE_IOCTL_H_ #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "lustre_idl.h" +#include "../../../linux/libcfs/libcfs.h" +#include "../../../../lustre/include/lustre/lustre_idl.h" #ifdef __KERNEL__ # include # include -# include "../obd_support.h" #else /* __KERNEL__ */ # include # include diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index dd592d9..4b46271 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -46,7 +46,7 @@ #include "../include/obd_support.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_lib.h" #include "../include/lustre_dlm.h" #include "../include/lustre_fid.h" diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 215479a..71d1878 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -43,7 +43,7 @@ #include #include #include "../include/lustre/ll_fiemap.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_swab.h" #include "../include/cl_object.h" diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 451e4fa..e7d5228 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -41,7 +41,7 @@ #include #include -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_ha.h" #include "../include/lustre_dlm.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 1c9ff24..ab77dbe 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -49,7 +49,7 @@ #include "../include/lprocfs_status.h" #include "../include/cl_object.h" #include "../include/lustre_fid.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_kernelcomm.h" #include "lmv_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 8871624..8777d4b 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../include/lustre/lustre_idl.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/cl_object.h" #include "../include/lustre_dlm.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index dc775bb..93fb195 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -45,7 +45,7 @@ #include "../include/lprocfs_status.h" #include "../include/lustre_acl.h" #include "../include/lustre_fid.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_kernelcomm.h" #include "../include/lustre_lmv.h" #include "../include/lustre_log.h" diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 477d611..ed30333 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -40,7 +40,7 @@ #include "../include/lprocfs_status.h" #include #include "../include/cl_object.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "llog_internal.h" struct obd_device *obd_devs[MAX_OBD_DEVICES]; diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 092e68a..9f83345 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -65,7 +65,7 @@ #include "../../include/obd_support.h" #include "../../include/obd_class.h" #include "../../include/lprocfs_status.h" -#include "../../include/lustre/lustre_ioctl.h" +#include "../../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../../include/lustre_ver.h" static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 6a7e7a7..2a93d67 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -38,7 +38,7 @@ #include -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" #include "../include/lustre_log.h" diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 6cbe58f3..31e549f 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -41,7 +41,7 @@ #include "../include/cl_object.h" #include "../include/lustre_fid.h" #include "../include/lustre_acl.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_net.h" #include "echo_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 922d0cb..e103d5a 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -41,7 +41,7 @@ #include "../include/lustre_ha.h" #include "../include/lprocfs_status.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_debug.h" #include "../include/lustre_obdo.h" #include "../include/lustre_param.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:45 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:45 -0400 Subject: [lustre-devel] [PATCH 17/64] staging: lustre: uapi: remove included headers out of lustre_param.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-18-git-send-email-jsimmons@infradead.org> All the included headers in lustre_param.h are lustre kernel internal headers and they are not even needed. Just remove them. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_param.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/lustre/include/lustre_param.h index 2620e02..f6f4752 100644 --- a/drivers/staging/lustre/lustre/include/lustre_param.h +++ b/drivers/staging/lustre/lustre/include/lustre_param.h @@ -39,9 +39,6 @@ #ifndef _LUSTRE_PARAM_H #define _LUSTRE_PARAM_H -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/types.h" - /** \defgroup param param * * @{ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:29 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:29 -0400 Subject: [lustre-devel] [PATCH 01/64] staging: lustre: uapi: Move functions out of lustre_idl.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-2-git-send-email-jsimmons@infradead.org> From: Ben Evans Migrate functions set/get_mrc_cr_flags, ldlm_res_eq ldlm_extent_overlap, ldlm_extent_contain, ldlm_request_bufsize, and all the PTLRPC dump_* functions out of lustre_idl.h which is a UAPI header to the places in the kernel code they are actually used. Delete unused lmv_mds_md_stripe_count and agent_req_in_final_state. Signed-off-by: Ben Evans Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: http://review.whamcloud.com/21484 Reviewed-by: Frank Zago Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h | 73 ---------------------- drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 ++++ .../staging/lustre/lustre/include/lustre_swab.h | 6 ++ drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 6 ++ drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 27 ++++++++ drivers/staging/lustre/lustre/mdc/mdc_lib.c | 6 ++ 6 files changed, 58 insertions(+), 73 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 1db1ab8..1e8ecdf 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -2130,17 +2130,6 @@ struct mdt_rec_create { __u32 cr_padding_4; /* rr_padding_4 */ }; -static inline void set_mrc_cr_flags(struct mdt_rec_create *mrc, __u64 flags) -{ - mrc->cr_flags_l = (__u32)(flags & 0xFFFFFFFFUll); - mrc->cr_flags_h = (__u32)(flags >> 32); -} - -static inline __u64 get_mrc_cr_flags(struct mdt_rec_create *mrc) -{ - return ((__u64)(mrc->cr_flags_l) | ((__u64)mrc->cr_flags_h << 32)); -} - /* instance of mdt_reint_rec */ struct mdt_rec_link { __u32 lk_opcode; @@ -2403,25 +2392,6 @@ static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm) } } -static inline int lmv_mds_md_stripe_count_set(union lmv_mds_md *lmm, - unsigned int stripe_count) -{ - int rc = 0; - - switch (le32_to_cpu(lmm->lmv_magic)) { - case LMV_MAGIC_V1: - lmm->lmv_md_v1.lmv_stripe_count = cpu_to_le32(stripe_count); - break; - case LMV_USER_MAGIC: - lmm->lmv_user_md.lum_stripe_count = cpu_to_le32(stripe_count); - break; - default: - rc = -EINVAL; - break; - } - return rc; -} - enum fld_rpc_opc { FLD_QUERY = 900, FLD_READ = 901, @@ -2502,12 +2472,6 @@ struct ldlm_res_id { #define PLDLMRES(res) (res)->lr_name.name[0], (res)->lr_name.name[1], \ (res)->lr_name.name[2], (res)->lr_name.name[3] -static inline bool ldlm_res_eq(const struct ldlm_res_id *res0, - const struct ldlm_res_id *res1) -{ - return !memcmp(res0, res1, sizeof(*res0)); -} - /* lock types */ enum ldlm_mode { LCK_MINMODE = 0, @@ -2540,19 +2504,6 @@ struct ldlm_extent { __u64 gid; }; -static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1, - const struct ldlm_extent *ex2) -{ - return (ex1->start <= ex2->end) && (ex2->start <= ex1->end); -} - -/* check if @ex1 contains @ex2 */ -static inline int ldlm_extent_contain(const struct ldlm_extent *ex1, - const struct ldlm_extent *ex2) -{ - return (ex1->start <= ex2->start) && (ex1->end >= ex2->end); -} - struct ldlm_inodebits { __u64 bits; }; @@ -2627,18 +2578,6 @@ struct ldlm_request { struct lustre_handle lock_handle[LDLM_LOCKREQ_HANDLES]; }; -/* If LDLM_ENQUEUE, 1 slot is already occupied, 1 is available. - * Otherwise, 2 are available. - */ -#define ldlm_request_bufsize(count, type) \ -({ \ - int _avail = LDLM_LOCKREQ_HANDLES; \ - _avail -= (type == LDLM_ENQUEUE ? LDLM_ENQUEUE_CANCEL_OFF : 0); \ - sizeof(struct ldlm_request) + \ - (count > _avail ? count - _avail : 0) * \ - sizeof(struct lustre_handle); \ -}) - struct ldlm_reply { __u32 lock_flags; __u32 lock_padding; /* also fix lustre_swab_ldlm_reply */ @@ -2942,12 +2881,6 @@ static inline const char *agent_req_status2name(const enum agent_req_status ars) } } -static inline bool agent_req_in_final_state(enum agent_req_status ars) -{ - return ((ars == ARS_SUCCEED) || (ars == ARS_FAILED) || - (ars == ARS_CANCELED)); -} - struct llog_agent_req_rec { struct llog_rec_hdr arr_hdr; /**< record header */ __u32 arr_status; /**< status of the request */ @@ -3142,12 +3075,6 @@ struct ll_fiemap_info_key { struct fiemap lfik_fiemap; }; -/* Functions for dumping PTLRPC fields */ -void dump_rniobuf(struct niobuf_remote *rnb); -void dump_ioo(struct obd_ioobj *nb); -void dump_ost_body(struct ost_body *ob); -void dump_rcs(__u32 *rc); - /* security opcodes */ enum sec_cmd { SEC_CTX_INIT = 801, diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 1e86fb5..eb2de13 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1336,5 +1336,18 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns, void ldlm_pool_del(struct ldlm_pool *pl, struct ldlm_lock *lock); /** @} */ +static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1, + const struct ldlm_extent *ex2) +{ + return ex1->start <= ex2->end && ex2->start <= ex1->end; +} + +/* check if @ex1 contains @ex2 */ +static inline int ldlm_extent_contain(const struct ldlm_extent *ex1, + const struct ldlm_extent *ex2) +{ + return ex1->start <= ex2->start && ex1->end >= ex2->end; +} + #endif /** @} LDLM */ diff --git a/drivers/staging/lustre/lustre/include/lustre_swab.h b/drivers/staging/lustre/lustre/include/lustre_swab.h index 26d01c2..5c1bdc0 100644 --- a/drivers/staging/lustre/lustre/include/lustre_swab.h +++ b/drivers/staging/lustre/lustre/include/lustre_swab.h @@ -99,4 +99,10 @@ void lustre_swab_lov_user_md_objects(struct lov_user_ost_data *lod, void lustre_swab_close_data(struct close_data *data); void lustre_swab_lmv_user_md(struct lmv_user_md *lum); +/* Functions for dumping PTLRPC fields */ +void dump_rniobuf(struct niobuf_remote *rnb); +void dump_ioo(struct obd_ioobj *nb); +void dump_ost_body(struct ost_body *ob); +void dump_rcs(__u32 *rc); + #endif diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index 2bf5c84..36808db 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -333,3 +333,9 @@ void ldlm_flock_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, union ldlm_policy_data *lpolicy); void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy, union ldlm_wire_policy_data *wpolicy); + +static inline bool ldlm_res_eq(const struct ldlm_res_id *res0, + const struct ldlm_res_id *res1) +{ + return memcmp(res0, res1, sizeof(*res0)) == 0; +} diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 4028e11..2e3db5e 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -83,6 +83,33 @@ struct ldlm_async_args { struct lustre_handle lock_handle; }; +/** + * ldlm_request_bufsize + * + * @count: number of ldlm handles + * @type: ldlm opcode + * + * If opcode=LDLM_ENQUEUE, 1 slot is already occupied, + * LDLM_LOCKREQ_HANDLE -1 slots are available. + * Otherwise, LDLM_LOCKREQ_HANDLE slots are available. + * + * Return: size of the request buffer + */ +static int ldlm_request_bufsize(int count, int type) +{ + int avail = LDLM_LOCKREQ_HANDLES; + + if (type == LDLM_ENQUEUE) + avail -= LDLM_ENQUEUE_CANCEL_OFF; + + if (count > avail) + avail = (count - avail) * sizeof(struct lustre_handle); + else + avail = 0; + + return sizeof(struct ldlm_request) + avail; +} + static int ldlm_expired_completion_wait(void *data) { struct lock_wait_data *lwd = data; diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index b1853ff..aabdcec 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -35,6 +35,12 @@ #include "../include/lustre/lustre_idl.h" #include "mdc_internal.h" +static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags) +{ + mrc->cr_flags_l = (u32)(flags & 0xFFFFFFFFUll); + mrc->cr_flags_h = (u32)(flags >> 32); +} + static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid) { b->mbo_suppgid = suppgid; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:39 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:39 -0400 Subject: [lustre-devel] [PATCH 11/64] staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-12-git-send-email-jsimmons@infradead.org> The inline function obd_ioctl_is_invalid() is no longer needed by userland and also the function was pretty bug for a inline function. Since this is the case we can move this kernel only code to the linux-module.c which is the only place it is used. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_ioctl.h | 76 ---------------------- .../lustre/lustre/obdclass/linux/linux-module.c | 76 ++++++++++++++++++++++ 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index 914cea1..8585302 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -132,82 +132,6 @@ static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data) return len; } -static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) -{ - if (data->ioc_len > (1 << 30)) { - CERROR("OBD ioctl: ioc_len larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen1 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen1 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen2 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen2 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen3 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen3 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen4 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen4 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inlbuf1 && !data->ioc_inllen1) { - CERROR("OBD ioctl: inlbuf1 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_inlbuf2 && !data->ioc_inllen2) { - CERROR("OBD ioctl: inlbuf2 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_inlbuf3 && !data->ioc_inllen3) { - CERROR("OBD ioctl: inlbuf3 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_inlbuf4 && !data->ioc_inllen4) { - CERROR("OBD ioctl: inlbuf4 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_pbuf1 && !data->ioc_plen1) { - CERROR("OBD ioctl: pbuf1 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_pbuf2 && !data->ioc_plen2) { - CERROR("OBD ioctl: pbuf2 pointer but 0 length\n"); - return 1; - } - - if (!data->ioc_pbuf1 && data->ioc_plen1) { - CERROR("OBD ioctl: plen1 set but NULL pointer\n"); - return 1; - } - - if (!data->ioc_pbuf2 && data->ioc_plen2) { - CERROR("OBD ioctl: plen2 set but NULL pointer\n"); - return 1; - } - - if (obd_ioctl_packlen(data) > data->ioc_len) { - CERROR("OBD ioctl: packlen exceeds ioc_len (%d > %d)\n", - obd_ioctl_packlen(data), data->ioc_len); - return 1; - } - - return 0; -} - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 3a394d2..092e68a 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -68,6 +68,82 @@ #include "../../include/lustre/lustre_ioctl.h" #include "../../include/lustre_ver.h" +static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) +{ + if (data->ioc_len > BIT(30)) { + CERROR("OBD ioctl: ioc_len larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen1 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen1 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen2 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen2 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen3 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen3 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen4 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen4 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inlbuf1 && data->ioc_inllen1 == 0) { + CERROR("OBD ioctl: inlbuf1 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_inlbuf2 && data->ioc_inllen2 == 0) { + CERROR("OBD ioctl: inlbuf2 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_inlbuf3 && data->ioc_inllen3 == 0) { + CERROR("OBD ioctl: inlbuf3 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_inlbuf4 && data->ioc_inllen4 == 0) { + CERROR("OBD ioctl: inlbuf4 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_pbuf1 && data->ioc_plen1 == 0) { + CERROR("OBD ioctl: pbuf1 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_pbuf2 && data->ioc_plen2 == 0) { + CERROR("OBD ioctl: pbuf2 pointer but 0 length\n"); + return 1; + } + + if (!data->ioc_pbuf1 && data->ioc_plen1 != 0) { + CERROR("OBD ioctl: plen1 set but NULL pointer\n"); + return 1; + } + + if (!data->ioc_pbuf2 && data->ioc_plen2 != 0) { + CERROR("OBD ioctl: plen2 set but NULL pointer\n"); + return 1; + } + + if (obd_ioctl_packlen(data) > data->ioc_len) { + CERROR("OBD ioctl: packlen exceeds ioc_len (%d > %d)\n", + obd_ioctl_packlen(data), data->ioc_len); + return 1; + } + + return 0; +} + /* buffer MUST be at least the size of obd_ioctl_hdr */ int obd_ioctl_getdata(char **buf, int *len, void __user *arg) { -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:41 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:41 -0400 Subject: [lustre-devel] [PATCH 13/64] staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-14-git-send-email-jsimmons@infradead.org> Replace cfs_size_round() standard __ALIGN_KERNEL macro. This removes the dependency of libcfs.h which is a kernel only header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 880dd92..a7e2fc4 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -28,8 +28,8 @@ #ifndef LUSTRE_IOCTL_H_ #define LUSTRE_IOCTL_H_ +#include #include -#include "../../../linux/libcfs/libcfs.h" #include "../../../../lustre/include/lustre/lustre_idl.h" #ifdef __KERNEL__ @@ -121,12 +121,12 @@ struct obd_ioctl_hdr { static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data) { - __u32 len = cfs_size_round(sizeof(*data)); + __u32 len = __ALIGN_KERNEL(sizeof(*data), 8); - len += cfs_size_round(data->ioc_inllen1); - len += cfs_size_round(data->ioc_inllen2); - len += cfs_size_round(data->ioc_inllen3); - len += cfs_size_round(data->ioc_inllen4); + len += __ALIGN_KERNEL(data->ioc_inllen1, 8); + len += __ALIGN_KERNEL(data->ioc_inllen2, 8); + len += __ALIGN_KERNEL(data->ioc_inllen3, 8); + len += __ALIGN_KERNEL(data->ioc_inllen4, 8); return len; } -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:50 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:50 -0400 Subject: [lustre-devel] [PATCH 22/64] staging: lustre: uapi: don't memory allocate in UAPI header In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-23-git-send-email-jsimmons@infradead.org> The inline function lustre_cfg_new() calls kzalloc() but this is a UAPI header. Remove kzalloc() and rename the function to lustre_cfg_init(). The lustre kernel code that was calling lustre_cfg_new() can doing the memory allocation and pass the new buffer to lustre_cfg_init() to fill in. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_cfg.h | 11 ++-------- drivers/staging/lustre/lustre/mgc/mgc_request.c | 9 +++++--- .../staging/lustre/lustre/obdclass/obd_config.c | 17 +++++++++++---- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 24 ++++++++++++++++++---- 4 files changed, 41 insertions(+), 20 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h index 3f280b5..9d6934b 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h @@ -222,18 +222,12 @@ static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) #include "obd_support.h" -static inline struct lustre_cfg *lustre_cfg_new(int cmd, - struct lustre_cfg_bufs *bufs) +static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, + struct lustre_cfg_bufs *bufs) { - struct lustre_cfg *lcfg; char *ptr; int i; - lcfg = kzalloc(lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen), - GFP_NOFS); - if (!lcfg) - return ERR_PTR(-ENOMEM); - lcfg->lcfg_version = LUSTRE_CFG_VERSION; lcfg->lcfg_command = cmd; lcfg->lcfg_bufcount = bufs->lcfg_bufcount; @@ -243,7 +237,6 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd, lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i]; LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr); } - return lcfg; } static inline int lustre_cfg_sanity_check(void *buf, size_t len) diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 3674788..3bead6a 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1165,6 +1165,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, char *cname; char *params; char *uuid; + size_t len; rc = -EINVAL; if (datalen < sizeof(*entry)) @@ -1293,11 +1294,13 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, lustre_cfg_bufs_set_string(&bufs, 1, params); rc = -ENOMEM; - lcfg = lustre_cfg_new(LCFG_PARAM, &bufs); - if (IS_ERR(lcfg)) { - CERROR("mgc: cannot allocate memory\n"); + len = lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen); + lcfg = kzalloc(len, GFP_NOFS); + if (!lcfg) { + rc = -ENOMEM; break; } + lustre_cfg_init(lcfg, LCFG_PARAM, &bufs); CDEBUG(D_INFO, "ir apply logs %lld/%lld for %s -> %s\n", prev_version, max_version, obdname, params); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 4b5cd7d..4c7c4f3 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1107,6 +1107,7 @@ int class_config_llog_handler(const struct lu_env *env, struct lustre_cfg_bufs bufs; char *inst_name = NULL; int inst_len = 0; + size_t lcfg_len; int inst = 0, swab = 0; lcfg = (struct lustre_cfg *)cfg_buf; @@ -1238,8 +1239,14 @@ int class_config_llog_handler(const struct lu_env *env, clli->cfg_obdname); } - lcfg_new = lustre_cfg_new(lcfg->lcfg_command, &bufs); + lcfg_len = lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen); + lcfg_new = kzalloc(lcfg_len, GFP_NOFS); + if (!lcfg_new) { + rc = -ENOMEM; + goto out; + } + lustre_cfg_init(lcfg_new, lcfg->lcfg_command, &bufs); lcfg_new->lcfg_num = lcfg->lcfg_num; lcfg_new->lcfg_flags = lcfg->lcfg_flags; @@ -1426,9 +1433,11 @@ int class_manual_cleanup(struct obd_device *obd) lustre_cfg_bufs_reset(&bufs, obd->obd_name); lustre_cfg_bufs_set_string(&bufs, 1, flags); - lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs); - if (IS_ERR(lcfg)) - return PTR_ERR(lcfg); + lcfg = kzalloc(lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen), + GFP_NOFS); + if (!lcfg) + return -ENOMEM; + lustre_cfg_init(lcfg, LCFG_CLEANUP, &bufs); rc = class_process_config(lcfg); if (rc) { diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 74de1fa..5094829 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -88,10 +88,17 @@ int lustre_process_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set_string(bufs, 1, logname); lustre_cfg_bufs_set(bufs, 2, cfg, sizeof(*cfg)); lustre_cfg_bufs_set(bufs, 3, &sb, sizeof(sb)); - lcfg = lustre_cfg_new(LCFG_LOG_START, bufs); + lcfg = kzalloc(lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen), + GFP_NOFS); + if (!lcfg) { + rc = -ENOMEM; + goto out; + } + lustre_cfg_init(lcfg, LCFG_LOG_START, bufs); + rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); kfree(lcfg); - +out: kfree(bufs); if (rc == -EINVAL) @@ -126,7 +133,12 @@ int lustre_end_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set_string(&bufs, 1, logname); if (cfg) lustre_cfg_bufs_set(&bufs, 2, cfg, sizeof(*cfg)); - lcfg = lustre_cfg_new(LCFG_LOG_END, &bufs); + lcfg = kzalloc(lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen), + GFP_NOFS); + if (!lcfg) + return -ENOMEM; + lustre_cfg_init(lcfg, LCFG_LOG_END, &bufs); + rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); kfree(lcfg); return rc; @@ -158,7 +170,11 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, if (s4) lustre_cfg_bufs_set_string(&bufs, 4, s4); - lcfg = lustre_cfg_new(cmd, &bufs); + lcfg = kzalloc(lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen), + GFP_NOFS); + if (!lcfg) + return -ENOMEM; + lustre_cfg_init(lcfg, cmd, &bufs); lcfg->lcfg_nid = nid; rc = class_process_config(lcfg); kfree(lcfg); -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:53 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:53 -0400 Subject: [lustre-devel] [PATCH 25/64] staging: lustre: uapi: move lustre_cfg.h to uapi directory In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-26-git-send-email-jsimmons@infradead.org> Move lustre_cfg.h to its proper place. Adjust additonal headers included in lustre_cfg.h. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../{lustre/include => include/uapi/linux/lustre}/lustre_cfg.h | 6 ++---- drivers/staging/lustre/lustre/include/lprocfs_status.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_cfg.h (99%) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h similarity index 99% rename from drivers/staging/lustre/lustre/include/lustre_cfg.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 21a48b1..a762aab 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -33,6 +33,8 @@ #ifndef _LUSTRE_CFG_H #define _LUSTRE_CFG_H +#include "../../../../lustre/include/lustre/lustre_user.h" + /** \defgroup cfg cfg * * @{ @@ -191,8 +193,6 @@ static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) return cfs_size_round(len); } -#include "obd_support.h" - static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, struct lustre_cfg_bufs *bufs) { @@ -238,8 +238,6 @@ static inline int lustre_cfg_sanity_check(void *buf, size_t len) return 0; } -#include "lustre/lustre_user.h" - /** @} cfg */ #endif /* _LUSTRE_CFG_H */ diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 9054d37..694062a 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -44,7 +44,7 @@ #include #include "../../include/linux/libcfs/libcfs.h" -#include "lustre_cfg.h" +#include "../../include/uapi/linux/lustre/lustre_cfg.h" #include "lustre/lustre_idl.h" struct lprocfs_vars { diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index f24970d..c68dd5d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -48,7 +48,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "lustre/lustre_idl.h" #include "lustre_ver.h" -#include "lustre_cfg.h" +#include "../../include/uapi/linux/lustre/lustre_cfg.h" /* target.c */ struct ptlrpc_request; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:34 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:34 -0400 Subject: [lustre-devel] [PATCH 06/64] staging: lustre: uapi: remove unused function in lustre_disk.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-7-git-send-email-jsimmons@infradead.org> Delete code that is used by only the server or just in user land. Now this file is a normal kernel header. The UAPI version of this header is only needed for server side so no need to create a new header in uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25194 Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_disk.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index a676bcc..1a532ad 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -108,14 +108,6 @@ struct lustre_mount_data { #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT) -/****************** last_rcvd file *********************/ - -/** version recovery epoch */ -#define LR_EPOCH_BITS 32 -#define lr_epoch(a) ((a) >> LR_EPOCH_BITS) -#define LR_EXPIRE_INTERVALS 16 /**< number of intervals to track transno */ -#define ENOENT_VERSION 1 /** 'virtual' version of non-existent object */ - /****************** superblock additional info *********************/ struct ll_sb_info; @@ -141,16 +133,6 @@ struct lustre_sb_info { #define s2lsi_nocast(sb) ((sb)->s_fs_info) #define get_profile_name(sb) (s2lsi(sb)->lsi_lmd->lmd_profile) -#define get_mount_flags(sb) (s2lsi(sb)->lsi_lmd->lmd_flags) -#define get_mntdev_name(sb) (s2lsi(sb)->lsi_lmd->lmd_dev) - -/****************** mount lookup info *********************/ - -struct lustre_mount_info { - char *lmi_name; - struct super_block *lmi_sb; - struct list_head lmi_list_chain; -}; /****************** prototypes *********************/ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:36 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:36 -0400 Subject: [lustre-devel] [PATCH 08/64] staging: lustre: uapi: remove obd_ioctl_freedata() wrapper In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-9-git-send-email-jsimmons@infradead.org> Replace obd_ioctl_freedata() with direct kvfree() call. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h | 5 ----- drivers/staging/lustre/lustre/llite/dir.c | 6 +++--- drivers/staging/lustre/lustre/llite/llite_lib.c | 3 +-- drivers/staging/lustre/lustre/lov/lov_obd.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/class_obd.c | 3 +-- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index 84654af..7a61a00 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -211,11 +211,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) int obd_ioctl_getdata(char **buf, int *len, void __user *arg); int obd_ioctl_popdata(void __user *arg, void *data, int len); -static inline void obd_ioctl_freedata(char *buf, size_t len) -{ - kvfree(buf); -} - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 03a72c0..dd592d9 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1097,7 +1097,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) goto out_free; } out_free: - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } case LL_IOC_LMV_SETSTRIPE: { @@ -1147,7 +1147,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) #endif rc = ll_dir_setdirstripe(inode, lum, filename, mode); lmv_out_free: - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } case LL_IOC_LMV_SET_DEFAULT_STRIPE: { @@ -1626,7 +1626,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) rc = ll_migrate(inode, file, mdtidx, filename, namelen - 1); migrate_free: - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 5c8405c..451e4fa 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -2231,8 +2231,7 @@ int ll_obd_statfs(struct inode *inode, void __user *arg) if (rc) goto out_statfs; out_statfs: - if (buf) - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index f27b11f..8871624 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -1087,17 +1087,17 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, data = (struct obd_ioctl_data *)buf; if (sizeof(*desc) > data->ioc_inllen1) { - obd_ioctl_freedata(buf, len); + kvfree(buf); return -EINVAL; } if (sizeof(uuidp->uuid) * count > data->ioc_inllen2) { - obd_ioctl_freedata(buf, len); + kvfree(buf); return -EINVAL; } if (sizeof(__u32) * count > data->ioc_inllen3) { - obd_ioctl_freedata(buf, len); + kvfree(buf); return -EINVAL; } @@ -1116,7 +1116,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, if (copy_to_user(uarg, buf, len)) rc = -EFAULT; - obd_ioctl_freedata(buf, len); + kvfree(buf); break; } case OBD_IOC_QUOTACTL: { diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 76e1ee8..8cc1fdc 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -369,8 +369,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) } out: - if (buf) - obd_ioctl_freedata(buf, len); + kvfree(buf); return err; } /* class_handle_ioctl */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:31 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:31 -0400 Subject: [lustre-devel] [PATCH 03/64] staging: lustre: uapi: return error code for ostid_set_id In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-4-git-send-email-jsimmons@infradead.org> From: Ben Evans Currently the function ostid_set_id() just logs an error and just keeps going. This function is also used by user land tools so having special lustre kernel debugging code is not desired. So instead just return an error code and have the calling kernel code print the error instead. Signed-off-by: Ben Evans Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/22712 Reviewed-on: https://review.whamcloud.com/24569 Reviewed-by: James Simmons Reviewed-by: Frank Zago Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h | 23 ++++++++-------------- .../staging/lustre/lustre/obdecho/echo_client.c | 7 +++++-- drivers/staging/lustre/lustre/osc/osc_object.c | 9 ++++++++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 1e8ecdf..d70495d 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -515,32 +515,25 @@ static inline void ostid_set_seq_llog(struct ost_id *oi) * Note: we need check oi_seq to decide where to set oi_id, * so oi_seq should always be set ahead of oi_id. */ -static inline void ostid_set_id(struct ost_id *oi, __u64 oid) +static inline int ostid_set_id(struct ost_id *oi, __u64 oid) { if (fid_seq_is_mdt0(oi->oi.oi_seq)) { - if (oid >= IDIF_MAX_OID) { - CERROR("Too large OID %#llx to set MDT0 " DOSTID "\n", - oid, POSTID(oi)); - return; - } + if (oid >= IDIF_MAX_OID) + return -E2BIG; oi->oi.oi_id = oid; } else if (fid_is_idif(&oi->oi_fid)) { - if (oid >= IDIF_MAX_OID) { - CERROR("Too large OID %#llx to set IDIF " DOSTID "\n", - oid, POSTID(oi)); - return; - } + if (oid >= IDIF_MAX_OID) + return -E2BIG; oi->oi_fid.f_seq = fid_idif_seq(oid, fid_idif_ost_idx(&oi->oi_fid)); oi->oi_fid.f_oid = oid; oi->oi_fid.f_ver = oid >> 48; } else { - if (oid >= OBIF_MAX_OID) { - CERROR("Bad %llu to set " DOSTID "\n", oid, POSTID(oi)); - return; - } + if (oid >= OBIF_MAX_OID) + return -E2BIG; oi->oi_fid.f_oid = oid; } + return 0; } static inline int fid_set_id(struct lu_fid *fid, __u64 oid) diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 1c4a8fe..6cbe58f3 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -1102,8 +1102,11 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed, return -EINVAL; } - if (!ostid_id(&oa->o_oi)) - ostid_set_id(&oa->o_oi, ++last_object_id); + if (!ostid_id(&oa->o_oi)) { + rc = ostid_set_id(&oa->o_oi, ++last_object_id); + if (rc) + goto failed; + } rc = obd_create(env, ec->ec_exp, oa); if (rc != 0) { diff --git a/drivers/staging/lustre/lustre/osc/osc_object.c b/drivers/staging/lustre/lustre/osc/osc_object.c index fa621bd..945ae6e 100644 --- a/drivers/staging/lustre/lustre/osc/osc_object.c +++ b/drivers/staging/lustre/lustre/osc/osc_object.c @@ -369,7 +369,14 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj, oa->o_valid |= OBD_MD_FLGROUP; } if (flags & OBD_MD_FLID) { - ostid_set_id(&oa->o_oi, ostid_id(&oinfo->loi_oi)); + int rc; + + rc = ostid_set_id(&oa->o_oi, ostid_id(&oinfo->loi_oi)); + if (rc) { + CERROR("Bad %llu to set " DOSTID " : rc %d\n", + (unsigned long long)ostid_id(&oinfo->loi_oi), + POSTID(&oa->o_oi), rc); + } oa->o_valid |= OBD_MD_FLID; } if (flags & OBD_MD_FLHANDLE) { -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:38 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:38 -0400 Subject: [lustre-devel] [PATCH 10/64] staging: lustre: uapi: move obd_ioctl_getdata() declaration In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-11-git-send-email-jsimmons@infradead.org> Move obd_ioctl_getdata() from lustre_ioctl.h to obd_class.h since this function is only used by kernel space. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h | 2 -- drivers/staging/lustre/lustre/include/obd_class.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index da9a071..914cea1 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -208,8 +208,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) return 0; } -int obd_ioctl_getdata(char **buf, int *len, void __user *arg); - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index a6a4b2f..d4a632a 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -1559,4 +1559,7 @@ struct root_squash_info { struct rw_semaphore rsi_sem; }; +/* linux-module.c */ +int obd_ioctl_getdata(char **buf, int *len, void __user *arg); + #endif /* __LINUX_OBD_CLASS_H */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:42 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:42 -0400 Subject: [lustre-devel] [PATCH 14/64] staging: lustre: uapi: cleanup headers for lustre_ioctl.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-15-git-send-email-jsimmons@infradead.org> With the cleanups we no longer need to drag in tons of user land headers. Lets simplify the include headers. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index a7e2fc4..fb87a8b 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -28,19 +28,11 @@ #ifndef LUSTRE_IOCTL_H_ #define LUSTRE_IOCTL_H_ +#include #include #include #include "../../../../lustre/include/lustre/lustre_idl.h" -#ifdef __KERNEL__ -# include -# include -#else /* __KERNEL__ */ -# include -# include -#include -#endif /* !__KERNEL__ */ - #if !defined(__KERNEL__) && !defined(LUSTRE_UTILS) # error This file is for Lustre internal use only. #endif -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:43 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:43 -0400 Subject: [lustre-devel] [PATCH 15/64] staging: lustre: uapi: label lustre_ioctl.h as a UAPI header In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-16-git-send-email-jsimmons@infradead.org> Change LUSTRE_IOCTL_H_ to _UAPI_LUSTRE_IOCTL_H_ now that is a proper UAPI header Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index fb87a8b..c2c0b27 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -25,8 +25,8 @@ * * Copyright (c) 2011, 2015, Intel Corporation. */ -#ifndef LUSTRE_IOCTL_H_ -#define LUSTRE_IOCTL_H_ +#ifndef _UAPI_LUSTRE_IOCTL_H_ +#define _UAPI_LUSTRE_IOCTL_H_ #include #include @@ -229,4 +229,4 @@ static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data) #define IOC_OSC_SET_ACTIVE _IOWR('h', 21, void *) -#endif /* LUSTRE_IOCTL_H_ */ +#endif /* _UAPI_LUSTRE_IOCTL_H_ */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:51 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:51 -0400 Subject: [lustre-devel] [PATCH 23/64] staging: lustre: uapi: move lustre_cfg_string() to obd_config.c In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-24-git-send-email-jsimmons@infradead.org> To perserve the truncate warning move lustre_cfg_string() to obd_config.c. A identical function was created for userland. This function was a bit big for a inline function. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_cfg.h | 29 ------------------ drivers/staging/lustre/lustre/include/obd_class.h | 1 + .../staging/lustre/lustre/obdclass/obd_config.c | 34 ++++++++++++++++++++++ drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 1 + 4 files changed, 36 insertions(+), 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h index 9d6934b..21a48b1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h @@ -179,35 +179,6 @@ static inline void lustre_cfg_bufs_init(struct lustre_cfg_bufs *bufs, } } -static inline char *lustre_cfg_string(struct lustre_cfg *lcfg, __u32 index) -{ - char *s; - - if (lcfg->lcfg_buflens[index] == 0) - return NULL; - - s = lustre_cfg_buf(lcfg, index); - if (!s) - return NULL; - - /* - * make sure it's NULL terminated, even if this kills a char - * of data. Try to use the padding first though. - */ - if (s[lcfg->lcfg_buflens[index] - 1] != '\0') { - size_t last = min((size_t)lcfg->lcfg_buflens[index], - cfs_size_round(lcfg->lcfg_buflens[index]) - 1); - char lost = s[last]; - - s[last] = '\0'; - if (lost != '\0') { - CWARN("Truncated buf %d to '%s' (lost '%c'...)\n", - index, s, lost); - } - } - return s; -} - static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) { __u32 i; diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 8cc13ea..7d98485 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -107,6 +107,7 @@ typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *, struct llog_rec_hdr *, void *); /* obd_config.c */ +char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index); int class_process_config(struct lustre_cfg *lcfg); int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, struct lustre_cfg *lcfg, void *data); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 4c7c4f3..dc7b27e 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -170,6 +170,40 @@ int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh) } EXPORT_SYMBOL(class_parse_nid_quiet); +char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index) +{ + char *s; + + if (!lcfg->lcfg_buflens[index]) + return NULL; + + s = lustre_cfg_buf(lcfg, index); + if (!s) + return NULL; + + /* + * make sure it's NULL terminated, even if this kills a char + * of data. Try to use the padding first though. + */ + if (s[lcfg->lcfg_buflens[index] - 1] != '\0') { + size_t last = ALIGN(lcfg->lcfg_buflens[index], 8) - 1; + char lost; + + /* Use the smaller value */ + if (last > lcfg->lcfg_buflens[index]) + last = lcfg->lcfg_buflens[index]; + + lost = s[last]; + s[last] = '\0'; + if (lost != '\0') { + CWARN("Truncated buf %d to '%s' (lost '%c'...)\n", + index, s, lost); + } + } + return s; +} +EXPORT_SYMBOL(lustre_cfg_string); + /********************** class fns **********************/ /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index bb953d4..9143441 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -37,6 +37,7 @@ #include #include "../include/obd.h" +#include "../include/obd_class.h" #include "../include/obd_support.h" #include "../include/lustre_import.h" #include "../../include/uapi/linux/lustre/lustre_param.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:06 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:06 -0400 Subject: [lustre-devel] [PATCH 38/64] staging: lustre: lnet: remove userland function prototype in lnetctl.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-39-git-send-email-jsimmons@infradead.org> Several function prototypes of the form jt_ptl_* are only needed by userland so they can be removed. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: http://review.whamcloud.com/17643 Reviewed-by: Bob Glossman Reviewed-by: John L. Hammond Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lnet/lnetctl.h | 41 ---------------------- 1 file changed, 41 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index 2ce1c50..65b2bf8 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -131,45 +131,4 @@ struct lnet_fault_stat { #define SMFS_DEV_MAJOR 10 #define SMFS_DEV_MINOR 242 -int ptl_initialize(int argc, char **argv); -int jt_ptl_network(int argc, char **argv); -int jt_ptl_list_nids(int argc, char **argv); -int jt_ptl_which_nid(int argc, char **argv); -int jt_ptl_print_interfaces(int argc, char **argv); -int jt_ptl_add_interface(int argc, char **argv); -int jt_ptl_del_interface(int argc, char **argv); -int jt_ptl_print_peers(int argc, char **argv); -int jt_ptl_add_peer(int argc, char **argv); -int jt_ptl_del_peer(int argc, char **argv); -int jt_ptl_print_connections(int argc, char **argv); -int jt_ptl_disconnect(int argc, char **argv); -int jt_ptl_push_connection(int argc, char **argv); -int jt_ptl_print_active_txs(int argc, char **argv); -int jt_ptl_ping(int argc, char **argv); -int jt_ptl_mynid(int argc, char **argv); -int jt_ptl_add_uuid(int argc, char **argv); -int jt_ptl_add_uuid_old(int argc, char **argv); /* backwards compatibility */ -int jt_ptl_close_uuid(int argc, char **argv); -int jt_ptl_del_uuid(int argc, char **argv); -int jt_ptl_add_route(int argc, char **argv); -int jt_ptl_del_route(int argc, char **argv); -int jt_ptl_notify_router(int argc, char **argv); -int jt_ptl_print_routes(int argc, char **argv); -int jt_ptl_fail_nid(int argc, char **argv); -int jt_ptl_lwt(int argc, char **argv); -int jt_ptl_testprotocompat(int argc, char **argv); -int jt_ptl_memhog(int argc, char **argv); - -int dbg_initialize(int argc, char **argv); -int jt_dbg_filter(int argc, char **argv); -int jt_dbg_show(int argc, char **argv); -int jt_dbg_list(int argc, char **argv); -int jt_dbg_debug_kernel(int argc, char **argv); -int jt_dbg_debug_daemon(int argc, char **argv); -int jt_dbg_debug_file(int argc, char **argv); -int jt_dbg_clear_debug_buf(int argc, char **argv); -int jt_dbg_mark_debug_buf(int argc, char **argv); -int jt_dbg_modules(int argc, char **argv); -int jt_dbg_panic(int argc, char **argv); - #endif -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:16 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:16 -0400 Subject: [lustre-devel] [PATCH 48/64] staging: lustre: llite: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-49-git-send-email-jsimmons@infradead.org> Rationalize include paths in the llite source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/Makefile | 3 ++ drivers/staging/lustre/lustre/llite/dcache.c | 6 ++-- drivers/staging/lustre/lustre/llite/dir.c | 16 +++++----- drivers/staging/lustre/lustre/llite/file.c | 10 +++---- drivers/staging/lustre/lustre/llite/glimpse.c | 16 +++++----- drivers/staging/lustre/lustre/llite/lcommon_cl.c | 34 +++++++++++----------- drivers/staging/lustre/lustre/llite/lcommon_misc.c | 8 ++--- .../staging/lustre/lustre/llite/llite_internal.h | 20 ++++++------- drivers/staging/lustre/lustre/llite/llite_lib.c | 18 ++++++------ drivers/staging/lustre/lustre/llite/lproc_llite.c | 4 +-- drivers/staging/lustre/lustre/llite/namei.c | 6 ++-- drivers/staging/lustre/lustre/llite/range_lock.c | 2 +- drivers/staging/lustre/lustre/llite/range_lock.h | 4 +-- drivers/staging/lustre/lustre/llite/rw.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 4 +-- drivers/staging/lustre/lustre/llite/super25.c | 6 ++-- drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_internal.h | 4 +-- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_lock.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_object.c | 4 +-- drivers/staging/lustre/lustre/llite/xattr.c | 4 +-- drivers/staging/lustre/lustre/llite/xattr_cache.c | 4 +-- 23 files changed, 92 insertions(+), 89 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/Makefile b/drivers/staging/lustre/lustre/llite/Makefile index 322d4fa..ef7adef 100644 --- a/drivers/staging/lustre/lustre/llite/Makefile +++ b/drivers/staging/lustre/lustre/llite/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += lustre.o lustre-y := dcache.o dir.o file.o llite_lib.o llite_nfs.o \ rw.o rw26.o namei.o symlink.o llite_mmap.o range_lock.o \ diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index d38cb33..3670fca 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_dlm.h" +#include +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 4b46271..1db3e7f 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -44,14 +44,14 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_kernelcomm.h" -#include "../include/lustre_swab.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index adffc29..2c30e42 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -37,16 +37,16 @@ */ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/lustre_dlm.h" +#include #include #include #include #include -#include "../../include/uapi/linux/lustre/lustre_fiemap.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_swab.h" +#include +#include +#include -#include "../include/cl_object.h" +#include #include "llite_internal.h" static int diff --git a/drivers/staging/lustre/lustre/llite/glimpse.c b/drivers/staging/lustre/lustre/llite/glimpse.c index 0143112..34c2cfe 100644 --- a/drivers/staging/lustre/lustre/llite/glimpse.c +++ b/drivers/staging/lustre/lustre/llite/glimpse.c @@ -36,18 +36,18 @@ * Author: Oleg Drokin */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/obd.h" +#include +#include +#include +#include -#include "../include/lustre_dlm.h" -#include "../include/lustre_mdc.h" +#include +#include #include #include -#include "../include/cl_object.h" -#include "../llite/llite_internal.h" +#include +#include "llite_internal.h" static const struct cl_lock_descr whole_file = { .cld_start = 0, diff --git a/drivers/staging/lustre/lustre/llite/lcommon_cl.c b/drivers/staging/lustre/lustre/llite/lcommon_cl.c index 75e4b35..d2392e4 100644 --- a/drivers/staging/lustre/lustre/llite/lcommon_cl.c +++ b/drivers/staging/lustre/lustre/llite/lcommon_cl.c @@ -37,23 +37,23 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../../include/linux/libcfs/libcfs.h" -# include -# include -# include -# include -# include -# include -# include - -#include "../include/obd.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_mdc.h" -#include "../include/cl_object.h" - -#include "../llite/llite_internal.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "llite_internal.h" /* * ccc_ prefix stands for "Common Client Code". diff --git a/drivers/staging/lustre/lustre/llite/lcommon_misc.c b/drivers/staging/lustre/lustre/llite/lcommon_misc.c index 7f7f3f1..422f410 100644 --- a/drivers/staging/lustre/lustre/llite/lcommon_misc.c +++ b/drivers/staging/lustre/lustre/llite/lcommon_misc.c @@ -34,10 +34,10 @@ * */ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/obd.h" -#include "../include/cl_object.h" +#include +#include +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index a7f0d51..0287c75 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -32,18 +32,18 @@ #ifndef LLITE_INTERNAL_H #define LLITE_INTERNAL_H -#include "../include/lustre_debug.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/lustre_disk.h" /* for s2sbi */ -#include "../include/lustre_linkea.h" +#include +#include +#include /* for s2sbi */ +#include /* for struct cl_lock_descr and struct cl_io */ -#include "../include/lustre_patchless_compat.h" -#include "../include/lustre_compat.h" -#include "../include/cl_object.h" -#include "../include/lustre_lmv.h" -#include "../include/lustre_mdc.h" -#include "../include/lustre_intent.h" +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 3ab3a63..d855129 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -41,15 +41,15 @@ #include #include -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_dlm.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_disk.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_log.h" -#include "../include/cl_object.h" -#include "../include/obd_cksum.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "llite_internal.h" struct kmem_cache *ll_file_data_slab; diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index aeae667..e3bd2d1 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -31,9 +31,9 @@ */ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/lprocfs_status.h" +#include #include -#include "../include/obd_support.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 8dff523..1fd31e7 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -40,9 +40,9 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_dlm.h" +#include +#include +#include #include "llite_internal.h" static int ll_create_it(struct inode *dir, struct dentry *dentry, diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c b/drivers/staging/lustre/lustre/llite/range_lock.c index 3f232cd..a32598b 100644 --- a/drivers/staging/lustre/lustre/llite/range_lock.c +++ b/drivers/staging/lustre/lustre/llite/range_lock.c @@ -34,7 +34,7 @@ * Author: Bobi Jam */ #include "range_lock.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include /** * Initialize a range lock tree diff --git a/drivers/staging/lustre/lustre/llite/range_lock.h b/drivers/staging/lustre/lustre/llite/range_lock.h index 779091c..1e1519b 100644 --- a/drivers/staging/lustre/lustre/llite/range_lock.h +++ b/drivers/staging/lustre/lustre/llite/range_lock.h @@ -36,8 +36,8 @@ #ifndef _RANGE_LOCK_H #define _RANGE_LOCK_H -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/interval_tree.h" +#include +#include struct range_lock { struct interval_node rl_node; diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 166455e..e720905 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -51,7 +51,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_cksum.h" +#include #include "llite_internal.h" static void ll_ra_stats_inc_sbi(struct ll_sb_info *sbi, enum ra_stat which); diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 9bbca01..ea9d59f 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/lustre_dlm.h" +#include +#include #include "llite_internal.h" #define SA_OMITTED_ENTRY_MAX 8ULL diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c index 56f4b10..0da4af8 100644 --- a/drivers/staging/lustre/lustre/llite/super25.c +++ b/drivers/staging/lustre/lustre/llite/super25.c @@ -34,11 +34,11 @@ #include #include -#include "../include/lustre_ha.h" -#include "../include/lustre_dlm.h" +#include +#include #include #include -#include "../include/lprocfs_status.h" +#include #include "llite_internal.h" static struct kmem_cache *ll_inode_cachep; diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c index 2b60699..f9d9a16 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_dev.c +++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h index 53ff46c..adce0ff 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_internal.h +++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h @@ -37,8 +37,8 @@ #ifndef VVP_INTERNAL_H #define VVP_INTERNAL_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/cl_object.h" +#include +#include enum obd_notify_event; struct inode; diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index c5ba265..c83853f 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/vvp_lock.c b/drivers/staging/lustre/lustre/llite/vvp_lock.c index 07eb26c..e522f7c 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_lock.c +++ b/drivers/staging/lustre/lustre/llite/vvp_lock.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" +#include #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/vvp_object.c b/drivers/staging/lustre/lustre/llite/vvp_object.c index 9bfd72e..3953750 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_object.c +++ b/drivers/staging/lustre/lustre/llite/vvp_object.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 48bad7d..0be5562 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/lustre_dlm.h" +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c index fa11dd5..80ee392 100644 --- a/drivers/staging/lustre/lustre/llite/xattr_cache.c +++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c @@ -12,8 +12,8 @@ #include #include #include -#include "../include/obd_support.h" -#include "../include/lustre_dlm.h" +#include +#include #include "llite_internal.h" /* If we ever have hundreds of extended attributes, we might want to consider -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:27 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:27 -0400 Subject: [lustre-devel] [PATCH 59/64] staging: lustre: lnet: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-60-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lnet core source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/Makefile | 3 +++ drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 4 ++-- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-eq.c | 3 ++- drivers/staging/lustre/lnet/lnet/lib-md.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-me.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-msg.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-socket.c | 4 ++-- drivers/staging/lustre/lnet/lnet/lo.c | 3 ++- drivers/staging/lustre/lnet/lnet/module.c | 5 +++-- drivers/staging/lustre/lnet/lnet/net_fault.c | 4 ++-- drivers/staging/lustre/lnet/lnet/nidstrings.c | 4 ++-- drivers/staging/lustre/lnet/lnet/peer.c | 4 ++-- drivers/staging/lustre/lnet/lnet/router.c | 3 ++- drivers/staging/lustre/lnet/lnet/router_proc.c | 5 +++-- 18 files changed, 32 insertions(+), 24 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/Makefile b/drivers/staging/lustre/lnet/lnet/Makefile index 4c81fa1..fd8585c 100644 --- a/drivers/staging/lustre/lnet/lnet/Makefile +++ b/drivers/staging/lustre/lnet/lnet/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET) += lnet.o lnet-y := api-ni.o config.o nidstrings.o net_fault.o \ diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index a6f60c3..be2823f 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -33,7 +33,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include #include -#include "../../include/linux/lnet/lib-lnet.h" +#include static int accept_port = 988; static int accept_backlog = 127; diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 30c7ff6..ad83503 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -34,8 +34,8 @@ #include #include -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" +#include +#include #define D_LNI D_CONSOLE diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 933988d..26841a7 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -33,7 +33,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include #include -#include "../../include/linux/lnet/lib-lnet.h" +#include struct lnet_text_buf { /* tmp struct for parsing routes */ struct list_head ltb_list; /* stash on lists */ diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c index 9ebba4e..6b446a5 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-eq.c +++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c @@ -35,7 +35,8 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" + +#include /** * Create an event queue that has room for \a count number of events. diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c index f08e944..a0aef4b 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-md.c +++ b/drivers/staging/lustre/lnet/lnet/lib-md.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include /* must be called with lnet_res_lock held */ void diff --git a/drivers/staging/lustre/lnet/lnet/lib-me.c b/drivers/staging/lustre/lnet/lnet/lib-me.c index e9b3eed..f52a5e8 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-me.c +++ b/drivers/staging/lustre/lnet/lnet/lib-me.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include /** * Create and attach a match entry to the match list of \a portal. The new diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 20ebe24..d886504 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include #include #include diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c index 008ac50..d04875e 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-msg.c +++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include void lnet_build_unlink_event(struct lnet_libmd *md, struct lnet_event *ev) diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c index 3333272..5946848 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c @@ -31,7 +31,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include /* NB: add /proc interfaces in upcoming patches */ int portal_rotor = LNET_PTL_ROTOR_HASH_RT; diff --git a/drivers/staging/lustre/lnet/lnet/lib-socket.c b/drivers/staging/lustre/lnet/lnet/lib-socket.c index 800f4f6..7d0add0 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-socket.c +++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c @@ -40,8 +40,8 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" +#include +#include static int kernel_sock_unlocked_ioctl(struct file *filp, int cmd, unsigned long arg) diff --git a/drivers/staging/lustre/lnet/lnet/lo.c b/drivers/staging/lustre/lnet/lnet/lo.c index a7504b8..80c06f4 100644 --- a/drivers/staging/lustre/lnet/lnet/lo.c +++ b/drivers/staging/lustre/lnet/lnet/lo.c @@ -29,7 +29,8 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" + +#include static int lolnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg) diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 06fcfd2..7d12a7f 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -31,8 +31,9 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" + +#include +#include static int config_on_load; module_param(config_on_load, int, 0444); diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c index 166a311..03f3d18 100644 --- a/drivers/staging/lustre/lnet/lnet/net_fault.c +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c @@ -35,8 +35,8 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnetctl.h" +#include +#include #define LNET_MSG_MASK (LNET_PUT_BIT | LNET_ACK_BIT | \ LNET_GET_BIT | LNET_REPLY_BIT) diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index a91bbc4..7bd1e6f 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -36,8 +36,8 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lnet/nidstr.h" +#include +#include /* max value for numeric network address */ #define MAX_NUMERIC_VALUE 0xffffffff diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c index 301b275..4d55df8 100644 --- a/drivers/staging/lustre/lnet/lnet/peer.c +++ b/drivers/staging/lustre/lnet/lnet/peer.c @@ -34,8 +34,8 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" +#include +#include int lnet_peer_tables_create(void) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 12dd104..3df101b 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -18,8 +18,9 @@ */ #define DEBUG_SUBSYSTEM S_LNET + #include -#include "../../include/linux/lnet/lib-lnet.h" +#include #define LNET_NRB_TINY_MIN 512 /* min value for each CPT */ #define LNET_NRB_TINY (LNET_NRB_TINY_MIN * 4) diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index 72b80c5..4a994d1 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -18,8 +18,9 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" + +#include +#include /* * This is really lnet_proc.c. You might need to update sanity test 215 -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:49 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:49 -0400 Subject: [lustre-devel] [PATCH 21/64] staging: lustre: uapi: remove lustre_cfg_free wrapper In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-22-git-send-email-jsimmons@infradead.org> Replace all lustre_cfg_free() calls with direct kfree() call. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_cfg.h | 6 ------ drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_config.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 6 +++--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h index 8eb394e..3f280b5 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h @@ -246,12 +246,6 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd, return lcfg; } -static inline void lustre_cfg_free(struct lustre_cfg *lcfg) -{ - kfree(lcfg); - return; -} - static inline int lustre_cfg_sanity_check(void *buf, size_t len) { struct lustre_cfg *lcfg = (struct lustre_cfg *)buf; diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index eee0b66..3674788 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1303,7 +1303,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, prev_version, max_version, obdname, params); rc = class_process_config(lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); if (rc) CDEBUG(D_INFO, "process config for %s error %d\n", obdname, rc); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 783f9e0..4b5cd7d 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1262,7 +1262,7 @@ int class_config_llog_handler(const struct lu_env *env, lcfg_new->lcfg_nal = 0; /* illegal value for obsolete field */ rc = class_process_config(lcfg_new); - lustre_cfg_free(lcfg_new); + kfree(lcfg_new); if (inst) kfree(inst_name); @@ -1442,7 +1442,7 @@ int class_manual_cleanup(struct obd_device *obd) if (rc) CERROR("detach failed %d: %s\n", rc, obd->obd_name); out: - lustre_cfg_free(lcfg); + kfree(lcfg); return rc; } EXPORT_SYMBOL(class_manual_cleanup); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 555e67e..74de1fa 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -90,7 +90,7 @@ int lustre_process_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set(bufs, 3, &sb, sizeof(sb)); lcfg = lustre_cfg_new(LCFG_LOG_START, bufs); rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); kfree(bufs); @@ -128,7 +128,7 @@ int lustre_end_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set(&bufs, 2, cfg, sizeof(*cfg)); lcfg = lustre_cfg_new(LCFG_LOG_END, &bufs); rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); return rc; } EXPORT_SYMBOL(lustre_end_log); @@ -161,7 +161,7 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, lcfg = lustre_cfg_new(cmd, &bufs); lcfg->lcfg_nid = nid; rc = class_process_config(lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); return rc; } -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:18 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:18 -0400 Subject: [lustre-devel] [PATCH 50/64] staging: lustre: lov: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-51-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lov source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lov/Makefile | 3 ++ .../staging/lustre/lustre/lov/lov_cl_internal.h | 6 ++-- drivers/staging/lustre/lustre/lov/lov_dev.c | 2 +- drivers/staging/lustre/lustre/lov/lov_ea.c | 6 ++-- drivers/staging/lustre/lustre/lov/lov_internal.h | 4 +-- drivers/staging/lustre/lustre/lov/lov_merge.c | 4 +-- drivers/staging/lustre/lustre/lov/lov_obd.c | 32 +++++++++++----------- drivers/staging/lustre/lustre/lov/lov_offset.c | 4 +-- drivers/staging/lustre/lustre/lov/lov_pack.c | 10 +++---- drivers/staging/lustre/lustre/lov/lov_pool.c | 4 +-- drivers/staging/lustre/lustre/lov/lov_request.c | 6 ++-- drivers/staging/lustre/lustre/lov/lproc_lov.c | 4 +-- 12 files changed, 44 insertions(+), 41 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/Makefile b/drivers/staging/lustre/lustre/lov/Makefile index ea93add..3abfb4e 100644 --- a/drivers/staging/lustre/lustre/lov/Makefile +++ b/drivers/staging/lustre/lustre/lov/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += lov.o lov-y := lov_obd.o lov_pack.o lov_offset.o lov_merge.o \ lov_request.o lov_ea.o lov_dev.o lov_object.o lov_page.o \ diff --git a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h index 38281b2..89d92b0 100644 --- a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h @@ -42,10 +42,10 @@ #ifndef LOV_CL_INTERNAL_H #define LOV_CL_INTERNAL_H -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" -#include "../include/cl_object.h" +#include +#include #include "lov_internal.h" /** \defgroup lov lov diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c b/drivers/staging/lustre/lustre/lov/lov_dev.c index 531b4fe..cea5f9d 100644 --- a/drivers/staging/lustre/lustre/lov/lov_dev.c +++ b/drivers/staging/lustre/lustre/lov/lov_dev.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LOV /* class_name2obd() */ -#include "../include/obd_class.h" +#include #include "lov_cl_internal.h" #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index 530a4e9..1124fd5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -37,10 +37,10 @@ #define DEBUG_SUBSYSTEM S_LOV #include -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index 4d9437e..a21f074 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -33,8 +33,8 @@ #ifndef LOV_INTERNAL_H #define LOV_INTERNAL_H -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include /* * If we are unable to get the maximum object size from the OST in diff --git a/drivers/staging/lustre/lustre/lov/lov_merge.c b/drivers/staging/lustre/lustre/lov/lov_merge.c index 034b4fc..9163361 100644 --- a/drivers/staging/lustre/lustre/lov/lov_merge.c +++ b/drivers/staging/lustre/lustre/lov/lov_merge.c @@ -32,9 +32,9 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" +#include #include "lov_internal.h" /** Merge the lock value block(&lvb) attributes and KMS from each of the diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 953ed71..fefd3c5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -38,22 +38,22 @@ */ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" - -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" - -#include "../include/cl_object.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_mds.h" -#include "../include/lustre_net.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_swab.h" -#include "../include/lprocfs_status.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_offset.c b/drivers/staging/lustre/lustre/lov/lov_offset.c index ecca74f..899d12c 100644 --- a/drivers/staging/lustre/lustre/lov/lov_offset.c +++ b/drivers/staging/lustre/lustre/lov/lov_offset.c @@ -32,9 +32,9 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" +#include #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index fd346c5..24fb2a9 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -38,11 +38,11 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../include/lustre_net.h" -#include "../include/lustre_swab.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include +#include +#include +#include +#include #include "lov_cl_internal.h" #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index 39daa17..d774ee2 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -40,9 +40,9 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" +#include #include "lov_internal.h" #define pool_tgt(_p, _i) \ diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index 74aeb94..9d3b3f3 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -32,10 +32,10 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #include "lov_internal.h" static void lov_init_set(struct lov_request_set *set) diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index ce46821..9bb7e9e 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/lprocfs_status.h" -#include "../include/obd_class.h" +#include +#include #include #include "lov_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:21 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:21 -0400 Subject: [lustre-devel] [PATCH 53/64] staging: lustre: obdclass: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-54-git-send-email-jsimmons@infradead.org> Rationalize include paths in the obdclass source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/Makefile | 3 +++ drivers/staging/lustre/lustre/obdclass/cl_io.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/cl_object.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/cl_page.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/class_obd.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/debug.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/genops.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/kernelcomm.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/linkea.c | 6 +++--- .../lustre/lustre/obdclass/linux/linux-module.c | 14 +++++++------- .../lustre/lustre/obdclass/linux/linux-sysctl.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/llog.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 2 +- .../staging/lustre/lustre/obdclass/llog_internal.h | 2 +- drivers/staging/lustre/lustre/obdclass/llog_obd.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/llog_swab.c | 4 ++-- .../lustre/lustre/obdclass/lprocfs_counters.c | 4 ++-- .../staging/lustre/lustre/obdclass/lprocfs_status.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/lu_object.c | 20 ++++++++++---------- drivers/staging/lustre/lustre/obdclass/lu_ref.c | 10 +++++----- .../staging/lustre/lustre/obdclass/lustre_handles.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/lustre_peer.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/obd_config.c | 12 ++++++------ drivers/staging/lustre/lustre/obdclass/obd_mount.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/obdo.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/statfs_pack.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/uuid.c | 6 +++--- 28 files changed, 112 insertions(+), 109 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile b/drivers/staging/lustre/lustre/obdclass/Makefile index af570c0..fa0ad654 100644 --- a/drivers/staging/lustre/lustre/obdclass/Makefile +++ b/drivers/staging/lustre/lustre/obdclass/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += obdclass.o obdclass-y := linux/linux-module.o linux/linux-sysctl.o \ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c index ee7d677..2a70e21 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c @@ -37,12 +37,12 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include #include #include -#include "../include/cl_object.h" +#include #include "cl_internal.h" /***************************************************************************** diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c index a343e3a..20e6405 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c @@ -37,11 +37,11 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include #include -#include "../include/cl_object.h" +#include #include "cl_internal.h" static void cl_lock_trace0(int level, const struct lu_env *env, diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c index 08e55d4..95c7fa3 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c @@ -46,15 +46,15 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include /* class_put_type() */ -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include #include -#include "../../include/linux/libcfs/libcfs_hash.h" /* for cfs_hash stuff */ -#include "../include/cl_object.h" -#include "../include/lu_object.h" +#include /* for cfs_hash stuff */ +#include +#include #include "cl_internal.h" static struct kmem_cache *cl_env_kmem; diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c index 6b8c41b..3dc084c 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c @@ -37,12 +37,12 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include +#include +#include #include -#include "../include/cl_object.h" +#include #include "cl_internal.h" static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg); diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index dedad65..57c84e8 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -33,14 +33,14 @@ #define DEBUG_SUBSYSTEM S_CLASS # include -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lnet/lnetctl.h" -#include "../include/lustre_debug.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include #include -#include "../include/cl_object.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" +#include +#include #include "llog_internal.h" struct obd_device *obd_devs[MAX_OBD_DEVICES]; diff --git a/drivers/staging/lustre/lustre/obdclass/debug.c b/drivers/staging/lustre/lustre/obdclass/debug.c index 0bd4ad2..7964cad 100644 --- a/drivers/staging/lustre/lustre/obdclass/debug.c +++ b/drivers/staging/lustre/lustre/obdclass/debug.c @@ -38,9 +38,9 @@ #include -#include "../include/obd_support.h" -#include "../include/lustre_debug.h" -#include "../include/lustre_net.h" +#include +#include +#include #define LPDS sizeof(__u64) int block_debug_setup(void *addr, int len, __u64 off, __u64 id) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index fa0d38d..739bfb9 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -36,9 +36,9 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_kernelcomm.h" +#include +#include +#include spinlock_t obd_types_lock; diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index a0f65c4..8f0707a 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #define D_KUC D_OTHER -#include "../include/obd_support.h" -#include "../include/lustre_kernelcomm.h" +#include +#include /** * libcfs_kkuc_msg_put - send an message from kernel to userspace diff --git a/drivers/staging/lustre/lustre/obdclass/linkea.c b/drivers/staging/lustre/lustre/obdclass/linkea.c index d3e754a..9af86d3 100644 --- a/drivers/staging/lustre/lustre/obdclass/linkea.c +++ b/drivers/staging/lustre/lustre/obdclass/linkea.c @@ -26,9 +26,9 @@ * Author: Di Wang */ -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/obd.h" -#include "../include/lustre_linkea.h" +#include +#include +#include int linkea_data_new(struct linkea_data *ldata, struct lu_buf *buf) { diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 94af257..6df9111 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -60,13 +60,13 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/uapi/linux/lnet/lnetctl.h" -#include "../../include/obd_support.h" -#include "../../include/obd_class.h" -#include "../../include/lprocfs_status.h" -#include "../../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../../../include/uapi/linux/lustre/lustre_ver.h" +#include +#include +#include +#include +#include +#include +#include #define OBD_MAX_IOCTL_BUFFER 8192 diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c index 814334b..e92cccc 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c @@ -43,9 +43,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/obd_support.h" -#include "../../include/lprocfs_status.h" -#include "../../include/obd_class.h" +#include +#include +#include struct static_lustre_uintvalue_attr { struct { diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 736ea10..98021a2 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -43,9 +43,9 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/llog_swab.h" -#include "../include/lustre_log.h" -#include "../include/obd_class.h" +#include +#include +#include #include "llog_internal.h" /* diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c index 8f1533c..8fa9691 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c @@ -44,7 +44,7 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/obd_class.h" +#include #include "llog_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/llog_internal.h b/drivers/staging/lustre/lustre/obdclass/llog_internal.h index 21a93c7..8de90bc 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_internal.h +++ b/drivers/staging/lustre/lustre/obdclass/llog_internal.h @@ -33,7 +33,7 @@ #ifndef __LLOG_INTERNAL_H__ #define __LLOG_INTERNAL_H__ -#include "../include/lustre_log.h" +#include struct llog_process_info { struct llog_handle *lpi_loghandle; diff --git a/drivers/staging/lustre/lustre/obdclass/llog_obd.c b/drivers/staging/lustre/lustre/obdclass/llog_obd.c index 8574ad4..3c42de9 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_obd.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/obd_class.h" -#include "../include/lustre_log.h" +#include +#include #include "llog_internal.h" /* helper functions for calling the llog obd methods */ diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c index 016046d..d2d3114 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/llog_swab.h" -#include "../include/lustre_log.h" +#include +#include static void print_llogd_body(struct llogd_body *d) { diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c index 13aca5b..e482988 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c @@ -38,8 +38,8 @@ */ #include -#include "../include/lprocfs_status.h" -#include "../include/obd_support.h" +#include +#include void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount) { diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index b56a343..e79485b 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include +#include #include #include diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index bb9d514..304e987 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -40,19 +40,19 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include -# include +#include /* hash_long() */ -#include "../../include/linux/libcfs/libcfs_hash.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_disk.h" -#include "../include/lustre_fid.h" -#include "../include/lu_object.h" -#include "../include/cl_object.h" -#include "../include/lu_ref.h" +#include +#include +#include +#include +#include +#include +#include +#include #include enum { diff --git a/drivers/staging/lustre/lustre/obdclass/lu_ref.c b/drivers/staging/lustre/lustre/obdclass/lu_ref.c index e9f6040..fa690b2 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_ref.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_ref.c @@ -38,9 +38,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lu_ref.h" +#include +#include +#include +#include diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c index c9445e5..e1273c9 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_support.h" -#include "../include/lustre_handles.h" -#include "../include/lustre_lib.h" +#include +#include +#include static __u64 handle_base; #define HANDLE_INCR 7 diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c index ffa740a..2798d35 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c @@ -32,13 +32,13 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_net.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include +#include +#include #define NIDS_MAX 32 diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 32ffa25..94a940f 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -38,12 +38,12 @@ #include -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/llog_swab.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_log.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "llog_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 4e609b5..1256034 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -40,13 +40,13 @@ #define D_MOUNT (D_SUPER | D_CONFIG/*|D_WARNING */) #define PRINT_CMD CDEBUG -#include "../include/obd.h" -#include "../include/lustre_compat.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_log.h" -#include "../include/lustre_disk.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" +#include +#include +#include +#include +#include +#include +#include static int (*client_fill_super)(struct super_block *sb, struct vfsmount *mnt); diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c index be61460..7083f87 100644 --- a/drivers/staging/lustre/lustre/obdclass/obdo.c +++ b/drivers/staging/lustre/lustre/obdclass/obdo.c @@ -38,9 +38,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_obdo.h" +#include +#include +#include void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent) { diff --git a/drivers/staging/lustre/lustre/obdclass/statfs_pack.c b/drivers/staging/lustre/lustre/obdclass/statfs_pack.c index 4bad1fa..89abea2 100644 --- a/drivers/staging/lustre/lustre/obdclass/statfs_pack.c +++ b/drivers/staging/lustre/lustre/obdclass/statfs_pack.c @@ -37,10 +37,10 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/lustre_export.h" -#include "../include/lustre_net.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include +#include +#include void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs) { diff --git a/drivers/staging/lustre/lustre/obdclass/uuid.c b/drivers/staging/lustre/lustre/obdclass/uuid.c index abd9b1a..9b1872b 100644 --- a/drivers/staging/lustre/lustre/obdclass/uuid.c +++ b/drivers/staging/lustre/lustre/obdclass/uuid.c @@ -34,10 +34,10 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out) { -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:33 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:33 -0400 Subject: [lustre-devel] [PATCH 05/64] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-6-git-send-email-jsimmons@infradead.org> From: Ben Evans Move lu_fid functions into lustre/lustre_fid.h Move ost_id functions into lustre/lustre_ostid.h Fix indenting, include new headers as needed. Several inline functions in the header lustre_ostid.h are using debug macros instead of returning proper errors. Remove the debug macros and properly handle the returned error codes. Place both UAPI headers lustre_fid.h and lustre_ostid.h into the uapi directory. Signed-off-by: Ben Evans Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/22712 Reviewed-on: https://review.whamcloud.com/24569 Reviewed-by: James Simmons Reviewed-by: Frank Zago Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lustre/lustre_fid.h | 293 +++++++++++ .../include/uapi/linux/lustre/lustre_ostid.h | 236 +++++++++ .../lustre/lustre/include/lustre/lustre_idl.h | 541 +-------------------- drivers/staging/lustre/lustre/include/lustre_fid.h | 49 +- drivers/staging/lustre/lustre/include/lustre_fld.h | 1 + drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 2 + drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 + 7 files changed, 586 insertions(+), 538 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h new file mode 100644 index 0000000..9adc106 --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h @@ -0,0 +1,293 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * 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) 2011, 2014, Intel Corporation. + * + * Copyright 2016 Cray Inc, all rights reserved. + * Author: Ben Evans. + * + * all fid manipulation functions go here + * + * FIDS are globally unique within a Lustre filessytem, and are made up + * of three parts: sequence, Object ID, and version. + * + */ +#ifndef _UAPI_LUSTRE_FID_H_ +#define _UAPI_LUSTRE_FID_H_ + +#include "../../../../lustre/include/lustre/lustre_idl.h" + +/** returns fid object sequence */ +static inline __u64 fid_seq(const struct lu_fid *fid) +{ + return fid->f_seq; +} + +/** returns fid object id */ +static inline __u32 fid_oid(const struct lu_fid *fid) +{ + return fid->f_oid; +} + +/** returns fid object version */ +static inline __u32 fid_ver(const struct lu_fid *fid) +{ + return fid->f_ver; +} + +static inline void fid_zero(struct lu_fid *fid) +{ + memset(fid, 0, sizeof(*fid)); +} + +static inline __u64 fid_ver_oid(const struct lu_fid *fid) +{ + return (__u64)fid_ver(fid) << 32 | fid_oid(fid); +} + +static inline bool fid_seq_is_mdt0(__u64 seq) +{ + return seq == FID_SEQ_OST_MDT0; +} + +static inline bool fid_seq_is_mdt(__u64 seq) +{ + return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL; +}; + +static inline bool fid_seq_is_echo(__u64 seq) +{ + return seq == FID_SEQ_ECHO; +} + +static inline bool fid_is_echo(const struct lu_fid *fid) +{ + return fid_seq_is_echo(fid_seq(fid)); +} + +static inline bool fid_seq_is_llog(__u64 seq) +{ + return seq == FID_SEQ_LLOG; +} + +static inline bool fid_is_llog(const struct lu_fid *fid) +{ + /* file with OID == 0 is not llog but contains last oid */ + return fid_seq_is_llog(fid_seq(fid)) && fid_oid(fid) > 0; +} + +static inline bool fid_seq_is_rsvd(__u64 seq) +{ + return seq > FID_SEQ_OST_MDT0 && seq <= FID_SEQ_RSVD; +}; + +static inline bool fid_seq_is_special(__u64 seq) +{ + return seq == FID_SEQ_SPECIAL; +}; + +static inline bool fid_seq_is_local_file(__u64 seq) +{ + return seq == FID_SEQ_LOCAL_FILE || + seq == FID_SEQ_LOCAL_NAME; +}; + +static inline bool fid_seq_is_root(__u64 seq) +{ + return seq == FID_SEQ_ROOT; +} + +static inline bool fid_seq_is_dot(__u64 seq) +{ + return seq == FID_SEQ_DOT_LUSTRE; +} + +static inline bool fid_seq_is_default(__u64 seq) +{ + return seq == FID_SEQ_LOV_DEFAULT; +} + +static inline bool fid_is_mdt0(const struct lu_fid *fid) +{ + return fid_seq_is_mdt0(fid_seq(fid)); +} + +/** + * Check if a fid is igif or not. + * \param fid the fid to be tested. + * \return true if the fid is an igif; otherwise false. + */ +static inline bool fid_seq_is_igif(__u64 seq) +{ + return seq >= FID_SEQ_IGIF && seq <= FID_SEQ_IGIF_MAX; +} + +static inline bool fid_is_igif(const struct lu_fid *fid) +{ + return fid_seq_is_igif(fid_seq(fid)); +} + +/** + * Check if a fid is idif or not. + * \param fid the fid to be tested. + * \return true if the fid is an idif; otherwise false. + */ +static inline bool fid_seq_is_idif(__u64 seq) +{ + return seq >= FID_SEQ_IDIF && seq <= FID_SEQ_IDIF_MAX; +} + +static inline bool fid_is_idif(const struct lu_fid *fid) +{ + return fid_seq_is_idif(fid_seq(fid)); +} + +static inline bool fid_is_local_file(const struct lu_fid *fid) +{ + return fid_seq_is_local_file(fid_seq(fid)); +} + +static inline bool fid_seq_is_norm(__u64 seq) +{ + return (seq >= FID_SEQ_NORMAL); +} + +static inline bool fid_is_norm(const struct lu_fid *fid) +{ + return fid_seq_is_norm(fid_seq(fid)); +} + +/* convert an OST objid into an IDIF FID SEQ number */ +static inline __u64 fid_idif_seq(__u64 id, __u32 ost_idx) +{ + return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff); +} + +/* convert a packed IDIF FID into an OST objid */ +static inline __u64 fid_idif_id(__u64 seq, __u32 oid, __u32 ver) +{ + return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid; +} + +static inline __u32 idif_ost_idx(__u64 seq) +{ + return (seq >> 16) & 0xffff; +} + +/* extract ost index from IDIF FID */ +static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid) +{ + return idif_ost_idx(fid_seq(fid)); +} + +/** + * Get inode number from an igif. + * \param fid an igif to get inode number from. + * \return inode number for the igif. + */ +static inline ino_t lu_igif_ino(const struct lu_fid *fid) +{ + return fid_seq(fid); +} + +/** + * Get inode generation from an igif. + * \param fid an igif to get inode generation from. + * \return inode generation for the igif. + */ +static inline __u32 lu_igif_gen(const struct lu_fid *fid) +{ + return fid_oid(fid); +} + +/** + * Build igif from the inode number/generation. + */ +static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen) +{ + fid->f_seq = ino; + fid->f_oid = gen; + fid->f_ver = 0; +} + +/* + * Fids are transmitted across network (in the sender byte-ordering), + * and stored on disk in big-endian order. + */ +static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __cpu_to_le64(fid_seq(src)); + dst->f_oid = __cpu_to_le32(fid_oid(src)); + dst->f_ver = __cpu_to_le32(fid_ver(src)); +} + +static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __le64_to_cpu(fid_seq(src)); + dst->f_oid = __le32_to_cpu(fid_oid(src)); + dst->f_ver = __le32_to_cpu(fid_ver(src)); +} + +static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __cpu_to_be64(fid_seq(src)); + dst->f_oid = __cpu_to_be32(fid_oid(src)); + dst->f_ver = __cpu_to_be32(fid_ver(src)); +} + +static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __be64_to_cpu(fid_seq(src)); + dst->f_oid = __be32_to_cpu(fid_oid(src)); + dst->f_ver = __be32_to_cpu(fid_ver(src)); +} + +static inline bool fid_is_sane(const struct lu_fid *fid) +{ + return fid && ((fid_seq(fid) >= FID_SEQ_START && !fid_ver(fid)) || + fid_is_igif(fid) || fid_is_idif(fid) || + fid_seq_is_rsvd(fid_seq(fid))); +} + +static inline bool lu_fid_eq(const struct lu_fid *f0, const struct lu_fid *f1) +{ + return !memcmp(f0, f1, sizeof(*f0)); +} + +static inline int lu_fid_cmp(const struct lu_fid *f0, + const struct lu_fid *f1) +{ + if (fid_seq(f0) != fid_seq(f1)) + return fid_seq(f0) > fid_seq(f1) ? 1 : -1; + + if (fid_oid(f0) != fid_oid(f1)) + return fid_oid(f0) > fid_oid(f1) ? 1 : -1; + + if (fid_ver(f0) != fid_ver(f1)) + return fid_ver(f0) > fid_ver(f1) ? 1 : -1; + + return 0; +} +#endif diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h new file mode 100644 index 0000000..19fca61 --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h @@ -0,0 +1,236 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * 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) 2011, 2014, Intel Corporation. + * + * Copyright 2015 Cray Inc, all rights reserved. + * Author: Ben Evans. + * + * Define ost_id associated functions + */ + +#ifndef _UAPI_LUSTRE_OSTID_H_ +#define _UAPI_LUSTRE_OSTID_H_ + +#include "lustre_fid.h" +#include "../../../../lustre/include/lustre/lustre_idl.h" + +static inline __u64 lmm_oi_id(const struct ost_id *oi) +{ + return oi->oi.oi_id; +} + +static inline __u64 lmm_oi_seq(const struct ost_id *oi) +{ + return oi->oi.oi_seq; +} + +static inline void lmm_oi_set_seq(struct ost_id *oi, __u64 seq) +{ + oi->oi.oi_seq = seq; +} + +static inline void lmm_oi_set_id(struct ost_id *oi, __u64 oid) +{ + oi->oi.oi_id = oid; +} + +static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi, + const struct ost_id *src_oi) +{ + dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq); +} + +static inline void lmm_oi_cpu_to_le(struct ost_id *dst_oi, + const struct ost_id *src_oi) +{ + dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq); +} + +/* extract OST sequence (group) from a wire ost_id (id/seq) pair */ +static inline __u64 ostid_seq(const struct ost_id *ostid) +{ + if (fid_seq_is_mdt0(ostid->oi.oi_seq)) + return FID_SEQ_OST_MDT0; + + if (fid_seq_is_default(ostid->oi.oi_seq)) + return FID_SEQ_LOV_DEFAULT; + + if (fid_is_idif(&ostid->oi_fid)) + return FID_SEQ_OST_MDT0; + + return fid_seq(&ostid->oi_fid); +} + +/* extract OST objid from a wire ost_id (id/seq) pair */ +static inline __u64 ostid_id(const struct ost_id *ostid) +{ + if (fid_seq_is_mdt0(ostid->oi.oi_seq)) + return ostid->oi.oi_id & IDIF_OID_MASK; + + if (fid_seq_is_default(ostid->oi.oi_seq)) + return ostid->oi.oi_id; + + if (fid_is_idif(&ostid->oi_fid)) + return fid_idif_id(fid_seq(&ostid->oi_fid), + fid_oid(&ostid->oi_fid), 0); + + return fid_oid(&ostid->oi_fid); +} + +static inline void ostid_set_seq(struct ost_id *oi, __u64 seq) +{ + if (fid_seq_is_mdt0(seq) || fid_seq_is_default(seq)) { + oi->oi.oi_seq = seq; + } else { + oi->oi_fid.f_seq = seq; + /* + * Note: if f_oid + f_ver is zero, we need init it + * to be 1, otherwise, ostid_seq will treat this + * as old ostid (oi_seq == 0) + */ + if (!oi->oi_fid.f_oid && !oi->oi_fid.f_ver) + oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID; + } +} + +static inline void ostid_set_seq_mdt0(struct ost_id *oi) +{ + ostid_set_seq(oi, FID_SEQ_OST_MDT0); +} + +static inline void ostid_set_seq_echo(struct ost_id *oi) +{ + ostid_set_seq(oi, FID_SEQ_ECHO); +} + +static inline void ostid_set_seq_llog(struct ost_id *oi) +{ + ostid_set_seq(oi, FID_SEQ_LLOG); +} + +static inline void ostid_cpu_to_le(const struct ost_id *src_oi, + struct ost_id *dst_oi) +{ + if (fid_seq_is_mdt0(src_oi->oi.oi_seq)) { + dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq); + } else { + fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid); + } +} + +static inline void ostid_le_to_cpu(const struct ost_id *src_oi, + struct ost_id *dst_oi) +{ + if (fid_seq_is_mdt0(src_oi->oi.oi_seq)) { + dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq); + } else { + fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid); + } +} + +/** + * Sigh, because pre-2.4 uses + * struct lov_mds_md_v1 { + * ........ + * __u64 lmm_object_id; + * __u64 lmm_object_seq; + * ...... + * } + * to identify the LOV(MDT) object, and lmm_object_seq will + * be normal_fid, which make it hard to combine these conversion + * to ostid_to FID. so we will do lmm_oi/fid conversion separately + * + * We can tell the lmm_oi by this way, + * 1.8: lmm_object_id = {inode}, lmm_object_gr = 0 + * 2.1: lmm_object_id = {oid < 128k}, lmm_object_seq = FID_SEQ_NORMAL + * 2.4: lmm_oi.f_seq = FID_SEQ_NORMAL, lmm_oi.f_oid = {oid < 128k}, + * lmm_oi.f_ver = 0 + * + * But currently lmm_oi/lsm_oi does not have any "real" usages, + * except for printing some information, and the user can always + * get the real FID from LMA, besides this multiple case check might + * make swab more complicate. So we will keep using id/seq for lmm_oi. + */ + +static inline void fid_to_lmm_oi(const struct lu_fid *fid, + struct ost_id *oi) +{ + oi->oi.oi_id = fid_oid(fid); + oi->oi.oi_seq = fid_seq(fid); +} + +/** + * Unpack an OST object id/seq (group) into a FID. This is needed for + * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper + * FIDs. Note that if an id/seq is already in FID/IDIF format it will + * be passed through unchanged. Only legacy OST objects in "group 0" + * will be mapped into the IDIF namespace so that they can fit into the + * struct lu_fid fields without loss. + */ +static inline int ostid_to_fid(struct lu_fid *fid, const struct ost_id *ostid, + __u32 ost_idx) +{ + __u64 seq = ostid_seq(ostid); + + if (ost_idx > 0xffff) + return -EBADF; + + if (fid_seq_is_mdt0(seq)) { + __u64 oid = ostid_id(ostid); + + /* This is a "legacy" (old 1.x/2.early) OST object in "group 0" + * that we map into the IDIF namespace. It allows up to 2^48 + * objects per OST, as this is the object namespace that has + * been in production for years. This can handle create rates + * of 1M objects/s/OST for 9 years, or combinations thereof. + */ + if (oid >= IDIF_MAX_OID) + return -EBADF; + + fid->f_seq = fid_idif_seq(oid, ost_idx); + /* truncate to 32 bits by assignment */ + fid->f_oid = oid; + /* in theory, not currently used */ + fid->f_ver = oid >> 48; + } else if (!fid_seq_is_default(seq)) { + /* This is either an IDIF object, which identifies objects + * across all OSTs, or a regular FID. The IDIF namespace + * maps legacy OST objects into the FID namespace. In both + * cases, we just pass the FID through, no conversion needed. + */ + if (ostid->oi_fid.f_ver) + return -EBADF; + + *fid = ostid->oi_fid; + } + + return 0; +} +#endif /* _UAPI_LUSTRE_OSTID_H_ */ diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index d70495d..fab624e 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -74,7 +74,6 @@ /* Defn's shared with user-space. */ #include "lustre_user.h" -#include "lustre_errno.h" #include "../lustre_ver.h" /* @@ -217,34 +216,6 @@ enum { LUSTRE_FID_INIT_OID = 1UL }; -/** returns fid object sequence */ -static inline __u64 fid_seq(const struct lu_fid *fid) -{ - return fid->f_seq; -} - -/** returns fid object id */ -static inline __u32 fid_oid(const struct lu_fid *fid) -{ - return fid->f_oid; -} - -/** returns fid object version */ -static inline __u32 fid_ver(const struct lu_fid *fid) -{ - return fid->f_ver; -} - -static inline void fid_zero(struct lu_fid *fid) -{ - memset(fid, 0, sizeof(*fid)); -} - -static inline __u64 fid_ver_oid(const struct lu_fid *fid) -{ - return ((__u64)fid_ver(fid) << 32 | fid_oid(fid)); -} - /* copytool uses a 32b bitmask field to encode archive-Ids during register * with MDT thru kuc. * archive num = 0 => all @@ -313,451 +284,12 @@ enum dot_lustre_oid { FID_OID_DOT_LUSTRE_OBF = 2UL, }; -static inline bool fid_seq_is_mdt0(__u64 seq) -{ - return (seq == FID_SEQ_OST_MDT0); -} - -static inline bool fid_seq_is_mdt(__u64 seq) -{ - return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL; +/** OID for FID_SEQ_ROOT */ +enum root_oid { + FID_OID_ROOT = 1UL, + FID_OID_ECHO_ROOT = 2UL, }; -static inline bool fid_seq_is_echo(__u64 seq) -{ - return (seq == FID_SEQ_ECHO); -} - -static inline bool fid_is_echo(const struct lu_fid *fid) -{ - return fid_seq_is_echo(fid_seq(fid)); -} - -static inline bool fid_seq_is_llog(__u64 seq) -{ - return (seq == FID_SEQ_LLOG); -} - -static inline bool fid_is_llog(const struct lu_fid *fid) -{ - /* file with OID == 0 is not llog but contains last oid */ - return fid_seq_is_llog(fid_seq(fid)) && fid_oid(fid) > 0; -} - -static inline bool fid_seq_is_rsvd(__u64 seq) -{ - return (seq > FID_SEQ_OST_MDT0 && seq <= FID_SEQ_RSVD); -}; - -static inline bool fid_seq_is_special(__u64 seq) -{ - return seq == FID_SEQ_SPECIAL; -}; - -static inline bool fid_seq_is_local_file(__u64 seq) -{ - return seq == FID_SEQ_LOCAL_FILE || - seq == FID_SEQ_LOCAL_NAME; -}; - -static inline bool fid_seq_is_root(__u64 seq) -{ - return seq == FID_SEQ_ROOT; -} - -static inline bool fid_seq_is_dot(__u64 seq) -{ - return seq == FID_SEQ_DOT_LUSTRE; -} - -static inline bool fid_seq_is_default(__u64 seq) -{ - return seq == FID_SEQ_LOV_DEFAULT; -} - -static inline bool fid_is_mdt0(const struct lu_fid *fid) -{ - return fid_seq_is_mdt0(fid_seq(fid)); -} - -static inline void lu_root_fid(struct lu_fid *fid) -{ - fid->f_seq = FID_SEQ_ROOT; - fid->f_oid = 1; - fid->f_ver = 0; -} - -/** - * Check if a fid is igif or not. - * \param fid the fid to be tested. - * \return true if the fid is a igif; otherwise false. - */ -static inline bool fid_seq_is_igif(__u64 seq) -{ - return seq >= FID_SEQ_IGIF && seq <= FID_SEQ_IGIF_MAX; -} - -static inline bool fid_is_igif(const struct lu_fid *fid) -{ - return fid_seq_is_igif(fid_seq(fid)); -} - -/** - * Check if a fid is idif or not. - * \param fid the fid to be tested. - * \return true if the fid is a idif; otherwise false. - */ -static inline bool fid_seq_is_idif(__u64 seq) -{ - return seq >= FID_SEQ_IDIF && seq <= FID_SEQ_IDIF_MAX; -} - -static inline bool fid_is_idif(const struct lu_fid *fid) -{ - return fid_seq_is_idif(fid_seq(fid)); -} - -static inline bool fid_is_local_file(const struct lu_fid *fid) -{ - return fid_seq_is_local_file(fid_seq(fid)); -} - -static inline bool fid_seq_is_norm(__u64 seq) -{ - return (seq >= FID_SEQ_NORMAL); -} - -static inline bool fid_is_norm(const struct lu_fid *fid) -{ - return fid_seq_is_norm(fid_seq(fid)); -} - -/* convert an OST objid into an IDIF FID SEQ number */ -static inline __u64 fid_idif_seq(__u64 id, __u32 ost_idx) -{ - return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff); -} - -/* convert a packed IDIF FID into an OST objid */ -static inline __u64 fid_idif_id(__u64 seq, __u32 oid, __u32 ver) -{ - return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid; -} - -/* extract ost index from IDIF FID */ -static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid) -{ - return (fid_seq(fid) >> 16) & 0xffff; -} - -/* extract OST sequence (group) from a wire ost_id (id/seq) pair */ -static inline __u64 ostid_seq(const struct ost_id *ostid) -{ - if (fid_seq_is_mdt0(ostid->oi.oi_seq)) - return FID_SEQ_OST_MDT0; - - if (unlikely(fid_seq_is_default(ostid->oi.oi_seq))) - return FID_SEQ_LOV_DEFAULT; - - if (fid_is_idif(&ostid->oi_fid)) - return FID_SEQ_OST_MDT0; - - return fid_seq(&ostid->oi_fid); -} - -/* extract OST objid from a wire ost_id (id/seq) pair */ -static inline __u64 ostid_id(const struct ost_id *ostid) -{ - if (fid_seq_is_mdt0(ostid->oi.oi_seq)) - return ostid->oi.oi_id & IDIF_OID_MASK; - - if (unlikely(fid_seq_is_default(ostid->oi.oi_seq))) - return ostid->oi.oi_id; - - if (fid_is_idif(&ostid->oi_fid)) - return fid_idif_id(fid_seq(&ostid->oi_fid), - fid_oid(&ostid->oi_fid), 0); - - return fid_oid(&ostid->oi_fid); -} - -static inline void ostid_set_seq(struct ost_id *oi, __u64 seq) -{ - if (fid_seq_is_mdt0(seq) || fid_seq_is_default(seq)) { - oi->oi.oi_seq = seq; - } else { - oi->oi_fid.f_seq = seq; - /* Note: if f_oid + f_ver is zero, we need init it - * to be 1, otherwise, ostid_seq will treat this - * as old ostid (oi_seq == 0) - */ - if (oi->oi_fid.f_oid == 0 && oi->oi_fid.f_ver == 0) - oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID; - } -} - -static inline void ostid_set_seq_mdt0(struct ost_id *oi) -{ - ostid_set_seq(oi, FID_SEQ_OST_MDT0); -} - -static inline void ostid_set_seq_echo(struct ost_id *oi) -{ - ostid_set_seq(oi, FID_SEQ_ECHO); -} - -static inline void ostid_set_seq_llog(struct ost_id *oi) -{ - ostid_set_seq(oi, FID_SEQ_LLOG); -} - -/** - * Note: we need check oi_seq to decide where to set oi_id, - * so oi_seq should always be set ahead of oi_id. - */ -static inline int ostid_set_id(struct ost_id *oi, __u64 oid) -{ - if (fid_seq_is_mdt0(oi->oi.oi_seq)) { - if (oid >= IDIF_MAX_OID) - return -E2BIG; - oi->oi.oi_id = oid; - } else if (fid_is_idif(&oi->oi_fid)) { - if (oid >= IDIF_MAX_OID) - return -E2BIG; - oi->oi_fid.f_seq = fid_idif_seq(oid, - fid_idif_ost_idx(&oi->oi_fid)); - oi->oi_fid.f_oid = oid; - oi->oi_fid.f_ver = oid >> 48; - } else { - if (oid >= OBIF_MAX_OID) - return -E2BIG; - oi->oi_fid.f_oid = oid; - } - return 0; -} - -static inline int fid_set_id(struct lu_fid *fid, __u64 oid) -{ - if (unlikely(fid_seq_is_igif(fid->f_seq))) { - CERROR("bad IGIF, " DFID "\n", PFID(fid)); - return -EBADF; - } - - if (fid_is_idif(fid)) { - if (oid >= IDIF_MAX_OID) { - CERROR("Too large OID %#llx to set IDIF " DFID "\n", - (unsigned long long)oid, PFID(fid)); - return -EBADF; - } - fid->f_seq = fid_idif_seq(oid, fid_idif_ost_idx(fid)); - fid->f_oid = oid; - fid->f_ver = oid >> 48; - } else { - if (oid >= OBIF_MAX_OID) { - CERROR("Too large OID %#llx to set REG " DFID "\n", - (unsigned long long)oid, PFID(fid)); - return -EBADF; - } - fid->f_oid = oid; - } - return 0; -} - -/** - * Unpack an OST object id/seq (group) into a FID. This is needed for - * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper - * FIDs. Note that if an id/seq is already in FID/IDIF format it will - * be passed through unchanged. Only legacy OST objects in "group 0" - * will be mapped into the IDIF namespace so that they can fit into the - * struct lu_fid fields without loss. For reference see: - * http://wiki.old.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs - */ -static inline int ostid_to_fid(struct lu_fid *fid, struct ost_id *ostid, - __u32 ost_idx) -{ - __u64 seq = ostid_seq(ostid); - - if (ost_idx > 0xffff) { - CERROR("bad ost_idx, " DOSTID " ost_idx:%u\n", POSTID(ostid), - ost_idx); - return -EBADF; - } - - if (fid_seq_is_mdt0(seq)) { - __u64 oid = ostid_id(ostid); - - /* This is a "legacy" (old 1.x/2.early) OST object in "group 0" - * that we map into the IDIF namespace. It allows up to 2^48 - * objects per OST, as this is the object namespace that has - * been in production for years. This can handle create rates - * of 1M objects/s/OST for 9 years, or combinations thereof. - */ - if (oid >= IDIF_MAX_OID) { - CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n", - POSTID(ostid), ost_idx); - return -EBADF; - } - fid->f_seq = fid_idif_seq(oid, ost_idx); - /* truncate to 32 bits by assignment */ - fid->f_oid = oid; - /* in theory, not currently used */ - fid->f_ver = oid >> 48; - } else if (likely(!fid_seq_is_default(seq))) { - /* This is either an IDIF object, which identifies objects across - * all OSTs, or a regular FID. The IDIF namespace maps legacy - * OST objects into the FID namespace. In both cases, we just - * pass the FID through, no conversion needed. - */ - if (ostid->oi_fid.f_ver != 0) { - CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n", - POSTID(ostid), ost_idx); - return -EBADF; - } - *fid = ostid->oi_fid; - } - - return 0; -} - -/* pack any OST FID into an ostid (id/seq) for the wire/disk */ -static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid) -{ - if (unlikely(fid_seq_is_igif(fid->f_seq))) { - CERROR("bad IGIF, " DFID "\n", PFID(fid)); - return -EBADF; - } - - if (fid_is_idif(fid)) { - ostid_set_seq_mdt0(ostid); - ostid_set_id(ostid, fid_idif_id(fid_seq(fid), fid_oid(fid), - fid_ver(fid))); - } else { - ostid->oi_fid = *fid; - } - - return 0; -} - -/* Check whether the fid is for LAST_ID */ -static inline bool fid_is_last_id(const struct lu_fid *fid) -{ - return (fid_oid(fid) == 0); -} - -/** - * Get inode number from a igif. - * \param fid a igif to get inode number from. - * \return inode number for the igif. - */ -static inline ino_t lu_igif_ino(const struct lu_fid *fid) -{ - return fid_seq(fid); -} - -/** - * Get inode generation from a igif. - * \param fid a igif to get inode generation from. - * \return inode generation for the igif. - */ -static inline __u32 lu_igif_gen(const struct lu_fid *fid) -{ - return fid_oid(fid); -} - -/** - * Build igif from the inode number/generation. - */ -static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen) -{ - fid->f_seq = ino; - fid->f_oid = gen; - fid->f_ver = 0; -} - -/* - * Fids are transmitted across network (in the sender byte-ordering), - * and stored on disk in big-endian order. - */ -static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = cpu_to_le64(fid_seq(src)); - dst->f_oid = cpu_to_le32(fid_oid(src)); - dst->f_ver = cpu_to_le32(fid_ver(src)); -} - -static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = le64_to_cpu(fid_seq(src)); - dst->f_oid = le32_to_cpu(fid_oid(src)); - dst->f_ver = le32_to_cpu(fid_ver(src)); -} - -static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = cpu_to_be64(fid_seq(src)); - dst->f_oid = cpu_to_be32(fid_oid(src)); - dst->f_ver = cpu_to_be32(fid_ver(src)); -} - -static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = be64_to_cpu(fid_seq(src)); - dst->f_oid = be32_to_cpu(fid_oid(src)); - dst->f_ver = be32_to_cpu(fid_ver(src)); -} - -static inline bool fid_is_sane(const struct lu_fid *fid) -{ - return fid && - ((fid_seq(fid) >= FID_SEQ_START && fid_ver(fid) == 0) || - fid_is_igif(fid) || fid_is_idif(fid) || - fid_seq_is_rsvd(fid_seq(fid))); -} - -static inline bool lu_fid_eq(const struct lu_fid *f0, const struct lu_fid *f1) -{ - return memcmp(f0, f1, sizeof(*f0)) == 0; -} - -#define __diff_normalize(val0, val1) \ -({ \ - typeof(val0) __val0 = (val0); \ - typeof(val1) __val1 = (val1); \ - \ - (__val0 == __val1 ? 0 : __val0 > __val1 ? 1 : -1); \ -}) - -static inline int lu_fid_cmp(const struct lu_fid *f0, - const struct lu_fid *f1) -{ - return - __diff_normalize(fid_seq(f0), fid_seq(f1)) ?: - __diff_normalize(fid_oid(f0), fid_oid(f1)) ?: - __diff_normalize(fid_ver(f0), fid_ver(f1)); -} - -static inline void ostid_cpu_to_le(const struct ost_id *src_oi, - struct ost_id *dst_oi) -{ - if (fid_seq_is_mdt0(ostid_seq(src_oi))) { - dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq); - } else { - fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid); - } -} - -static inline void ostid_le_to_cpu(const struct ost_id *src_oi, - struct ost_id *dst_oi) -{ - if (fid_seq_is_mdt0(ostid_seq(src_oi))) { - dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq); - } else { - fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid); - } -} - /** @} lu_fid */ /** \defgroup lu_dir lu_dir @@ -1377,71 +909,6 @@ struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */ struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */ }; -/** - * Sigh, because pre-2.4 uses - * struct lov_mds_md_v1 { - * ........ - * __u64 lmm_object_id; - * __u64 lmm_object_seq; - * ...... - * } - * to identify the LOV(MDT) object, and lmm_object_seq will - * be normal_fid, which make it hard to combine these conversion - * to ostid_to FID. so we will do lmm_oi/fid conversion separately - * - * We can tell the lmm_oi by this way, - * 1.8: lmm_object_id = {inode}, lmm_object_gr = 0 - * 2.1: lmm_object_id = {oid < 128k}, lmm_object_seq = FID_SEQ_NORMAL - * 2.4: lmm_oi.f_seq = FID_SEQ_NORMAL, lmm_oi.f_oid = {oid < 128k}, - * lmm_oi.f_ver = 0 - * - * But currently lmm_oi/lsm_oi does not have any "real" usages, - * except for printing some information, and the user can always - * get the real FID from LMA, besides this multiple case check might - * make swab more complicate. So we will keep using id/seq for lmm_oi. - */ - -static inline void fid_to_lmm_oi(const struct lu_fid *fid, - struct ost_id *oi) -{ - oi->oi.oi_id = fid_oid(fid); - oi->oi.oi_seq = fid_seq(fid); -} - -static inline void lmm_oi_set_seq(struct ost_id *oi, __u64 seq) -{ - oi->oi.oi_seq = seq; -} - -static inline void lmm_oi_set_id(struct ost_id *oi, __u64 oid) -{ - oi->oi.oi_id = oid; -} - -static inline __u64 lmm_oi_id(const struct ost_id *oi) -{ - return oi->oi.oi_id; -} - -static inline __u64 lmm_oi_seq(const struct ost_id *oi) -{ - return oi->oi.oi_seq; -} - -static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi, - const struct ost_id *src_oi) -{ - dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq); -} - -static inline void lmm_oi_cpu_to_le(struct ost_id *dst_oi, - const struct ost_id *src_oi) -{ - dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq); -} - #define MAX_MD_SIZE \ (sizeof(struct lov_mds_md) + 4 * sizeof(struct lov_ost_data)) #define MIN_MD_SIZE \ diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 0446bec..7c51642 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -149,8 +149,9 @@ */ #include "../../include/linux/libcfs/libcfs.h" +#include "../../include/uapi/linux/lustre/lustre_fid.h" #include "lustre/lustre_idl.h" -#include "seq_range.h" +#include "../../include/uapi/linux/lustre/lustre_ostid.h" struct lu_env; struct lu_site; @@ -494,6 +495,52 @@ static inline int ostid_res_name_eq(const struct ost_id *oi, } } +/** + * Note: we need check oi_seq to decide where to set oi_id, + * so oi_seq should always be set ahead of oi_id. + */ +static inline int ostid_set_id(struct ost_id *oi, __u64 oid) +{ + if (fid_seq_is_mdt0(oi->oi.oi_seq)) { + if (oid >= IDIF_MAX_OID) + return -E2BIG; + oi->oi.oi_id = oid; + } else if (fid_is_idif(&oi->oi_fid)) { + if (oid >= IDIF_MAX_OID) + return -E2BIG; + oi->oi_fid.f_seq = fid_idif_seq(oid, + fid_idif_ost_idx(&oi->oi_fid)); + oi->oi_fid.f_oid = oid; + oi->oi_fid.f_ver = oid >> 48; + } else { + if (oid >= OBIF_MAX_OID) + return -E2BIG; + oi->oi_fid.f_oid = oid; + } + return 0; +} + +/* pack any OST FID into an ostid (id/seq) for the wire/disk */ +static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid) +{ + int rc = 0; + + if (fid_seq_is_igif(fid->f_seq)) + return -EBADF; + + if (fid_is_idif(fid)) { + u64 objid = fid_idif_id(fid_seq(fid), fid_oid(fid), + fid_ver(fid)); + + ostid_set_seq_mdt0(ostid); + rc = ostid_set_id(ostid, objid); + } else { + ostid->oi_fid = *fid; + } + + return rc; +} + /* The same as osc_build_res_name() */ static inline void ost_fid_build_resid(const struct lu_fid *fid, struct ldlm_res_id *resname) diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index 6ef1b03..f3c61d1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -40,6 +40,7 @@ #include "lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" +#include "seq_range.h" struct lu_client_fld; struct lu_server_fld; diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 2e3db5e..b8002e9 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -57,6 +57,8 @@ #define DEBUG_SUBSYSTEM S_LDLM +#include "../include/lustre/lustre_errno.h" + #include "../include/lustre_dlm.h" #include "../include/obd_class.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 1a3fa1b..dc775bb 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -38,6 +38,8 @@ # include # include +#include "../include/lustre/lustre_errno.h" + #include "../include/cl_object.h" #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:52 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:52 -0400 Subject: [lustre-devel] [PATCH 24/64] staging: lustre: obdclass: no need to check for kfree In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-25-git-send-email-jsimmons@infradead.org> In class_config_llog_handler() a flag, inst, was used to determine if it was safe to call kfree. Its not needed so remove the flag. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/obd_config.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index dc7b27e..32ffa25 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1142,7 +1142,7 @@ int class_config_llog_handler(const struct lu_env *env, char *inst_name = NULL; int inst_len = 0; size_t lcfg_len; - int inst = 0, swab = 0; + int swab = 0; lcfg = (struct lustre_cfg *)cfg_buf; if (lcfg->lcfg_version == __swab32(LUSTRE_CFG_VERSION)) { @@ -1233,7 +1233,6 @@ int class_config_llog_handler(const struct lu_env *env, if (clli && clli->cfg_instance && LUSTRE_CFG_BUFLEN(lcfg, 0) > 0) { - inst = 1; inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) + sizeof(clli->cfg_instance) * 2 + 4; inst_name = kasprintf(GFP_NOFS, "%s-%p", @@ -1304,9 +1303,7 @@ int class_config_llog_handler(const struct lu_env *env, rc = class_process_config(lcfg_new); kfree(lcfg_new); - - if (inst) - kfree(inst_name); + kfree(inst_name); break; } default: -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:08 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:08 -0400 Subject: [lustre-devel] [PATCH 40/64] staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-41-git-send-email-jsimmons@infradead.org> These are the last UAPI headers that contain libcfs.h which is internal kernel header. Since it is not available to user land remove libcfs.h and add the need headers that libcfs.h provided. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 3 ++- drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index d26c599..fe443f8 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -69,7 +69,8 @@ #ifndef _LUSTRE_IDL_H_ #define _LUSTRE_IDL_H_ -#include "../../../include/linux/libcfs/libcfs.h" +#include + #include "../../../include/uapi/linux/lnet/lnet-types.h" /* Defn's shared with user-space. */ #include "lustre_user.h" diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index edff8dc..bee93d0 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -43,6 +43,7 @@ */ #ifdef __KERNEL__ +# include # include # include # include /* snprintf() */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:10 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:10 -0400 Subject: [lustre-devel] [PATCH 42/64] staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-43-git-send-email-jsimmons@infradead.org> Now that lustre_ioctl.h is a UAPI header the kernel configuration option CONFIG_LUSTRE_OBD_MAX_IOCTL needs to be remove. The user land utilites will no longer be able to see this option and actually they never used this option before. Since this is the case setting the kernel configuration to something other than 8K could actually break things. The best option is just hard code it to 8K. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25246 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 1 - drivers/staging/lustre/lustre/Kconfig | 10 ---------- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 ++ 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 3060e4d..1f52477 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -56,7 +56,6 @@ enum md_echo_cmd { #define OBD_IOCTL_VERSION 0x00010004 #define OBD_DEV_BY_DEVNAME 0xffffd0de -#define OBD_MAX_IOCTL_BUFFER CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER struct obd_ioctl_data { __u32 ioc_len; diff --git a/drivers/staging/lustre/lustre/Kconfig b/drivers/staging/lustre/lustre/Kconfig index 9f5d75f..90d8269 100644 --- a/drivers/staging/lustre/lustre/Kconfig +++ b/drivers/staging/lustre/lustre/Kconfig @@ -31,16 +31,6 @@ config LUSTRE_FS See also http://wiki.lustre.org/ -config LUSTRE_OBD_MAX_IOCTL_BUFFER - int "Lustre obd max ioctl buffer bytes (default 8KB)" - depends on LUSTRE_FS - default 8192 - help - This option defines the maximum size of buffer in bytes that user space - applications can pass to Lustre kernel module through ioctl interface. - - If unsure, use default. - config LUSTRE_DEBUG_EXPENSIVE_CHECK bool "Enable Lustre DEBUG checks" depends on LUSTRE_FS diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index b2f5597..94af257 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -68,6 +68,8 @@ #include "../../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../../../include/uapi/linux/lustre/lustre_ver.h" +#define OBD_MAX_IOCTL_BUFFER 8192 + static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) { if (data->ioc_len > BIT(30)) { -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:12 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:12 -0400 Subject: [lustre-devel] [PATCH 44/64] staging: lustre: uapi: remove BIT macro from UAPI headers In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-45-git-send-email-jsimmons@infradead.org> The BIT macro is not available for UAPI headers so remove it from the lustre UAPI headers. Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lustre/lustre_idl.h | 38 +++++++++++----------- .../lustre/include/uapi/linux/lustre/lustre_user.h | 12 +++---- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index 9613f7c..cc59c1a 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -1554,8 +1554,8 @@ enum mds_op_bias { MDS_CREATE_VOLATILE = 1 << 10, MDS_OWNEROVERRIDE = 1 << 11, MDS_HSM_RELEASE = 1 << 12, - MDS_RENAME_MIGRATE = BIT(13), - MDS_CLOSE_LAYOUT_SWAP = BIT(14), + MDS_RENAME_MIGRATE = 1 << 13, + MDS_CLOSE_LAYOUT_SWAP = 1 << 14, }; /* instance of mdt_reint_rec */ @@ -1993,21 +1993,21 @@ struct ldlm_flock_wire { }; enum ldlm_intent_flags { - IT_OPEN = BIT(0), - IT_CREAT = BIT(1), - IT_OPEN_CREAT = BIT(1) | BIT(0), - IT_READDIR = BIT(2), - IT_GETATTR = BIT(3), - IT_LOOKUP = BIT(4), - IT_UNLINK = BIT(5), - IT_TRUNC = BIT(6), - IT_GETXATTR = BIT(7), - IT_EXEC = BIT(8), - IT_PIN = BIT(9), - IT_LAYOUT = BIT(10), - IT_QUOTA_DQACQ = BIT(11), - IT_QUOTA_CONN = BIT(12), - IT_SETXATTR = BIT(13), + IT_OPEN = 0x00000001, + IT_CREAT = 0x00000002, + IT_OPEN_CREAT = 0x00000003, + IT_READDIR = 0x00000004, + IT_GETATTR = 0x00000008, + IT_LOOKUP = 0x00000010, + IT_UNLINK = 0x00000020, + IT_TRUNC = 0x00000040, + IT_GETXATTR = 0x00000080, + IT_EXEC = 0x00000100, + IT_PIN = 0x00000200, + IT_LAYOUT = 0x00000400, + IT_QUOTA_DQACQ = 0x00000800, + IT_QUOTA_CONN = 0x00001000, + IT_SETXATTR = 0x00002000, }; struct ldlm_intent { @@ -2375,8 +2375,8 @@ enum llog_flag { LLOG_F_ZAP_WHEN_EMPTY = 0x1, LLOG_F_IS_CAT = 0x2, LLOG_F_IS_PLAIN = 0x4, - LLOG_F_EXT_JOBID = BIT(3), - LLOG_F_IS_FIXSIZE = BIT(4), + LLOG_F_EXT_JOBID = 0x8, + LLOG_F_IS_FIXSIZE = 0x10, /* * Note: Flags covered by LLOG_F_EXT_MASK will be inherited from diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h index ca720f1..2fcfe2b 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h @@ -645,7 +645,7 @@ struct if_quotactl { #define SWAP_LAYOUTS_CHECK_DV2 (1 << 1) #define SWAP_LAYOUTS_KEEP_MTIME (1 << 2) #define SWAP_LAYOUTS_KEEP_ATIME (1 << 3) -#define SWAP_LAYOUTS_CLOSE BIT(4) +#define SWAP_LAYOUTS_CLOSE (1 << 4) /* Swap XATTR_NAME_HSM as well, only on the MDT so far */ #define SWAP_LAYOUTS_MDS_HSM (1 << 31) @@ -792,15 +792,15 @@ static inline void hsm_set_cl_error(int *flags, int error) enum changelog_send_flag { /* Not yet implemented */ - CHANGELOG_FLAG_FOLLOW = BIT(0), + CHANGELOG_FLAG_FOLLOW = 0x01, /* * Blocking IO makes sense in case of slow user parsing of the records, * but it also prevents us from cleaning up if the records are not * consumed. */ - CHANGELOG_FLAG_BLOCK = BIT(1), + CHANGELOG_FLAG_BLOCK = 0x02, /* Pack jobid into the changelog records if available. */ - CHANGELOG_FLAG_JOBID = BIT(2), + CHANGELOG_FLAG_JOBID = 0x04, }; #define CR_MAXSIZE cfs_size_round(2 * NAME_MAX + 2 + \ @@ -981,8 +981,8 @@ struct ioc_data_version { __u64 idv_flags; /* See LL_DV_xxx */ }; -#define LL_DV_RD_FLUSH BIT(0) /* Flush dirty pages from clients */ -#define LL_DV_WR_FLUSH BIT(1) /* Flush all caching pages from clients */ +#define LL_DV_RD_FLUSH (1 << 0) /* Flush dirty pages from clients */ +#define LL_DV_WR_FLUSH (1 << 1) /* Flush all caching pages from clients */ #ifndef offsetof # define offsetof(typ, memb) ((unsigned long)((char *)&(((typ *)0)->memb))) -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:25 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:25 -0400 Subject: [lustre-devel] [PATCH 57/64] staging: lustre: lustre: cleanup paths for lustre UAPI headers In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-58-git-send-email-jsimmons@infradead.org> Rationalize include paths for the lustre uapi headers Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h | 6 +++--- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 2b7deaa..11b51d9 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -35,7 +35,7 @@ #include #include -#include "../../../uapi/linux/lustre/lustre_user.h" +#include /** \defgroup cfg cfg * diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h index dd3785a..2e7a8d1 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h @@ -37,7 +37,7 @@ #ifndef _UAPI_LUSTRE_FID_H_ #define _UAPI_LUSTRE_FID_H_ -#include "../../../uapi/linux/lustre/lustre_idl.h" +#include /** returns fid object sequence */ static inline __u64 fid_seq(const struct lu_fid *fid) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index cc59c1a..aac98db 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -70,10 +70,10 @@ #include #include -#include "../lnet/lnet-types.h" +#include /* Defn's shared with user-space. */ -#include "lustre_user.h" -#include "lustre_ver.h" +#include +#include /* * GENERAL STUFF diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 1f52477..9590864 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -31,7 +31,7 @@ #include #include #include -#include "../../../uapi/linux/lustre/lustre_idl.h" +#include #if !defined(__KERNEL__) && !defined(LUSTRE_UTILS) # error This file is for Lustre internal use only. diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h index 167d482..552b2fc 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h @@ -34,7 +34,7 @@ #ifndef _UAPI_LUSTRE_OSTID_H_ #define _UAPI_LUSTRE_OSTID_H_ -#include "lustre_fid.h" +#include static inline __u64 lmm_oi_id(const struct ost_id *oi) { diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h index 2fcfe2b..5e332e3 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h @@ -55,7 +55,7 @@ # include # include #endif /* __KERNEL__ */ -#include "lustre_fiemap.h" +#include /* * We need to always use 64bit version because the structure -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:48 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:48 -0400 Subject: [lustre-devel] [PATCH 20/64] staging: lustre: uapi: style cleanups for lustre_param.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-21-git-send-email-jsimmons@infradead.org> Remove the white space in the lustre_param.h header and align the code so its easier to read. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../include/uapi/linux/lustre/lustre_param.h | 67 +++++++++++----------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h index cab0056..1eab2ce 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h @@ -44,49 +44,50 @@ /****************** User-settable parameter keys *********************/ /* e.g. - tunefs.lustre --param="failover.node=192.168.0.13 at tcp0" /dev/sda - lctl conf_param testfs-OST0000 failover.node=3 at elan,192.168.0.3 at tcp0 - ... testfs-MDT0000.lov.stripesize=4M - ... testfs-OST0000.ost.client_cache_seconds=15 - ... testfs.sys.timeout= - ... testfs.llite.max_read_ahead_mb=16 -*/ + * tunefs.lustre --param="failover.node=192.168.0.13 at tcp0" /dev/sda + * lctl conf_param testfs-OST0000 failover.node=3 at elan,192.168.0.3 at tcp0 + * ... testfs-MDT0000.lov.stripesize=4M + * ... testfs-OST0000.ost.client_cache_seconds=15 + * ... testfs.sys.timeout= + * ... testfs.llite.max_read_ahead_mb=16 + */ /* System global or special params not handled in obd's proc * See mgs_write_log_sys() */ -#define PARAM_TIMEOUT "timeout=" /* global */ -#define PARAM_LDLM_TIMEOUT "ldlm_timeout=" /* global */ -#define PARAM_AT_MIN "at_min=" /* global */ -#define PARAM_AT_MAX "at_max=" /* global */ -#define PARAM_AT_EXTRA "at_extra=" /* global */ -#define PARAM_AT_EARLY_MARGIN "at_early_margin=" /* global */ -#define PARAM_AT_HISTORY "at_history=" /* global */ -#define PARAM_JOBID_VAR "jobid_var=" /* global */ -#define PARAM_MGSNODE "mgsnode=" /* only at mounttime */ -#define PARAM_FAILNODE "failover.node=" /* add failover nid */ -#define PARAM_FAILMODE "failover.mode=" /* initial mount only */ -#define PARAM_ACTIVE "active=" /* activate/deactivate */ -#define PARAM_NETWORK "network=" /* bind on nid */ -#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */ +#define PARAM_TIMEOUT "timeout=" /* global */ +#define PARAM_LDLM_TIMEOUT "ldlm_timeout=" /* global */ +#define PARAM_AT_MIN "at_min=" /* global */ +#define PARAM_AT_MAX "at_max=" /* global */ +#define PARAM_AT_EXTRA "at_extra=" /* global */ +#define PARAM_AT_EARLY_MARGIN "at_early_margin=" /* global */ +#define PARAM_AT_HISTORY "at_history=" /* global */ +#define PARAM_JOBID_VAR "jobid_var=" /* global */ +#define PARAM_MGSNODE "mgsnode=" /* only at mounttime */ +#define PARAM_FAILNODE "failover.node=" /* add failover nid */ +#define PARAM_FAILMODE "failover.mode=" /* initial mount only */ +#define PARAM_ACTIVE "active=" /* activate/deactivate */ +#define PARAM_NETWORK "network=" /* bind on nid */ +#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */ /* Prefixes for parameters handled by obd's proc methods (XXX_process_config) */ -#define PARAM_OST "ost." +#define PARAM_OST "ost." #define PARAM_OSD "osd." -#define PARAM_OSC "osc." -#define PARAM_MDT "mdt." -#define PARAM_MDD "mdd." -#define PARAM_MDC "mdc." +#define PARAM_OSC "osc." +#define PARAM_MDT "mdt." +#define PARAM_HSM "mdt.hsm." +#define PARAM_MDD "mdd." +#define PARAM_MDC "mdc." #define PARAM_LLITE "llite." -#define PARAM_LOV "lov." +#define PARAM_LOV "lov." #define PARAM_LOD "lod." #define PARAM_OSP "osp." -#define PARAM_SYS "sys." /* global */ -#define PARAM_SRPC "srpc." -#define PARAM_SRPC_FLVR "srpc.flavor." -#define PARAM_SRPC_UDESC "srpc.udesc.cli2mdt" -#define PARAM_SEC "security." -#define PARAM_QUOTA "quota." /* global */ +#define PARAM_SYS "sys." /* global */ +#define PARAM_SRPC "srpc." +#define PARAM_SRPC_FLVR "srpc.flavor." +#define PARAM_SRPC_UDESC "srpc.udesc.cli2mdt" +#define PARAM_SEC "security." +#define PARAM_QUOTA "quota." /* global */ /** @} param */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:01 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:01 -0400 Subject: [lustre-devel] [PATCH 33/64] staging: lustre: libcfs: create libcfs_debug.h UAPI header In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-34-git-send-email-jsimmons@infradead.org> Break out the parts from libcfs_debug.h that is used by both user land and kernel space into a new UAPI header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_debug.h | 104 +------------- .../lustre/include/uapi/linux/lnet/libcfs_debug.h | 149 +++++++++++++++++++++ 2 files changed, 151 insertions(+), 102 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index b7bd6e8..91d141d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -38,6 +38,8 @@ #ifndef __LIBCFS_DEBUG_H__ #define __LIBCFS_DEBUG_H__ +#include "../../uapi/linux/lnet/libcfs_debug.h" + /* * Debugging */ @@ -59,108 +61,6 @@ extern unsigned int libcfs_catastrophe; extern unsigned int libcfs_panic_on_lbug; -/** - * Format for debug message headers - */ -struct ptldebug_header { - __u32 ph_len; - __u32 ph_flags; - __u32 ph_subsys; - __u32 ph_mask; - __u16 ph_cpu_id; - __u16 ph_type; - /* time_t overflow in 2106 */ - __u32 ph_sec; - __u64 ph_usec; - __u32 ph_stack; - __u32 ph_pid; - __u32 ph_extern_pid; - __u32 ph_line_num; -} __packed; - -#define PH_FLAG_FIRST_RECORD 1 - -/* Debugging subsystems (32 bits, non-overlapping) */ -#define S_UNDEFINED 0x00000001 -#define S_MDC 0x00000002 -#define S_MDS 0x00000004 -#define S_OSC 0x00000008 -#define S_OST 0x00000010 -#define S_CLASS 0x00000020 -#define S_LOG 0x00000040 -#define S_LLITE 0x00000080 -#define S_RPC 0x00000100 -#define S_MGMT 0x00000200 -#define S_LNET 0x00000400 -#define S_LND 0x00000800 /* ALL LNDs */ -#define S_PINGER 0x00001000 -#define S_FILTER 0x00002000 -/* unused */ -#define S_ECHO 0x00008000 -#define S_LDLM 0x00010000 -#define S_LOV 0x00020000 -#define S_LQUOTA 0x00040000 -#define S_OSD 0x00080000 -#define S_LFSCK 0x00100000 -/* unused */ -/* unused */ -#define S_LMV 0x00800000 /* b_new_cmd */ -/* unused */ -#define S_SEC 0x02000000 /* upcall cache */ -#define S_GSS 0x04000000 /* b_new_cmd */ -/* unused */ -#define S_MGC 0x10000000 -#define S_MGS 0x20000000 -#define S_FID 0x40000000 /* b_new_cmd */ -#define S_FLD 0x80000000 /* b_new_cmd */ - -#define LIBCFS_DEBUG_SUBSYS_NAMES { \ - "undefined", "mdc", "mds", "osc", "ost", "class", "log", \ - "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", "", \ - "echo", "ldlm", "lov", "lquota", "osd", "lfsck", "", "", "lmv", \ - "", "sec", "gss", "", "mgc", "mgs", "fid", "fld", NULL } - -/* Debugging masks (32 bits, non-overlapping) */ -#define D_TRACE 0x00000001 /* ENTRY/EXIT markers */ -#define D_INODE 0x00000002 -#define D_SUPER 0x00000004 -#define D_EXT2 0x00000008 /* anything from ext2_debug */ -#define D_MALLOC 0x00000010 /* print malloc, free information */ -#define D_CACHE 0x00000020 /* cache-related items */ -#define D_INFO 0x00000040 /* general information */ -#define D_IOCTL 0x00000080 /* ioctl related information */ -#define D_NETERROR 0x00000100 /* network errors */ -#define D_NET 0x00000200 /* network communications */ -#define D_WARNING 0x00000400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */ -#define D_BUFFS 0x00000800 -#define D_OTHER 0x00001000 -#define D_DENTRY 0x00002000 -#define D_NETTRACE 0x00004000 -#define D_PAGE 0x00008000 /* bulk page handling */ -#define D_DLMTRACE 0x00010000 -#define D_ERROR 0x00020000 /* CERROR(...) == CDEBUG (D_ERROR, ...) */ -#define D_EMERG 0x00040000 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */ -#define D_HA 0x00080000 /* recovery and failover */ -#define D_RPCTRACE 0x00100000 /* for distributed debugging */ -#define D_VFSTRACE 0x00200000 -#define D_READA 0x00400000 /* read-ahead */ -#define D_MMAP 0x00800000 -#define D_CONFIG 0x01000000 -#define D_CONSOLE 0x02000000 -#define D_QUOTA 0x04000000 -#define D_SEC 0x08000000 -#define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */ -#define D_HSM 0x20000000 - -#define LIBCFS_DEBUG_MASKS_NAMES { \ - "trace", "inode", "super", "ext2", "malloc", "cache", "info", \ - "ioctl", "neterror", "net", "warning", "buffs", "other", \ - "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \ - "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \ - "console", "quota", "sec", "lfsck", "hsm", NULL } - -#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) - #ifndef DEBUG_SUBSYSTEM # define DEBUG_SUBSYSTEM S_UNDEFINED #endif diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h b/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h new file mode 100644 index 0000000..c4d9472 --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h @@ -0,0 +1,149 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2012, 2014, Intel Corporation. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * libcfs/include/libcfs/libcfs_debug.h + * + * Debug messages and assertions + * + */ + +#ifndef __UAPI_LIBCFS_DEBUG_H__ +#define __UAPI_LIBCFS_DEBUG_H__ + +/** + * Format for debug message headers + */ +struct ptldebug_header { + __u32 ph_len; + __u32 ph_flags; + __u32 ph_subsys; + __u32 ph_mask; + __u16 ph_cpu_id; + __u16 ph_type; + /* time_t overflow in 2106 */ + __u32 ph_sec; + __u64 ph_usec; + __u32 ph_stack; + __u32 ph_pid; + __u32 ph_extern_pid; + __u32 ph_line_num; +} __attribute__((packed)); + +#define PH_FLAG_FIRST_RECORD 1 + +/* Debugging subsystems (32 bits, non-overlapping) */ +#define S_UNDEFINED 0x00000001 +#define S_MDC 0x00000002 +#define S_MDS 0x00000004 +#define S_OSC 0x00000008 +#define S_OST 0x00000010 +#define S_CLASS 0x00000020 +#define S_LOG 0x00000040 +#define S_LLITE 0x00000080 +#define S_RPC 0x00000100 +#define S_MGMT 0x00000200 +#define S_LNET 0x00000400 +#define S_LND 0x00000800 /* ALL LNDs */ +#define S_PINGER 0x00001000 +#define S_FILTER 0x00002000 +#define S_LIBCFS 0x00004000 +#define S_ECHO 0x00008000 +#define S_LDLM 0x00010000 +#define S_LOV 0x00020000 +#define S_LQUOTA 0x00040000 +#define S_OSD 0x00080000 +#define S_LFSCK 0x00100000 +#define S_SNAPSHOT 0x00200000 +/* unused */ +#define S_LMV 0x00800000 /* b_new_cmd */ +/* unused */ +#define S_SEC 0x02000000 /* upcall cache */ +#define S_GSS 0x04000000 /* b_new_cmd */ +/* unused */ +#define S_MGC 0x10000000 +#define S_MGS 0x20000000 +#define S_FID 0x40000000 /* b_new_cmd */ +#define S_FLD 0x80000000 /* b_new_cmd */ + +#define LIBCFS_DEBUG_SUBSYS_NAMES { \ + "undefined", "mdc", "mds", "osc", "ost", "class", "log", \ + "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", \ + "libcfs", "echo", "ldlm", "lov", "lquota", "osd", "lfsck", \ + "snapshot", "", "lmv", "", "sec", "gss", "", "mgc", "mgs", \ + "fid", "fld", NULL } + +/* Debugging masks (32 bits, non-overlapping) */ +#define D_TRACE 0x00000001 /* ENTRY/EXIT markers */ +#define D_INODE 0x00000002 +#define D_SUPER 0x00000004 +#define D_EXT2 0x00000008 /* anything from ext2_debug */ +#define D_MALLOC 0x00000010 /* print malloc, free information */ +#define D_CACHE 0x00000020 /* cache-related items */ +#define D_INFO 0x00000040 /* general information */ +#define D_IOCTL 0x00000080 /* ioctl related information */ +#define D_NETERROR 0x00000100 /* network errors */ +#define D_NET 0x00000200 /* network communications */ +#define D_WARNING 0x00000400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */ +#define D_BUFFS 0x00000800 +#define D_OTHER 0x00001000 +#define D_DENTRY 0x00002000 +#define D_NETTRACE 0x00004000 +#define D_PAGE 0x00008000 /* bulk page handling */ +#define D_DLMTRACE 0x00010000 +#define D_ERROR 0x00020000 /* CERROR(...) == CDEBUG (D_ERROR, ...) */ +#define D_EMERG 0x00040000 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */ +#define D_HA 0x00080000 /* recovery and failover */ +#define D_RPCTRACE 0x00100000 /* for distributed debugging */ +#define D_VFSTRACE 0x00200000 +#define D_READA 0x00400000 /* read-ahead */ +#define D_MMAP 0x00800000 +#define D_CONFIG 0x01000000 +#define D_CONSOLE 0x02000000 +#define D_QUOTA 0x04000000 +#define D_SEC 0x08000000 +#define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */ +#define D_HSM 0x20000000 +#define D_SNAPSHOT 0x40000000 /* snapshot */ +#define D_LAYOUT 0x80000000 + +#define LIBCFS_DEBUG_MASKS_NAMES { \ + "trace", "inode", "super", "ext2", "malloc", "cache", "info", \ + "ioctl", "neterror", "net", "warning", "buffs", "other", \ + "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \ + "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \ + "console", "quota", "sec", "lfsck", "hsm", "snapshot", "layout",\ + NULL } + +#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) + +#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log" + +#endif /* __UAPI_LIBCFS_DEBUG_H__ */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:09 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:09 -0400 Subject: [lustre-devel] [PATCH 41/64] staging: lustre: uapi: migrate remaining uapi headers to uapi directory In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-42-git-send-email-jsimmons@infradead.org> Move all the remaining lustre headers shared between user land and kernel space to the uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25246 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h | 2 +- .../ll_fiemap.h => include/uapi/linux/lustre/lustre_fiemap.h} | 6 +----- .../{lustre/include => include/uapi/linux}/lustre/lustre_idl.h | 6 ++---- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 2 +- .../uapi/linux/lustre/lustre_kernelcomm.h} | 6 +++--- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h | 1 - .../{lustre/include => include/uapi/linux}/lustre/lustre_user.h | 2 +- .../{lustre/include => include/uapi/linux/lustre}/lustre_ver.h | 0 drivers/staging/lustre/lustre/fid/fid_internal.h | 2 +- drivers/staging/lustre/lustre/fid/fid_lib.c | 1 - drivers/staging/lustre/lustre/fld/fld_cache.c | 2 +- drivers/staging/lustre/lustre/fld/fld_internal.h | 2 +- drivers/staging/lustre/lustre/fld/fld_request.c | 2 +- drivers/staging/lustre/lustre/include/llog_swab.h | 3 ++- drivers/staging/lustre/lustre/include/lprocfs_status.h | 2 +- drivers/staging/lustre/lustre/include/lu_object.h | 2 +- drivers/staging/lustre/lustre/include/{lustre => }/lustre_errno.h | 0 drivers/staging/lustre/lustre/include/lustre_export.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fld.h | 2 +- drivers/staging/lustre/lustre/include/lustre_import.h | 2 +- drivers/staging/lustre/lustre/include/lustre_kernelcomm.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 4 ++-- drivers/staging/lustre/lustre/include/lustre_lmv.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 2 +- drivers/staging/lustre/lustre/include/lustre_mdc.h | 1 - drivers/staging/lustre/lustre/include/lustre_mds.h | 1 - drivers/staging/lustre/lustre/include/lustre_net.h | 4 ++-- drivers/staging/lustre/lustre/include/lustre_obdo.h | 2 +- drivers/staging/lustre/lustre/include/lustre_swab.h | 2 +- drivers/staging/lustre/lustre/include/obd.h | 2 +- drivers/staging/lustre/lustre/include/obd_cksum.h | 2 +- drivers/staging/lustre/lustre/include/obd_class.h | 1 - drivers/staging/lustre/lustre/include/seq_range.h | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 3 +-- drivers/staging/lustre/lustre/llite/dcache.c | 2 +- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/lcommon_cl.c | 1 - drivers/staging/lustre/lustre/llite/llite_internal.h | 2 +- drivers/staging/lustre/lustre/llite/namei.c | 1 - drivers/staging/lustre/lustre/llite/range_lock.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_internal.h | 2 +- drivers/staging/lustre/lustre/llite/xattr.c | 1 - drivers/staging/lustre/lustre/llite/xattr_cache.c | 1 - drivers/staging/lustre/lustre/lmv/lmv_fld.c | 1 - drivers/staging/lustre/lustre/lmv/lmv_intent.c | 1 - drivers/staging/lustre/lustre/lmv/lmv_internal.h | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 1 - drivers/staging/lustre/lustre/lov/lov_ea.c | 2 +- drivers/staging/lustre/lustre/lov/lov_internal.h | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 3 --- drivers/staging/lustre/lustre/lov/lov_request.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 3 +-- drivers/staging/lustre/lustre/mgc/mgc_internal.h | 1 - drivers/staging/lustre/lustre/obdclass/linkea.c | 2 +- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +- drivers/staging/lustre/lustre/obdclass/obdo.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 2 +- 66 files changed, 57 insertions(+), 80 deletions(-) rename drivers/staging/lustre/{lustre/include/lustre/ll_fiemap.h => include/uapi/linux/lustre/lustre_fiemap.h} (96%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_idl.h (99%) rename drivers/staging/lustre/{lustre/include/uapi_kernelcomm.h => include/uapi/linux/lustre/lustre_kernelcomm.h} (95%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_user.h (99%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_ver.h (100%) rename drivers/staging/lustre/lustre/include/{lustre => }/lustre_errno.h (100%) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 1533dcb..2b7deaa 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -35,7 +35,7 @@ #include #include -#include "../../../../lustre/include/lustre/lustre_user.h" +#include "../../../uapi/linux/lustre/lustre_user.h" /** \defgroup cfg cfg * diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h index 9adc106..dd3785a 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h @@ -37,7 +37,7 @@ #ifndef _UAPI_LUSTRE_FID_H_ #define _UAPI_LUSTRE_FID_H_ -#include "../../../../lustre/include/lustre/lustre_idl.h" +#include "../../../uapi/linux/lustre/lustre_idl.h" /** returns fid object sequence */ static inline __u64 fid_seq(const struct lu_fid *fid) diff --git a/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fiemap.h similarity index 96% rename from drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_fiemap.h index b8ad555..f5214dc3 100644 --- a/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fiemap.h @@ -29,8 +29,6 @@ * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * lustre/include/lustre/ll_fiemap.h - * * FIEMAP data structures and flags. This header file will be used until * fiemap.h is available in the upstream kernel. * @@ -41,10 +39,8 @@ #ifndef _LUSTRE_FIEMAP_H #define _LUSTRE_FIEMAP_H -#ifndef __KERNEL__ #include -#include -#endif +#include /* XXX: We use fiemap_extent::fe_reserved[0] */ #define fe_device fe_reserved[0] diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h similarity index 99% rename from drivers/staging/lustre/lustre/include/lustre/lustre_idl.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index fe443f8..b7c1a1e 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -29,8 +29,6 @@ * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * lustre/include/lustre/lustre_idl.h - * * Lustre wire protocol definitions. */ @@ -71,10 +69,10 @@ #include -#include "../../../include/uapi/linux/lnet/lnet-types.h" +#include "../lnet/lnet-types.h" /* Defn's shared with user-space. */ #include "lustre_user.h" -#include "../lustre_ver.h" +#include "lustre_ver.h" /* * GENERAL STUFF diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index c2c0b27..3060e4d 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -31,7 +31,7 @@ #include #include #include -#include "../../../../lustre/include/lustre/lustre_idl.h" +#include "../../../uapi/linux/lustre/lustre_idl.h" #if !defined(__KERNEL__) && !defined(LUSTRE_UTILS) # error This file is for Lustre internal use only. diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_kernelcomm.h similarity index 95% rename from drivers/staging/lustre/lustre/include/uapi_kernelcomm.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_kernelcomm.h index 5e99836..94dadbe 100644 --- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_kernelcomm.h @@ -34,8 +34,8 @@ * The definitions below are used in the kernel and userspace. */ -#ifndef __UAPI_KERNELCOMM_H__ -#define __UAPI_KERNELCOMM_H__ +#ifndef __UAPI_LUSTRE_KERNELCOMM_H__ +#define __UAPI_LUSTRE_KERNELCOMM_H__ #include @@ -91,4 +91,4 @@ struct lustre_kernelcomm { __u32 lk_flags; } __packed; -#endif /* __UAPI_KERNELCOMM_H__ */ +#endif /* __UAPI_LUSTRE_KERNELCOMM_H__ */ diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h index 19fca61..167d482 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h @@ -35,7 +35,6 @@ #define _UAPI_LUSTRE_OSTID_H_ #include "lustre_fid.h" -#include "../../../../lustre/include/lustre/lustre_idl.h" static inline __u64 lmm_oi_id(const struct ost_id *oi) { diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h similarity index 99% rename from drivers/staging/lustre/lustre/include/lustre/lustre_user.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h index bee93d0..ca720f1 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h @@ -55,7 +55,7 @@ # include # include #endif /* __KERNEL__ */ -#include "ll_fiemap.h" +#include "lustre_fiemap.h" /* * We need to always use 64bit version because the structure diff --git a/drivers/staging/lustre/lustre/include/lustre_ver.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ver.h similarity index 100% rename from drivers/staging/lustre/lustre/include/lustre_ver.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_ver.h diff --git a/drivers/staging/lustre/lustre/fid/fid_internal.h b/drivers/staging/lustre/lustre/fid/fid_internal.h index 5c53773..5f8d15b 100644 --- a/drivers/staging/lustre/lustre/fid/fid_internal.h +++ b/drivers/staging/lustre/lustre/fid/fid_internal.h @@ -36,7 +36,7 @@ #ifndef __FID_INTERNAL_H #define __FID_INTERNAL_H -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" /* Functions used internally in module. */ diff --git a/drivers/staging/lustre/lustre/fid/fid_lib.c b/drivers/staging/lustre/lustre/fid/fid_lib.c index 9eb4059..6ab06ef 100644 --- a/drivers/staging/lustre/lustre/fid/fid_lib.c +++ b/drivers/staging/lustre/lustre/fid/fid_lib.c @@ -41,7 +41,6 @@ #include "../../include/linux/libcfs/libcfs.h" #include -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_fid.h" /** diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c index adaa094..68d009b 100644 --- a/drivers/staging/lustre/lustre/fld/fld_cache.c +++ b/drivers/staging/lustre/lustre/fld/fld_cache.c @@ -45,7 +45,7 @@ #include "../include/obd.h" #include "../include/obd_class.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/obd_support.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h b/drivers/staging/lustre/lustre/fld/fld_internal.h index 4a7f0b7..3412c90 100644 --- a/drivers/staging/lustre/lustre/fld/fld_internal.h +++ b/drivers/staging/lustre/lustre/fld/fld_internal.h @@ -56,7 +56,7 @@ #ifndef __FLD_INTERNAL_H #define __FLD_INTERNAL_H -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" #include "../include/lustre_req_layout.h" diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c index 4cade7a..1282992 100644 --- a/drivers/staging/lustre/lustre/fld/fld_request.c +++ b/drivers/staging/lustre/lustre/fld/fld_request.c @@ -44,7 +44,7 @@ #include "../include/obd.h" #include "../include/obd_class.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/obd_support.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/include/llog_swab.h b/drivers/staging/lustre/lustre/include/llog_swab.h index fd7ffb1..25516d3 100644 --- a/drivers/staging/lustre/lustre/include/llog_swab.h +++ b/drivers/staging/lustre/lustre/include/llog_swab.h @@ -48,7 +48,8 @@ #ifndef _LLOG_SWAB_H_ #define _LLOG_SWAB_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" + struct lustre_cfg; void lustre_swab_lu_fid(struct lu_fid *fid); diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 694062a..f5abca8 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -45,7 +45,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/uapi/linux/lustre/lustre_cfg.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" struct lprocfs_vars { const char *name; diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index 2e70602..ea77d9c 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -36,7 +36,7 @@ #include #include #include "../../include/linux/libcfs/libcfs.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lu_ref.h" struct seq_file; diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_errno.h b/drivers/staging/lustre/lustre/include/lustre_errno.h similarity index 100% rename from drivers/staging/lustre/lustre/include/lustre/lustre_errno.h rename to drivers/staging/lustre/lustre/include/lustre_errno.h diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 6e7cc46..3502d15 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -43,7 +43,7 @@ */ #include "lprocfs_status.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lustre_dlm.h" enum obd_option { diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 7c51642..8998a34 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -150,7 +150,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/uapi/linux/lustre/lustre_fid.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/uapi/linux/lustre/lustre_ostid.h" struct lu_env; diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index f3c61d1..e335d88 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -38,7 +38,7 @@ * @{ */ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" #include "seq_range.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index f0c931c..0b54e28 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -44,7 +44,7 @@ */ #include "lustre_handles.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * Adaptive Timeout stuff diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h index 970610b..c06648f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h @@ -38,7 +38,7 @@ #define __LUSTRE_KERNELCOMM_H__ /* For declarations shared with userspace */ -#include "uapi_kernelcomm.h" +#include "../../include/uapi/linux/lustre/lustre_kernelcomm.h" /* prototype for callback function on kuc groups */ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index c68dd5d..a7a184f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -46,8 +46,8 @@ #include #include #include "../../include/linux/libcfs/libcfs.h" -#include "lustre/lustre_idl.h" -#include "lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../../include/uapi/linux/lustre/lustre_cfg.h" /* target.c */ diff --git a/drivers/staging/lustre/lustre/include/lustre_lmv.h b/drivers/staging/lustre/lustre/include/lustre_lmv.h index 5aa3645..f2b8574 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lmv.h +++ b/drivers/staging/lustre/lustre/include/lustre_lmv.h @@ -32,7 +32,7 @@ #ifndef _LUSTRE_LMV_H #define _LUSTRE_LMV_H -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" struct lmv_oinfo { struct lu_fid lmo_fid; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 35e37eb..70fdc0b 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -53,7 +53,7 @@ */ #include "obd_class.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #define LOG_NAME_LIMIT(logname, name) \ snprintf(logname, sizeof(logname), "LOGS/%s", name) diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h index 198ceb0..99abbde 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mdc.h +++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h @@ -50,7 +50,6 @@ #include "lustre_handles.h" #include "../../include/linux/libcfs/libcfs.h" #include "obd_class.h" -#include "lustre/lustre_idl.h" #include "lustre_lib.h" #include "lustre_dlm.h" #include "lustre_export.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_mds.h b/drivers/staging/lustre/lustre/include/lustre_mds.h index 23a7e4f..2a552ee 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mds.h +++ b/drivers/staging/lustre/lustre/include/lustre_mds.h @@ -45,7 +45,6 @@ #include "lustre_handles.h" #include "../../include/linux/libcfs/libcfs.h" -#include "lustre/lustre_idl.h" #include "lustre_lib.h" #include "lustre_dlm.h" #include "lustre_export.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index c0b5927..1ae7e83 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -54,7 +54,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/uapi/linux/lnet/nidstr.h" #include "../../include/linux/lnet/api.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lustre_ha.h" #include "lustre_sec.h" #include "lustre_import.h" @@ -63,7 +63,7 @@ #include "lustre_req_layout.h" #include "obd_support.h" -#include "lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" /* MD flags we _always_ use */ #define PTLRPC_MD_OPTIONS 0 diff --git a/drivers/staging/lustre/lustre/include/lustre_obdo.h b/drivers/staging/lustre/lustre/include/lustre_obdo.h index 1e12f8c..252191d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_obdo.h +++ b/drivers/staging/lustre/lustre/include/lustre_obdo.h @@ -35,7 +35,7 @@ #ifndef _LUSTRE_OBDO_H_ #define _LUSTRE_OBDO_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * Create an obdo to send over the wire diff --git a/drivers/staging/lustre/lustre/include/lustre_swab.h b/drivers/staging/lustre/lustre/include/lustre_swab.h index 5c1bdc0..9e13afd 100644 --- a/drivers/staging/lustre/lustre/include/lustre_swab.h +++ b/drivers/staging/lustre/lustre/include/lustre_swab.h @@ -48,7 +48,7 @@ #ifndef _LUSTRE_SWAB_H_ #define _LUSTRE_SWAB_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); void lustre_swab_connect(struct obd_connect_data *ocd); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index 4dfc31e..aedc550 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -35,7 +35,7 @@ #include -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lustre_lib.h" #include "lu_ref.h" #include "lustre_export.h" diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h b/drivers/staging/lustre/lustre/include/obd_cksum.h index a8a81e6..54bde73 100644 --- a/drivers/staging/lustre/lustre/include/obd_cksum.h +++ b/drivers/staging/lustre/lustre/include/obd_cksum.h @@ -32,7 +32,7 @@ #define __OBD_CKSUM #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/libcfs/libcfs_crypto.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type) { diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 7d98485..6ae6479 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -37,7 +37,6 @@ #include "lustre_net.h" #include "obd.h" #include "lustre_lib.h" -#include "lustre/lustre_idl.h" #include "lprocfs_status.h" #define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay diff --git a/drivers/staging/lustre/lustre/include/seq_range.h b/drivers/staging/lustre/lustre/include/seq_range.h index 30c4dd6..74a9c63 100644 --- a/drivers/staging/lustre/lustre/include/seq_range.h +++ b/drivers/staging/lustre/lustre/include/seq_range.h @@ -34,7 +34,7 @@ #ifndef _SEQ_RANGE_H_ #define _SEQ_RANGE_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * computes the sequence range type \a range diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index b8002e9..5e04f05 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -57,8 +57,7 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre/lustre_errno.h" - +#include "../include/lustre_errno.h" #include "../include/lustre_dlm.h" #include "../include/obd_class.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index d20425f..d38cb33 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include "../include/obd_support.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_dlm.h" #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 71d1878..adffc29 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -42,7 +42,7 @@ #include #include #include -#include "../include/lustre/ll_fiemap.h" +#include "../../include/uapi/linux/lustre/lustre_fiemap.h" #include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_swab.h" diff --git a/drivers/staging/lustre/lustre/llite/lcommon_cl.c b/drivers/staging/lustre/lustre/llite/lcommon_cl.c index 96515b8..75e4b35 100644 --- a/drivers/staging/lustre/lustre/llite/lcommon_cl.c +++ b/drivers/staging/lustre/lustre/llite/lcommon_cl.c @@ -50,7 +50,6 @@ #include "../include/obd_support.h" #include "../include/lustre_fid.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "../include/lustre_mdc.h" #include "../include/cl_object.h" diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index cd3311a..a7f0d51 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -33,7 +33,7 @@ #ifndef LLITE_INTERNAL_H #define LLITE_INTERNAL_H #include "../include/lustre_debug.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/lustre_disk.h" /* for s2sbi */ #include "../include/lustre_linkea.h" diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index a208a8b..8dff523 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -43,7 +43,6 @@ #include "../include/obd_support.h" #include "../include/lustre_fid.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "llite_internal.h" static int ll_create_it(struct inode *dir, struct dentry *dentry, diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c b/drivers/staging/lustre/lustre/llite/range_lock.c index 161391b..3f232cd 100644 --- a/drivers/staging/lustre/lustre/llite/range_lock.c +++ b/drivers/staging/lustre/lustre/llite/range_lock.c @@ -34,7 +34,7 @@ * Author: Bobi Jam */ #include "range_lock.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * Initialize a range lock tree diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h index f40fd7f..53ff46c 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_internal.h +++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h @@ -37,7 +37,7 @@ #ifndef VVP_INTERNAL_H #define VVP_INTERNAL_H -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/cl_object.h" enum obd_notify_event; diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index d0cad7e..48bad7d 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -40,7 +40,6 @@ #include "../include/obd_support.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c index 82cf421..fa11dd5 100644 --- a/drivers/staging/lustre/lustre/llite/xattr_cache.c +++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c @@ -14,7 +14,6 @@ #include #include "../include/obd_support.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "llite_internal.h" /* If we ever have hundreds of extended attributes, we might want to consider diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c b/drivers/staging/lustre/lustre/lmv/lmv_fld.c index 6f8070f..1a7dd15 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c @@ -38,7 +38,6 @@ #include #include "../include/obd_support.h" -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_fid.h" #include "../include/lustre_lib.h" #include "../include/lustre_net.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index 5f01a0c..6b10bdd 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -39,7 +39,6 @@ #include #include "../include/lustre_intent.h" #include "../include/obd_support.h" -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_lib.h" #include "../include/lustre_net.h" #include "../include/lustre_dlm.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h index e839b83..ad109c0 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h +++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h @@ -33,7 +33,7 @@ #ifndef _LMV_INTERNAL_H_ #define _LMV_INTERNAL_H_ -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/obd.h" #include "../include/lustre_lmv.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index ab77dbe..f17221f 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -41,7 +41,6 @@ #include #include -#include "../include/lustre/lustre_idl.h" #include "../include/obd_support.h" #include "../include/lustre_net.h" #include "../include/obd_class.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index 2a8fee8..530a4e9 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -40,7 +40,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index 9905df2..4d9437e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -34,7 +34,7 @@ #define LOV_INTERNAL_H #include "../include/obd_class.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /* * If we are unable to get the maximum object size from the OST in diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 475bf7e..953ed71 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -40,7 +40,7 @@ #define DEBUG_SUBSYSTEM S_LOV #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/cl_object.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 638b764..fd346c5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -38,9 +38,6 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../include/lustre/lustre_idl.h" -#include "../include/lustre/lustre_user.h" - #include "../include/lustre_net.h" #include "../include/lustre_swab.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index 70636e5..74aeb94 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -35,7 +35,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lov_internal.h" static void lov_init_set(struct lov_request_set *set) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index aabdcec..bfd8fbe 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -32,7 +32,7 @@ #define DEBUG_SUBSYSTEM S_MDC #include "../include/lustre_net.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "mdc_internal.h" static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 4dcf3902..3556307 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -38,8 +38,7 @@ # include # include -#include "../include/lustre/lustre_errno.h" - +#include "../include/lustre_errno.h" #include "../include/cl_object.h" #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/mgc/mgc_internal.h b/drivers/staging/lustre/lustre/mgc/mgc_internal.h index f146f75..8cb6758 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_internal.h +++ b/drivers/staging/lustre/lustre/mgc/mgc_internal.h @@ -34,7 +34,6 @@ #define _MGC_INTERNAL_H #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_lib.h" #include "../include/lustre_dlm.h" #include "../include/lustre_log.h" diff --git a/drivers/staging/lustre/lustre/obdclass/linkea.c b/drivers/staging/lustre/lustre/obdclass/linkea.c index cf3ad04..d3e754a 100644 --- a/drivers/staging/lustre/lustre/obdclass/linkea.c +++ b/drivers/staging/lustre/lustre/obdclass/linkea.c @@ -26,7 +26,7 @@ * Author: Di Wang */ -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/obd.h" #include "../include/lustre_linkea.h" diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 1b5beea..b2f5597 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -66,7 +66,7 @@ #include "../../include/obd_class.h" #include "../../include/lprocfs_status.h" #include "../../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../../include/lustre_ver.h" +#include "../../../include/uapi/linux/lustre/lustre_ver.h" static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) { diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index ba41983..b56a343 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -38,7 +38,7 @@ #include "../include/obd_class.h" #include "../include/lprocfs_status.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include #include diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 5094829..4e609b5 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -43,7 +43,7 @@ #include "../include/obd.h" #include "../include/lustre_compat.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_log.h" #include "../include/lustre_disk.h" #include "../../include/uapi/linux/lustre/lustre_param.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c index b1dfa16..be61460 100644 --- a/drivers/staging/lustre/lustre/obdclass/obdo.c +++ b/drivers/staging/lustre/lustre/obdclass/obdo.c @@ -39,7 +39,7 @@ #define DEBUG_SUBSYSTEM S_CLASS #include "../include/obd_class.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_obdo.h" void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent) diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 453a59a..af96ac5 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -36,7 +36,7 @@ #include "../include/lustre_dlm.h" #include "../include/lustre_net.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/obd_cksum.h" #include "../include/lustre_ha.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 5810bba..6624c02 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -46,12 +46,12 @@ #include -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/llog_swab.h" #include "../include/lustre_debug.h" #include "../include/lustre_swab.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/obd.h" #include "../include/obd_support.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index c429613..ad2703b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -34,7 +34,7 @@ #include "../include/obd_support.h" #include "../include/obd.h" #include "../include/lprocfs_status.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_net.h" #include "../include/obd_class.h" #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index f116995..5d68fa9 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -42,7 +42,7 @@ #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/ll_fiemap.h" +#include "../../include/uapi/linux/lustre/lustre_fiemap.h" #include "../include/llog_swab.h" #include "../include/lustre_net.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:15 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:15 -0400 Subject: [lustre-devel] [PATCH 47/64] staging: lustre: ptlrpc: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-48-git-send-email-jsimmons@infradead.org> Rationalize include paths in the ptlrpc/ldlm source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/ldlm/interval_tree.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/l_lock.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 12 ++++++------ drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 12 ++++++------ drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_plain.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/Makefile | 3 +++ drivers/staging/lustre/lustre/ptlrpc/client.c | 12 ++++++------ drivers/staging/lustre/lustre/ptlrpc/connection.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/errno.c | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/events.c | 8 ++++---- drivers/staging/lustre/lustre/ptlrpc/import.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/layout.c | 18 +++++++++--------- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 8 ++++---- drivers/staging/lustre/lustre/ptlrpc/llog_net.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 12 ++++++------ drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/pers.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c | 8 ++++---- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 18 +++++++++--------- drivers/staging/lustre/lustre/ptlrpc/recover.c | 18 +++++++++--------- drivers/staging/lustre/lustre/ptlrpc/sec.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 20 ++++++++++---------- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 14 +++++++------- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/service.c | 11 ++++++----- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 8 ++++---- 40 files changed, 202 insertions(+), 198 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/interval_tree.c b/drivers/staging/lustre/lustre/ldlm/interval_tree.c index 5bebd9a..19e285d 100644 --- a/drivers/staging/lustre/lustre/ldlm/interval_tree.c +++ b/drivers/staging/lustre/lustre/ldlm/interval_tree.c @@ -34,9 +34,9 @@ * Author: Huang Wei * Author: Jay Xiong */ -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/interval_tree.h" +#include +#include +#include enum { INTERVAL_RED = 0, diff --git a/drivers/staging/lustre/lustre/ldlm/l_lock.c b/drivers/staging/lustre/lustre/ldlm/l_lock.c index 3845f38..57fd84e 100644 --- a/drivers/staging/lustre/lustre/ldlm/l_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/l_lock.c @@ -31,10 +31,10 @@ */ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/lustre_dlm.h" -#include "../include/lustre_lib.h" +#include +#include /** * Lock a lock and its resource. diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c index 08f97e2..2cc6dc2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c @@ -46,12 +46,12 @@ */ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" +#include +#include +#include +#include +#include +#include #include "ldlm_internal.h" /* When a lock is cancelled by a client, the KMS may undergo change if this diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index b7f28b3..39433ac 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -52,10 +52,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" +#include +#include +#include +#include #include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c b/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c index ae37c36..fcb6e44 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c @@ -49,9 +49,9 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/lustre_lib.h" +#include +#include +#include #include "ldlm_internal.h" void ldlm_ibits_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index 4dc7bae..22600c2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -39,12 +39,12 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include #include "ldlm_internal.h" /* @priority: If non-zero, move the selected connection to the list head. diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 181025d..b5d84f3 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -37,10 +37,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_intent.h" -#include "../include/lustre_swab.h" -#include "../include/obd_class.h" +#include +#include +#include +#include #include "ldlm_internal.h" /* lock types */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index e0c3e5d..895d07d 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -37,9 +37,9 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_class.h" +#include +#include +#include #include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c b/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c index 862ea0a..1ca605f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c @@ -48,9 +48,9 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/lustre_lib.h" +#include +#include +#include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index cf3fc57..d77bf0b 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -94,10 +94,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/cl_object.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include +#include +#include +#include #include "ldlm_internal.h" /* diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 5e04f05..d96a304 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -57,10 +57,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_errno.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_class.h" -#include "../include/obd.h" +#include +#include +#include +#include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 4e805e7..c2ddf73 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -36,9 +36,9 @@ */ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/obd_class.h" +#include +#include +#include #include "ldlm_internal.h" struct kmem_cache *ldlm_resource_slab, *ldlm_lock_slab; diff --git a/drivers/staging/lustre/lustre/ptlrpc/Makefile b/drivers/staging/lustre/lustre/ptlrpc/Makefile index 24bbac1..a518001 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/Makefile +++ b/drivers/staging/lustre/lustre/ptlrpc/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += ptlrpc.o LDLM := ../../lustre/ldlm/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 977d7a6..b1d379a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -34,12 +34,12 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_import.h" -#include "../include/lustre_req_layout.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/connection.c b/drivers/staging/lustre/lustre/ptlrpc/connection.c index 73a2dbb..cfdcbcec 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/connection.c +++ b/drivers/staging/lustre/lustre/ptlrpc/connection.c @@ -31,9 +31,9 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/errno.c b/drivers/staging/lustre/lustre/ptlrpc/errno.c index 73f8374..cb78836 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/errno.c +++ b/drivers/staging/lustre/lustre/ptlrpc/errno.c @@ -25,8 +25,8 @@ * Copyright (c) 2013, Intel Corporation. */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/lustre_errno.h" +#include +#include /* * The two translation tables below must define a one-to-one mapping between diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c index 978bdac..62951f1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/events.c +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c @@ -32,14 +32,14 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" +#include # ifdef __mips64__ # include # endif -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include #include "ptlrpc_internal.h" struct lnet_handle_eq ptlrpc_eq_h; diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index b19dac1..21f5289 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -36,14 +36,14 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_export.h" -#include "../include/obd.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 6624c02..85854d9 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -46,18 +46,18 @@ #include -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include -#include "../include/llog_swab.h" -#include "../include/lustre_debug.h" -#include "../include/lustre_swab.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/obd.h" -#include "../include/obd_support.h" +#include +#include +#include +#include +#include +#include /* struct ptlrpc_request, lustre_msg* */ -#include "../include/lustre_req_layout.h" -#include "../include/lustre_acl.h" +#include +#include /* * RQFs (see below) refer to two struct req_msg_field arrays describing the diff --git a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c index 110d9f5..480c20a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c @@ -38,11 +38,11 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../include/lustre_log.h" -#include "../include/lustre_net.h" +#include +#include +#include #include #define LLOG_CLIENT_ENTRY(ctxt, imp) do { \ diff --git a/drivers/staging/lustre/lustre/ptlrpc/llog_net.c b/drivers/staging/lustre/lustre/ptlrpc/llog_net.c index bccdace..bc5aa7b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/llog_net.c +++ b/drivers/staging/lustre/lustre/ptlrpc/llog_net.c @@ -42,10 +42,10 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../include/lustre_log.h" +#include +#include #include int llog_initiator_connect(struct llog_ctxt *ctxt) diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index ad2703b..1392ae9 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -31,12 +31,12 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_support.h" -#include "../include/obd.h" -#include "../include/lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_net.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" static struct ll_rpc_opcode { diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c index eddc192..12149fb 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c +++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c @@ -31,11 +31,11 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_lib.h" -#include "../include/obd.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c index ef19dbe..2969d8d 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c @@ -36,11 +36,11 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lprocfs_status.h" -#include "../../include/linux/libcfs/libcfs.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c index b123a93..df330e4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c @@ -43,9 +43,9 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../../include/linux/libcfs/libcfs.h" +#include +#include +#include #include "ptlrpc_internal.h" /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 5d68fa9..aad4ff1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -40,16 +40,16 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../../include/uapi/linux/lustre/lustre_fiemap.h" +#include -#include "../include/llog_swab.h" -#include "../include/lustre_net.h" -#include "../include/lustre_swab.h" -#include "../include/obd_cksum.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/pers.c b/drivers/staging/lustre/lustre/ptlrpc/pers.c index df4994f..643388b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pers.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pers.c @@ -32,11 +32,11 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_import.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 5504fc2..e4de50e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -36,8 +36,8 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include #include "ptlrpc_internal.h" struct mutex pinger_mutex; diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c index a70d584..38e488d 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c @@ -32,10 +32,10 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_req_layout.h" +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index 59b5813..0e47682 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -51,15 +51,15 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/lustre_net.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/obd_class.h" /* for obd_zombie */ -#include "../include/obd_support.h" /* for OBD_FAIL_CHECK */ -#include "../include/cl_object.h" /* cl_env_{get,put}() */ -#include "../include/lprocfs_status.h" +#include + +#include +#include +#include +#include /* for obd_zombie */ +#include /* for OBD_FAIL_CHECK */ +#include /* cl_env_{get,put}() */ +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/recover.c b/drivers/staging/lustre/lustre/ptlrpc/recover.c index 7b58545..72a19a3 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/recover.c +++ b/drivers/staging/lustre/lustre/ptlrpc/recover.c @@ -35,15 +35,15 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/obd_support.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_export.h" -#include "../include/obd.h" -#include "../include/obd_class.h" +#include + +#include +#include +#include +#include +#include +#include +#include #include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 366f2ce..cd7a539 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -36,19 +36,19 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index 128838a..059294a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -36,16 +36,16 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/obd.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_sec.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index 9143441..0f4af66 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -32,16 +32,16 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_import.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c index 026bec7..d10a805 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c @@ -36,12 +36,12 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c index 07273f5..7792132 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c @@ -34,16 +34,16 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index 70a61e1..dc39a54 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -36,11 +36,11 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../include/obd_support.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index c5e7a23..6aa9b65 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -36,11 +36,11 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../include/obd_support.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" struct plain_sec { diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index ca3d69e..155f6a4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -31,11 +31,12 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lu_object.h" -#include "../../include/uapi/linux/lnet/lnet-types.h" + +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" /* The following are visible and mutable through /sys/module/ptlrpc */ diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c index 311c526..07b86a1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c +++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c @@ -35,10 +35,10 @@ #include #include -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_disk.h" +#include +#include +#include +#include #include "ptlrpc_internal.h" void lustre_assert_wire_constants(void) -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:26 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:26 -0400 Subject: [lustre-devel] [PATCH 58/64] staging: lustre: lnet: selftest: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-59-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lnet selftest source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/selftest/Makefile | 3 +++ drivers/staging/lustre/lnet/selftest/conctl.c | 6 +++--- drivers/staging/lustre/lnet/selftest/conrpc.c | 4 ++-- drivers/staging/lustre/lnet/selftest/conrpc.h | 6 +++--- drivers/staging/lustre/lnet/selftest/console.c | 4 ++-- drivers/staging/lustre/lnet/selftest/console.h | 6 +++--- drivers/staging/lustre/lnet/selftest/rpc.h | 2 +- drivers/staging/lustre/lnet/selftest/selftest.h | 8 ++++---- 8 files changed, 21 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/Makefile b/drivers/staging/lustre/lnet/selftest/Makefile index c0de6e2..3ccc896 100644 --- a/drivers/staging/lustre/lnet/selftest/Makefile +++ b/drivers/staging/lustre/lnet/selftest/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET_SELFTEST) := lnet_selftest.o lnet_selftest-y := console.o conrpc.o conctl.o framework.o timer.o rpc.o \ diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 106304e..9619ecb 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -36,9 +36,9 @@ * Author: Liang Zhen */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include #include "console.h" static int diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index ae7c277..196d23c 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -36,8 +36,8 @@ * Author: Liang Zhen */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" +#include +#include #include "timer.h" #include "conrpc.h" #include "console.h" diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h index 501e1ec..2393236 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.h +++ b/drivers/staging/lustre/lnet/selftest/conrpc.h @@ -39,9 +39,9 @@ #ifndef __LST_CONRPC_H__ #define __LST_CONRPC_H__ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-types.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include #include "rpc.h" #include "selftest.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index d62c448..289b202 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -36,8 +36,8 @@ * Author: Liang Zhen */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" +#include +#include #include "console.h" #include "conrpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index d806214..143eae9 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -39,9 +39,9 @@ #ifndef __LST_CONSOLE_H__ #define __LST_CONSOLE_H__ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-types.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include #include "selftest.h" #include "conrpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h index 217ca21..7bb442a 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.h +++ b/drivers/staging/lustre/lnet/selftest/rpc.h @@ -33,7 +33,7 @@ #ifndef __SELFTEST_RPC_H__ #define __SELFTEST_RPC_H__ -#include "../../include/uapi/linux/lnet/lnetst.h" +#include /* * LST wired structures diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index 3777023..7adad43 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -38,10 +38,10 @@ #define LNET_ONLY -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-types.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include +#include #include "rpc.h" #include "timer.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:28 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:28 -0400 Subject: [lustre-devel] [PATCH 60/64] staging: lustre: ko2iblnd: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-61-git-send-email-jsimmons@infradead.org> Rationalize include paths in the ko2iblnd source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile | 3 +++ drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile b/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile index e0a7aa7..4affe1d 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET_XPRT_IB) += ko2iblnd.o ko2iblnd-y := o2iblnd.o o2iblnd_cb.o o2iblnd_modparams.o diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 8e59506..a1e994a 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -63,8 +63,8 @@ #define DEBUG_SUBSYSTEM S_LND -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lib-lnet.h" +#include +#include #define IBLND_PEER_HASH_SIZE 101 /* # peer lists */ /* # scheduler loops before reschedule */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:04 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:04 -0400 Subject: [lustre-devel] [PATCH 36/64] staging: lustre: lnet: migrate headers to lnet uapi directory In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-37-git-send-email-jsimmons@infradead.org> Migrate the headers used by user land and kernel space to the libcfs/lnet uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/linux/libcfs/libcfs.h | 2 +- drivers/staging/lustre/include/linux/lnet/api.h | 2 +- drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 8 ++++---- drivers/staging/lustre/include/linux/lnet/lib-types.h | 4 ++-- drivers/staging/lustre/include/linux/lnet/socklnd.h | 2 +- .../include/{linux/libcfs => uapi/linux/lnet}/libcfs_ioctl.h | 0 .../include/{linux/lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} | 4 ++-- .../include/{linux/lnet/types.h => uapi/linux/lnet/lnet-types.h} | 0 drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetctl.h | 2 +- drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetst.h | 0 drivers/staging/lustre/include/{ => uapi}/linux/lnet/nidstr.h | 2 +- drivers/staging/lustre/lnet/libcfs/module.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +- drivers/staging/lustre/lnet/lnet/module.c | 2 +- drivers/staging/lustre/lnet/lnet/net_fault.c | 2 +- drivers/staging/lustre/lnet/lnet/nidstrings.c | 2 +- drivers/staging/lustre/lnet/lnet/peer.c | 2 +- drivers/staging/lustre/lnet/selftest/conctl.c | 2 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 2 +- drivers/staging/lustre/lnet/selftest/console.h | 2 +- drivers/staging/lustre/lnet/selftest/rpc.h | 2 +- drivers/staging/lustre/lnet/selftest/selftest.h | 2 +- drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 3 +-- drivers/staging/lustre/lustre/include/lustre_disk.h | 1 - drivers/staging/lustre/lustre/include/lustre_net.h | 2 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 2 +- 28 files changed, 29 insertions(+), 31 deletions(-) rename drivers/staging/lustre/include/{linux/libcfs => uapi/linux/lnet}/libcfs_ioctl.h (100%) rename drivers/staging/lustre/include/{linux/lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} (98%) rename drivers/staging/lustre/include/{linux/lnet/types.h => uapi/linux/lnet/lnet-types.h} (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetctl.h (99%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetst.h (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/nidstr.h (99%) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index cc2c0e9..71bb55e 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -77,7 +77,7 @@ #include "libcfs_debug.h" #include "libcfs_cpu.h" #include "libcfs_private.h" -#include "libcfs_ioctl.h" +#include "../../uapi/linux/lnet/libcfs_ioctl.h" #include "libcfs_prim.h" #include "libcfs_time.h" #include "libcfs_string.h" diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h index f4b6de2..01ae62e 100644 --- a/drivers/staging/lustre/include/linux/lnet/api.h +++ b/drivers/staging/lustre/include/linux/lnet/api.h @@ -44,7 +44,7 @@ * @{ */ -#include "../lnet/types.h" +#include "../../uapi/linux/lnet/lnet-types.h" /** \defgroup lnet_init_fini Initialization and cleanup * The LNet must be properly initialized before any LNet calls can be made. diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 9b923ec..bc55d57 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -38,10 +38,10 @@ #include "../libcfs/libcfs.h" #include "api.h" #include "lib-types.h" -#include "lib-dlc.h" -#include "types.h" -#include "lnetctl.h" -#include "nidstr.h" +#include "../../uapi/linux/lnet/lnet-dlc.h" +#include "../../uapi/linux/lnet/lnet-types.h" +#include "../../uapi/linux/lnet/lnetctl.h" +#include "../../uapi/linux/lnet/nidstr.h" extern struct lnet the_lnet; /* THE network */ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index ddb808e..94d3a53 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -40,8 +40,8 @@ #include #include -#include "types.h" -#include "lnetctl.h" +#include "../../uapi/linux/lnet/lnet-types.h" +#include "../../uapi/linux/lnet/lnetctl.h" /* Max payload size */ #define LNET_MAX_PAYLOAD CONFIG_LNET_MAX_PAYLOAD diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h index 27ce6ce..c24fe45 100644 --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h @@ -34,7 +34,7 @@ #ifndef __LNET_LNET_SOCKLND_H__ #define __LNET_LNET_SOCKLND_H__ -#include "types.h" +#include "../../uapi/linux/lnet/lnet-types.h" #include "../../uapi/linux/lnet/socklnd.h" struct ksock_hello_msg { diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_ioctl.h similarity index 100% rename from drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h rename to drivers/staging/lustre/include/uapi/linux/lnet/libcfs_ioctl.h diff --git a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h similarity index 98% rename from drivers/staging/lustre/include/linux/lnet/lib-dlc.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h index dfff170..a3821d9 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h @@ -29,8 +29,8 @@ #ifndef LNET_DLC_H #define LNET_DLC_H -#include "../libcfs/libcfs_ioctl.h" -#include "types.h" +#include "libcfs_ioctl.h" +#include "lnet-types.h" #define MAX_NUM_SHOW_ENTRIES 32 #define LNET_MAX_STR_LEN 128 diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h similarity index 100% rename from drivers/staging/lustre/include/linux/lnet/types.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h diff --git a/drivers/staging/lustre/include/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h similarity index 99% rename from drivers/staging/lustre/include/linux/lnet/lnetctl.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index 3957507..2ce1c50 100644 --- a/drivers/staging/lustre/include/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -15,7 +15,7 @@ #ifndef _LNETCTL_H_ #define _LNETCTL_H_ -#include "types.h" +#include "lnet-types.h" /** \addtogroup lnet_fault_simulation * @{ diff --git a/drivers/staging/lustre/include/linux/lnet/lnetst.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetst.h similarity index 100% rename from drivers/staging/lustre/include/linux/lnet/lnetst.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnetst.h diff --git a/drivers/staging/lustre/include/linux/lnet/nidstr.h b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h similarity index 99% rename from drivers/staging/lustre/include/linux/lnet/nidstr.h rename to drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h index ecdd0db..d153c97 100644 --- a/drivers/staging/lustre/include/linux/lnet/nidstr.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h @@ -28,7 +28,7 @@ #ifndef _LNET_NIDSTRINGS_H #define _LNET_NIDSTRINGS_H -#include "types.h" +#include "lnet-types.h" /** * Lustre Network Driver types. diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index 9ece869..657c495 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -55,7 +55,7 @@ #include "../../include/linux/libcfs/libcfs_crypto.h" #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" #include "tracefile.h" static struct dentry *lnet_debugfs_root; diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 0b91d18..30c7ff6 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -35,7 +35,7 @@ #include #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" #define D_LNI D_CONSOLE diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 4ffbd3e..06fcfd2 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -32,7 +32,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" static int config_on_load; module_param(config_on_load, int, 0444); diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c index 18183cb..166a311 100644 --- a/drivers/staging/lustre/lnet/lnet/net_fault.c +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lnetctl.h" +#include "../../include/uapi/linux/lnet/lnetctl.h" #define LNET_MSG_MASK (LNET_PUT_BIT | LNET_ACK_BIT | \ LNET_GET_BIT | LNET_REPLY_BIT) diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index cbbd11f..a91bbc4 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/nidstr.h" +#include "../../include/uapi/linux/lnet/nidstr.h" /* max value for numeric network address */ #define MAX_NUMERIC_VALUE 0xffffffff diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c index e62b21f..301b275 100644 --- a/drivers/staging/lustre/lnet/lnet/peer.c +++ b/drivers/staging/lustre/lnet/lnet/peer.c @@ -35,7 +35,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" int lnet_peer_tables_create(void) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 043eafb..106304e 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -38,7 +38,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "console.h" static int diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h index e2a78b6..501e1ec 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.h +++ b/drivers/staging/lustre/lnet/selftest/conrpc.h @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-types.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "rpc.h" #include "selftest.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index 0a9ba06..d806214 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-types.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "selftest.h" #include "conrpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h index a765537..217ca21 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.h +++ b/drivers/staging/lustre/lnet/selftest/rpc.h @@ -33,7 +33,7 @@ #ifndef __SELFTEST_RPC_H__ #define __SELFTEST_RPC_H__ -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" /* * LST wired structures diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index bfa4971..3777023 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-lnet.h" #include "../../include/linux/lnet/lib-types.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "rpc.h" #include "timer.h" diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index fab624e..d26c599 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -70,8 +70,7 @@ #define _LUSTRE_IDL_H_ #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/types.h" - +#include "../../../include/uapi/linux/lnet/lnet-types.h" /* Defn's shared with user-space. */ #include "lustre_user.h" #include "../lustre_ver.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index 1a532ad..05cdc66 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -45,7 +45,6 @@ */ #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/types.h" #include /****************** persistent mount data *********************/ diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 05f02b1..c0b5927 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -52,7 +52,7 @@ #include #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/nidstr.h" +#include "../../include/uapi/linux/lnet/nidstr.h" #include "../../include/linux/lnet/api.h" #include "lustre/lustre_idl.h" #include "lustre_ha.h" diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index ed30333..dedad65 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -35,7 +35,7 @@ #include "../include/obd_support.h" #include "../include/obd_class.h" -#include "../../include/linux/lnet/lnetctl.h" +#include "../../include/uapi/linux/lnet/lnetctl.h" #include "../include/lustre_debug.h" #include "../include/lprocfs_status.h" #include diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 9f83345..1b5beea 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -61,7 +61,7 @@ #include #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lnetctl.h" +#include "../../../include/uapi/linux/lnet/lnetctl.h" #include "../../include/obd_support.h" #include "../../include/obd_class.h" #include "../../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index bcf5faf..ca3d69e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -35,7 +35,7 @@ #include "../include/obd_class.h" #include "../include/lustre_net.h" #include "../include/lu_object.h" -#include "../../include/linux/lnet/types.h" +#include "../../include/uapi/linux/lnet/lnet-types.h" #include "ptlrpc_internal.h" /* The following are visible and mutable through /sys/module/ptlrpc */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:07 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:07 -0400 Subject: [lustre-devel] [PATCH 39/64] staging: lustre: lnet: remove BIT macro from lnetctl.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-40-git-send-email-jsimmons@infradead.org> Now that lnetctl.h is a UAPI header the BIT macro has to be removed. Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index 65b2bf8..f7ffc53 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -32,10 +32,10 @@ enum { LNET_CTL_DELAY_LIST, }; -#define LNET_ACK_BIT BIT(0) -#define LNET_PUT_BIT BIT(1) -#define LNET_GET_BIT BIT(2) -#define LNET_REPLY_BIT BIT(3) +#define LNET_ACK_BIT (1 << 0) +#define LNET_PUT_BIT (1 << 1) +#define LNET_GET_BIT (1 << 2) +#define LNET_REPLY_BIT (1 << 3) /** ioctl parameter for LNet fault simulation */ struct lnet_fault_attr { -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:57 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:57 -0400 Subject: [lustre-devel] [PATCH 29/64] staging: lustre: uapi: style cleanup of lustre_cfg.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-30-git-send-email-jsimmons@infradead.org> Some style and white space cleanups to make lustre_cfg.h easy to read. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lustre/lustre_cfg.h | 110 +++++++++++---------- 1 file changed, 60 insertions(+), 50 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 4208d61..2d37d1b 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -57,48 +57,61 @@ * in order to mount the filesystem. If it does not understand * a REQUIRED command the client mount will fail. */ -#define LCFG_REQUIRED 0x0001000 +#define LCFG_REQUIRED 0x0001000 enum lcfg_command_type { - LCFG_ATTACH = 0x00cf001, /**< create a new obd instance */ - LCFG_DETACH = 0x00cf002, /**< destroy obd instance */ - LCFG_SETUP = 0x00cf003, /**< call type-specific setup */ - LCFG_CLEANUP = 0x00cf004, /**< call type-specific cleanup */ - LCFG_ADD_UUID = 0x00cf005, /**< add a nid to a niduuid */ - LCFG_DEL_UUID = 0x00cf006, /**< remove a nid from a niduuid */ - LCFG_MOUNTOPT = 0x00cf007, /**< create a profile (mdc, osc) */ - LCFG_DEL_MOUNTOPT = 0x00cf008, /**< destroy a profile */ - LCFG_SET_TIMEOUT = 0x00cf009, /**< set obd_timeout */ - LCFG_SET_UPCALL = 0x00cf00a, /**< deprecated */ - LCFG_ADD_CONN = 0x00cf00b, /**< add a failover niduuid to an obd */ - LCFG_DEL_CONN = 0x00cf00c, /**< remove a failover niduuid */ - LCFG_LOV_ADD_OBD = 0x00cf00d, /**< add an osc to a lov */ - LCFG_LOV_DEL_OBD = 0x00cf00e, /**< remove an osc from a lov */ - LCFG_PARAM = 0x00cf00f, /**< set a proc parameter */ - LCFG_MARKER = 0x00cf010, /**< metadata about next cfg rec */ - LCFG_LOG_START = 0x00ce011, /**< mgc only, process a cfg log */ - LCFG_LOG_END = 0x00ce012, /**< stop processing updates */ - LCFG_LOV_ADD_INA = 0x00ce013, /**< like LOV_ADD_OBD, inactive */ - LCFG_ADD_MDC = 0x00cf014, /**< add an mdc to a lmv */ - LCFG_DEL_MDC = 0x00cf015, /**< remove an mdc from a lmv */ - LCFG_SPTLRPC_CONF = 0x00ce016, /**< security */ - LCFG_POOL_NEW = 0x00ce020, /**< create an ost pool name */ - LCFG_POOL_ADD = 0x00ce021, /**< add an ost to a pool */ - LCFG_POOL_REM = 0x00ce022, /**< remove an ost from a pool */ - LCFG_POOL_DEL = 0x00ce023, /**< destroy an ost pool name */ - LCFG_SET_LDLM_TIMEOUT = 0x00ce030, /**< set ldlm_timeout */ - LCFG_PRE_CLEANUP = 0x00cf031, /**< call type-specific pre - * cleanup cleanup - */ - LCFG_SET_PARAM = 0x00ce032, /**< use set_param syntax to set - * a proc parameters - */ + LCFG_ATTACH = 0x00cf001, /**< create a new obd instance */ + LCFG_DETACH = 0x00cf002, /**< destroy obd instance */ + LCFG_SETUP = 0x00cf003, /**< call type-specific setup */ + LCFG_CLEANUP = 0x00cf004, /**< call type-specific cleanup + */ + LCFG_ADD_UUID = 0x00cf005, /**< add a nid to a niduuid */ + LCFG_DEL_UUID = 0x00cf006, /**< remove a nid from + * a niduuid + */ + LCFG_MOUNTOPT = 0x00cf007, /**< create a profile + * (mdc, osc) + */ + LCFG_DEL_MOUNTOPT = 0x00cf008, /**< destroy a profile */ + LCFG_SET_TIMEOUT = 0x00cf009, /**< set obd_timeout */ + LCFG_SET_UPCALL = 0x00cf00a, /**< deprecated */ + LCFG_ADD_CONN = 0x00cf00b, /**< add a failover niduuid to + * an obd + */ + LCFG_DEL_CONN = 0x00cf00c, /**< remove a failover niduuid */ + LCFG_LOV_ADD_OBD = 0x00cf00d, /**< add an osc to a lov */ + LCFG_LOV_DEL_OBD = 0x00cf00e, /**< remove an osc from a lov */ + LCFG_PARAM = 0x00cf00f, /**< set a proc parameter */ + LCFG_MARKER = 0x00cf010, /**< metadata about next + * cfg rec + */ + LCFG_LOG_START = 0x00ce011, /**< mgc only, process a + * cfg log + */ + LCFG_LOG_END = 0x00ce012, /**< stop processing updates */ + LCFG_LOV_ADD_INA = 0x00ce013, /**< like LOV_ADD_OBD, + * inactive + */ + LCFG_ADD_MDC = 0x00cf014, /**< add an mdc to a lmv */ + LCFG_DEL_MDC = 0x00cf015, /**< remove an mdc from a lmv */ + LCFG_SPTLRPC_CONF = 0x00ce016, /**< security */ + LCFG_POOL_NEW = 0x00ce020, /**< create an ost pool name */ + LCFG_POOL_ADD = 0x00ce021, /**< add an ost to a pool */ + LCFG_POOL_REM = 0x00ce022, /**< remove an ost from a pool */ + LCFG_POOL_DEL = 0x00ce023, /**< destroy an ost pool name */ + LCFG_SET_LDLM_TIMEOUT = 0x00ce030, /**< set ldlm_timeout */ + LCFG_PRE_CLEANUP = 0x00cf031, /**< call type-specific pre + * cleanup cleanup + */ + LCFG_SET_PARAM = 0x00ce032, /**< use set_param syntax to set + * a proc parameters + */ }; struct lustre_cfg_bufs { - void *lcfg_buf[LUSTRE_CFG_MAX_BUFCOUNT]; - __u32 lcfg_buflen[LUSTRE_CFG_MAX_BUFCOUNT]; - __u32 lcfg_bufcount; + void *lcfg_buf[LUSTRE_CFG_MAX_BUFCOUNT]; + __u32 lcfg_buflen[LUSTRE_CFG_MAX_BUFCOUNT]; + __u32 lcfg_bufcount; }; struct lustre_cfg { @@ -115,40 +128,37 @@ struct lustre_cfg { }; enum cfg_record_type { - PORTALS_CFG_TYPE = 1, - LUSTRE_CFG_TYPE = 123, + PORTALS_CFG_TYPE = 1, + LUSTRE_CFG_TYPE = 123, }; -#define LUSTRE_CFG_BUFLEN(lcfg, idx) \ - ((lcfg)->lcfg_bufcount <= (idx) \ - ? 0 \ - : (lcfg)->lcfg_buflens[(idx)]) +#define LUSTRE_CFG_BUFLEN(lcfg, idx) \ + ((lcfg)->lcfg_bufcount <= (idx) ? 0 : (lcfg)->lcfg_buflens[(idx)]) static inline void lustre_cfg_bufs_set(struct lustre_cfg_bufs *bufs, - __u32 index, - void *buf, - __u32 buflen) + __u32 index, void *buf, __u32 buflen) { if (index >= LUSTRE_CFG_MAX_BUFCOUNT) return; + if (!bufs) return; if (bufs->lcfg_bufcount <= index) bufs->lcfg_bufcount = index + 1; - bufs->lcfg_buf[index] = buf; + bufs->lcfg_buf[index] = buf; bufs->lcfg_buflen[index] = buflen; } static inline void lustre_cfg_bufs_set_string(struct lustre_cfg_bufs *bufs, - __u32 index, - char *str) + __u32 index, char *str) { lustre_cfg_bufs_set(bufs, index, str, str ? strlen(str) + 1 : 0); } -static inline void lustre_cfg_bufs_reset(struct lustre_cfg_bufs *bufs, char *name) +static inline void lustre_cfg_bufs_reset(struct lustre_cfg_bufs *bufs, + char *name) { memset((bufs), 0, sizeof(*bufs)); if (name) -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:00 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:00 -0400 Subject: [lustre-devel] [PATCH 32/64] staging: lustre: libcfs: remove LOGL and LOGU macros In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-33-git-send-email-jsimmons@infradead.org> The macro LOGU is not used anymore and LOGL is used in one place. No reason to keep LOGL around anymore. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs_private.h | 14 -------------- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 4 +++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 005713b..709771d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -296,18 +296,4 @@ static inline size_t cfs_round_strlen(char *fset) return cfs_size_round((int)strlen(fset) + 1); } -#define LOGL(var, len, ptr) \ -do { \ - if (var) \ - memcpy((char *)ptr, (const char *)var, len); \ - ptr += cfs_size_round(len); \ -} while (0) - -#define LOGU(var, len, ptr) \ -do { \ - if (var) \ - memcpy((char *)var, (const char *)ptr, len); \ - ptr += cfs_size_round(len); \ -} while (0) - #endif diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 55e8696e..f116995 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -186,7 +186,9 @@ void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, __u32 *lens, for (i = 0; i < count; i++) { char *tmp = bufs[i]; - LOGL(tmp, lens[i], ptr); + if (tmp) + memcpy(ptr, tmp, lens[i]); + ptr += cfs_size_round(lens[i]); } } EXPORT_SYMBOL(lustre_init_msg_v2); -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:03 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:03 -0400 Subject: [lustre-devel] [PATCH 35/64] staging: lustre: lnet: delete lnet.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-36-git-send-email-jsimmons@infradead.org> The header lnet.h is just a bunch of headers included in a header. Just delete it and include the appropriate headers where needed. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 4 +- drivers/staging/lustre/include/linux/lnet/lnet.h | 44 ---------------------- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 1 - .../staging/lustre/lnet/klnds/socklnd/socklnd.h | 1 - drivers/staging/lustre/lnet/libcfs/module.c | 1 - drivers/staging/lustre/lnet/lnet/nidstrings.c | 2 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 1 - drivers/staging/lustre/lnet/selftest/console.h | 1 - drivers/staging/lustre/lnet/selftest/selftest.h | 1 - 9 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 drivers/staging/lustre/include/linux/lnet/lnet.h diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index f534115..9b923ec 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -37,9 +37,11 @@ #include "../libcfs/libcfs.h" #include "api.h" -#include "lnet.h" #include "lib-types.h" #include "lib-dlc.h" +#include "types.h" +#include "lnetctl.h" +#include "nidstr.h" extern struct lnet the_lnet; /* THE network */ diff --git a/drivers/staging/lustre/include/linux/lnet/lnet.h b/drivers/staging/lustre/include/linux/lnet/lnet.h deleted file mode 100644 index 5d1559a..0000000 --- a/drivers/staging/lustre/include/linux/lnet/lnet.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.gnu.org/licenses/gpl-2.0.html - * - * GPL HEADER END - */ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012 - 2015, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Seagate, Inc. - */ - -#ifndef __LNET_H__ -#define __LNET_H__ - -/* - * lnet.h - * - * User application interface file - */ -#include "types.h" -#include "nidstr.h" - -#endif diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 16e437b..8e59506 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -64,7 +64,6 @@ #define DEBUG_SUBSYSTEM S_LND #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lnet.h" #include "../../../include/linux/lnet/lib-lnet.h" #define IBLND_PEER_HASH_SIZE 101 /* # peer lists */ diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 9eb169d..88afe09 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -47,7 +47,6 @@ #include #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lnet.h" #include "../../../include/linux/lnet/lib-lnet.h" #include "../../../include/linux/lnet/socklnd.h" diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index c388550..9ece869 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -56,7 +56,6 @@ #include "../../include/linux/libcfs/libcfs_crypto.h" #include "../../include/linux/lnet/lib-lnet.h" #include "../../include/linux/lnet/lib-dlc.h" -#include "../../include/linux/lnet/lnet.h" #include "tracefile.h" static struct dentry *lnet_debugfs_root; diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index 298533d..cbbd11f 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" +#include "../../include/linux/lnet/nidstr.h" /* max value for numeric network address */ #define MAX_NUMERIC_VALUE 0xffffffff diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h index 7141d2c..e2a78b6 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.h +++ b/drivers/staging/lustre/lnet/selftest/conrpc.h @@ -40,7 +40,6 @@ #define __LST_CONRPC_H__ #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" #include "../../include/linux/lnet/lib-types.h" #include "../../include/linux/lnet/lnetst.h" #include "rpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index e3e11aa..0a9ba06 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -40,7 +40,6 @@ #define __LST_CONSOLE_H__ #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" #include "../../include/linux/lnet/lib-types.h" #include "../../include/linux/lnet/lnetst.h" #include "selftest.h" diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index b614e6f..bfa4971 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -39,7 +39,6 @@ #define LNET_ONLY #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" #include "../../include/linux/lnet/lib-lnet.h" #include "../../include/linux/lnet/lib-types.h" #include "../../include/linux/lnet/lnetst.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:59 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:59 -0400 Subject: [lustre-devel] [PATCH 31/64] staging: lustre: libcfs: remove htonl hack in libcfs.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-32-git-send-email-jsimmons@infradead.org> This is really old hack for earlier gcc version that had a hard time compiling byteorder.h. Lets remove it. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index e774c75..005713b 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -154,18 +154,6 @@ /******************************************************************************/ -/* htonl hack - either this, or compile with -O2. Stupid byteorder/generic.h */ -#if defined(__GNUC__) && (__GNUC__ >= 2) && !defined(__OPTIMIZE__) -#define ___htonl(x) __cpu_to_be32(x) -#define ___htons(x) __cpu_to_be16(x) -#define ___ntohl(x) __be32_to_cpu(x) -#define ___ntohs(x) __be16_to_cpu(x) -#define htonl(x) ___htonl(x) -#define ntohl(x) ___ntohl(x) -#define htons(x) ___htons(x) -#define ntohs(x) ___ntohs(x) -#endif - void libcfs_debug_dumplog(void); int libcfs_debug_init(unsigned long bufsize); int libcfs_debug_cleanup(void); -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:20 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:20 -0400 Subject: [lustre-devel] [PATCH 52/64] staging: lustre: mgc: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-53-git-send-email-jsimmons@infradead.org> Rationalize include paths in the mgc source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/mgc/Makefile | 3 +++ drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 4 ++-- drivers/staging/lustre/lustre/mgc/mgc_internal.h | 10 +++++----- drivers/staging/lustre/lustre/mgc/mgc_request.c | 12 ++++++------ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/lustre/mgc/Makefile b/drivers/staging/lustre/lustre/mgc/Makefile index 8ea29a8..8abf108 100644 --- a/drivers/staging/lustre/lustre/mgc/Makefile +++ b/drivers/staging/lustre/lustre/mgc/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += mgc.o mgc-y := mgc_request.o lproc_mgc.o diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c index 0735220..2ec2d7f 100644 --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include #include "mgc_internal.h" LPROC_SEQ_FOPS_RO_TYPE(mgc, connect_flags); diff --git a/drivers/staging/lustre/lustre/mgc/mgc_internal.h b/drivers/staging/lustre/lustre/mgc/mgc_internal.h index 8cb6758..7a2f2b7 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_internal.h +++ b/drivers/staging/lustre/lustre/mgc/mgc_internal.h @@ -33,11 +33,11 @@ #ifndef _MGC_INTERNAL_H #define _MGC_INTERNAL_H -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_log.h" -#include "../include/lustre_export.h" +#include +#include +#include +#include +#include void lprocfs_mgc_init_vars(struct lprocfs_static_vars *lvars); int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data); diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 3bead6a..f0da546 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -39,12 +39,12 @@ #include -#include "../include/lprocfs_status.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_disk.h" -#include "../include/lustre_log.h" -#include "../include/lustre_swab.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "mgc_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:46 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:46 -0400 Subject: [lustre-devel] [PATCH 18/64] staging: lustre: uapi: move lustre_param.h to uapi directory In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-19-git-send-email-jsimmons@infradead.org> Move the header lustre_param.h to proper uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/{lustre/include => include/uapi/linux/lustre}/lustre_param.h | 0 drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_param.h (100%) diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h similarity index 100% rename from drivers/staging/lustre/lustre/include/lustre_param.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index e7d5228..3ab3a63 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -46,7 +46,7 @@ #include "../include/lustre_dlm.h" #include "../include/lprocfs_status.h" #include "../include/lustre_disk.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_log.h" #include "../include/cl_object.h" #include "../include/obd_cksum.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 8777d4b..475bf7e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -49,7 +49,7 @@ #include "../include/lustre_lib.h" #include "../include/lustre_mds.h" #include "../include/lustre_net.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_swab.h" #include "../include/lprocfs_status.h" #include "../include/obd_class.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 93fb195..4dcf3902 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -49,7 +49,7 @@ #include "../include/lustre_kernelcomm.h" #include "../include/lustre_lmv.h" #include "../include/lustre_log.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_swab.h" #include "../include/obd_class.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 2a93d67..783f9e0 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -42,7 +42,7 @@ #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" #include "../include/lustre_log.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/obd_class.h" #include "llog_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 8e0d4b1..555e67e 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -46,7 +46,7 @@ #include "../include/lustre/lustre_user.h" #include "../include/lustre_log.h" #include "../include/lustre_disk.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" static int (*client_fill_super)(struct super_block *sb, struct vfsmount *mnt); diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index e103d5a..453a59a 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -44,7 +44,7 @@ #include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_debug.h" #include "../include/lustre_obdo.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_fid.h" #include "../include/obd_class.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index 2181a85..bb953d4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -39,7 +39,7 @@ #include "../include/obd.h" #include "../include/obd_support.h" #include "../include/lustre_import.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_sec.h" #include "ptlrpc_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:05 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:05 -0400 Subject: [lustre-devel] [PATCH 37/64] staging: lustre: libcfs: sort headers in libcfs.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-38-git-send-email-jsimmons@infradead.org> Move all the included headers in libcfs.h to the top of the file. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs.h | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 71bb55e..3a5ebc2 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -33,9 +33,20 @@ #ifndef __LIBCFS_LIBCFS_H__ #define __LIBCFS_LIBCFS_H__ -#include "linux/libcfs.h" #include +#include +#include "../../uapi/linux/lnet/libcfs_ioctl.h" +#include "linux/libcfs.h" +#include "libcfs_debug.h" +#include "libcfs_private.h" +#include "libcfs_cpu.h" +#include "libcfs_prim.h" +#include "libcfs_time.h" +#include "libcfs_string.h" +#include "libcfs_workitem.h" +#include "libcfs_hash.h" +#include "libcfs_fail.h" #include "curproc.h" #define LIBCFS_VERSION "0.7.0" @@ -49,8 +60,6 @@ #define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \ ((hexnum) >> 8 & 0xf)) -#include - /* need both kernel and user-land acceptor */ #define LNET_ACCEPTOR_MIN_RESERVED_PORT 512 #define LNET_ACCEPTOR_MAX_RESERVED_PORT 1023 @@ -74,17 +83,6 @@ void cfs_srand(unsigned int seed1, unsigned int seed2); void cfs_get_random_bytes(void *buf, int size); -#include "libcfs_debug.h" -#include "libcfs_cpu.h" -#include "libcfs_private.h" -#include "../../uapi/linux/lnet/libcfs_ioctl.h" -#include "libcfs_prim.h" -#include "libcfs_time.h" -#include "libcfs_string.h" -#include "libcfs_workitem.h" -#include "libcfs_hash.h" -#include "libcfs_fail.h" - struct libcfs_ioctl_handler { struct list_head item; int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_hdr *hdr); -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:14 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:14 -0400 Subject: [lustre-devel] [PATCH 46/64] staging: lustre: fld: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-47-git-send-email-jsimmons@infradead.org> Rationalize include paths in the fld source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/fld/Makefile | 3 +++ drivers/staging/lustre/lustre/fld/fld_cache.c | 16 ++++++++-------- drivers/staging/lustre/lustre/fld/fld_internal.h | 8 ++++---- drivers/staging/lustre/lustre/fld/fld_request.c | 18 +++++++++--------- drivers/staging/lustre/lustre/fld/lproc_fld.c | 14 +++++++------- 5 files changed, 31 insertions(+), 28 deletions(-) diff --git a/drivers/staging/lustre/lustre/fld/Makefile b/drivers/staging/lustre/lustre/fld/Makefile index 646e315..426deba 100644 --- a/drivers/staging/lustre/lustre/fld/Makefile +++ b/drivers/staging/lustre/lustre/fld/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/ + obj-$(CONFIG_LUSTRE_FS) += fld.o fld-y := fld_request.o fld_cache.o lproc_fld.o diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c index 68d009b..b723ece 100644 --- a/drivers/staging/lustre/lustre/fld/fld_cache.c +++ b/drivers/staging/lustre/lustre/fld/fld_cache.c @@ -39,18 +39,18 @@ #define DEBUG_SUBSYSTEM S_FLD -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/obd_support.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" +#include +#include #include "fld_internal.h" /** diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h b/drivers/staging/lustre/lustre/fld/fld_internal.h index 3412c90..fe6f278 100644 --- a/drivers/staging/lustre/lustre/fld/fld_internal.h +++ b/drivers/staging/lustre/lustre/fld/fld_internal.h @@ -56,11 +56,11 @@ #ifndef __FLD_INTERNAL_H #define __FLD_INTERNAL_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" +#include +#include +#include struct fld_stats { __u64 fst_count; diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c index 1282992..5b18083 100644 --- a/drivers/staging/lustre/lustre/fld/fld_request.c +++ b/drivers/staging/lustre/lustre/fld/fld_request.c @@ -38,19 +38,19 @@ #define DEBUG_SUBSYSTEM S_FLD -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/obd_support.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" -#include "../include/lustre_mdc.h" +#include +#include +#include #include "fld_internal.h" static int fld_rrb_hash(struct lu_client_fld *fld, u64 seq) diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c b/drivers/staging/lustre/lustre/fld/lproc_fld.c index b83d7eb..6cae803 100644 --- a/drivers/staging/lustre/lustre/fld/lproc_fld.c +++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c @@ -39,15 +39,15 @@ #define DEBUG_SUBSYSTEM S_FLD -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" -#include "../include/lustre_fid.h" +#include +#include +#include +#include +#include +#include #include "fld_internal.h" static int -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:17 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:17 -0400 Subject: [lustre-devel] [PATCH 49/64] staging: lustre: lmv: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-50-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lmv source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lmv/Makefile | 3 +++ drivers/staging/lustre/lustre/lmv/lmv_fld.c | 14 +++++++------- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 16 ++++++++-------- drivers/staging/lustre/lustre/lmv/lmv_internal.h | 6 +++--- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 18 +++++++++--------- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 4 ++-- 6 files changed, 32 insertions(+), 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/lmv/Makefile b/drivers/staging/lustre/lustre/lmv/Makefile index 1a24299..91c9911 100644 --- a/drivers/staging/lustre/lustre/lmv/Makefile +++ b/drivers/staging/lustre/lustre/lmv/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += lmv.o lmv-y := lmv_obd.o lmv_intent.o lmv_fld.o lproc_lmv.o diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c b/drivers/staging/lustre/lustre/lmv/lmv_fld.c index 1a7dd15..5937468 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c @@ -37,13 +37,13 @@ #include #include -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_net.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include +#include +#include #include "lmv_internal.h" int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, u32 *mds) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index 6b10bdd..22c247a 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -37,14 +37,14 @@ #include #include #include -#include "../include/lustre_intent.h" -#include "../include/obd_support.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_net.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_mdc.h" -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "lmv_internal.h" static int lmv_intent_remote(struct obd_export *exp, struct lookup_intent *it, diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h index ad109c0..a047523 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h +++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h @@ -33,9 +33,9 @@ #ifndef _LMV_INTERNAL_H_ #define _LMV_INTERNAL_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/obd.h" -#include "../include/lustre_lmv.h" +#include +#include +#include #define LMV_MAX_TGT_COUNT 128 diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index f17221f..98537ca 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -41,15 +41,15 @@ #include #include -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/obd_class.h" -#include "../include/lustre_lmv.h" -#include "../include/lprocfs_status.h" -#include "../include/cl_object.h" -#include "../include/lustre_fid.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_kernelcomm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "lmv_internal.h" static int lmv_check_connect(struct obd_device *obd); diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c index 4c13e39..f16cfa4 100644 --- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c +++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c @@ -34,8 +34,8 @@ #include #include -#include "../include/lprocfs_status.h" -#include "../include/obd_class.h" +#include +#include #include "lmv_internal.h" static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr, -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:23 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:23 -0400 Subject: [lustre-devel] [PATCH 55/64] staging: lustre: osc: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-56-git-send-email-jsimmons@infradead.org> Rationalize include paths in the osc source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/osc/Makefile | 3 ++ drivers/staging/lustre/lustre/osc/lproc_osc.c | 6 ++-- .../staging/lustre/lustre/osc/osc_cl_internal.h | 6 ++-- drivers/staging/lustre/lustre/osc/osc_dev.c | 2 +- drivers/staging/lustre/lustre/osc/osc_internal.h | 2 +- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- drivers/staging/lustre/lustre/osc/osc_lock.c | 4 +-- drivers/staging/lustre/lustre/osc/osc_quota.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 32 +++++++++++----------- 9 files changed, 31 insertions(+), 28 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/Makefile b/drivers/staging/lustre/lustre/osc/Makefile index 37cdeea..30dec90 100644 --- a/drivers/staging/lustre/lustre/osc/Makefile +++ b/drivers/staging/lustre/lustre/osc/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += osc.o osc-y := osc_request.o osc_dev.o osc_object.o \ osc_page.o osc_lock.o osc_io.o osc_quota.o osc_cache.o lproc_osc.o diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index 6e0fd15..ae13eb055 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -32,9 +32,9 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include +#include #include #include "osc_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h index 270212f..35bdbfb 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h @@ -42,11 +42,11 @@ #ifndef OSC_CL_INTERNAL_H #define OSC_CL_INTERNAL_H -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" +#include /* osc_build_res_name() */ -#include "../include/cl_object.h" +#include #include "osc_internal.h" /** \defgroup osc osc diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c b/drivers/staging/lustre/lustre/osc/osc_dev.c index c5d62ae..cf7b887 100644 --- a/drivers/staging/lustre/lustre/osc/osc_dev.c +++ b/drivers/staging/lustre/lustre/osc/osc_dev.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_OSC /* class_name2obd() */ -#include "../include/obd_class.h" +#include #include "osc_cl_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_internal.h b/drivers/staging/lustre/lustre/osc/osc_internal.h index 13a40f6..a536908 100644 --- a/drivers/staging/lustre/lustre/osc/osc_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_internal.h @@ -99,7 +99,7 @@ struct osc_cache_waiter { /* * cl integration. */ -#include "../include/cl_object.h" +#include extern struct ptlrpc_request_set *PTLRPCD_SET; diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c index cbab800..f7969e3 100644 --- a/drivers/staging/lustre/lustre/osc/osc_io.c +++ b/drivers/staging/lustre/lustre/osc/osc_io.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_OSC -#include "../include/lustre_obdo.h" +#include #include "osc_cl_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c index 940c10c..b4f1f74 100644 --- a/drivers/staging/lustre/lustre/osc/osc_lock.c +++ b/drivers/staging/lustre/lustre/osc/osc_lock.c @@ -37,9 +37,9 @@ #define DEBUG_SUBSYSTEM S_OSC -#include "../../include/linux/libcfs/libcfs.h" +#include /* fid_build_reg_res_name() */ -#include "../include/lustre_fid.h" +#include #include "osc_cl_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_quota.c b/drivers/staging/lustre/lustre/osc/osc_quota.c index fed4da6..a6118f8 100644 --- a/drivers/staging/lustre/lustre/osc/osc_quota.c +++ b/drivers/staging/lustre/lustre/osc/osc_quota.c @@ -23,7 +23,7 @@ * Code originally extracted from quota directory */ -#include "../include/obd_class.h" +#include #include "osc_internal.h" static inline struct osc_quota_info *osc_oqi_alloc(u32 id) diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index af96ac5..4c68c42 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -32,22 +32,22 @@ #define DEBUG_SUBSYSTEM S_OSC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/lustre_dlm.h" -#include "../include/lustre_net.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/obd_cksum.h" - -#include "../include/lustre_ha.h" -#include "../include/lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_debug.h" -#include "../include/lustre_obdo.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_fid.h" -#include "../include/obd_class.h" -#include "../include/obd.h" +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "osc_internal.h" #include "osc_cl_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:54 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:54 -0400 Subject: [lustre-devel] [PATCH 26/64] staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-27-git-send-email-jsimmons@infradead.org> Several libcfs.h macros are present in lustre_cfg.h, but libcfs.h is not available so lets replace those macros with real code. The header libcfs.h also provides errno.h so with libcfs.h gone include errno.h directly. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index a762aab..a45d167 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -33,6 +33,8 @@ #ifndef _LUSTRE_CFG_H #define _LUSTRE_CFG_H +#include +#include #include "../../../../lustre/include/lustre/lustre_user.h" /** \defgroup cfg cfg @@ -48,7 +50,7 @@ #define LUSTRE_CFG_MAX_BUFCOUNT 8 #define LCFG_HDR_SIZE(count) \ - cfs_size_round(offsetof(struct lustre_cfg, lcfg_buflens[(count)])) + __ALIGN_KERNEL(offsetof(struct lustre_cfg, lcfg_buflens[(count)]), 8) /** If the LCFG_REQUIRED bit is set in a configuration command, * then the client is required to understand this parameter @@ -165,7 +167,7 @@ static inline void *lustre_cfg_buf(struct lustre_cfg *lcfg, __u32 index) offset = LCFG_HDR_SIZE(lcfg->lcfg_bufcount); for (i = 0; i < index; i++) - offset += cfs_size_round(lcfg->lcfg_buflens[i]); + offset += __ALIGN_KERNEL(lcfg->lcfg_buflens[i], 8); return (char *)lcfg + offset; } @@ -188,9 +190,9 @@ static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) len = LCFG_HDR_SIZE(bufcount); for (i = 0; i < bufcount; i++) - len += cfs_size_round(buflens[i]); + len += __ALIGN_KERNEL(buflens[i], 8); - return cfs_size_round(len); + return __ALIGN_KERNEL(len, 8); } static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, @@ -206,7 +208,10 @@ static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, ptr = (char *)lcfg + LCFG_HDR_SIZE(lcfg->lcfg_bufcount); for (i = 0; i < lcfg->lcfg_bufcount; i++) { lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i]; - LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr); + if (bufs->lcfg_buf[i]) { + memcpy(ptr, bufs->lcfg_buf[i], bufs->lcfg_buflen[i]); + ptr += __ALIGN_KERNEL(bufs->lcfg_buflen[i], 8); + } } } -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:56 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:56 -0400 Subject: [lustre-devel] [PATCH 28/64] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-29-git-send-email-jsimmons@infradead.org> Check if lcfg passed in is NULL and if it is just return NULL. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 4d23938..4208d61 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -161,6 +161,9 @@ static inline void *lustre_cfg_buf(struct lustre_cfg *lcfg, __u32 index) size_t offset; __u32 bufcount; + if (!lcfg) + return NULL; + bufcount = lcfg->lcfg_bufcount; if (index >= bufcount) return NULL; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:11 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:11 -0400 Subject: [lustre-devel] [PATCH 43/64] staging: lustre: uapi: use proper byteorder functions in lustre_idl.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-44-git-send-email-jsimmons@infradead.org> In order for lustre_idl.h to be usable for both user land and kernel space it has to use the proper byteorder functions. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: http://review.whamcloud.com/16916 Reviewed-by: Frank Zago Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Reviewed-by: John L. Hammond Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_idl.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index b7c1a1e..9613f7c 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -67,6 +67,7 @@ #ifndef _LUSTRE_IDL_H_ #define _LUSTRE_IDL_H_ +#include #include #include "../lnet/lnet-types.h" @@ -389,7 +390,7 @@ enum lu_dirpage_flags { static inline struct lu_dirent *lu_dirent_start(struct lu_dirpage *dp) { - if (le32_to_cpu(dp->ldp_flags) & LDF_EMPTY) + if (__le32_to_cpu(dp->ldp_flags) & LDF_EMPTY) return NULL; else return dp->ldp_entries; @@ -399,8 +400,8 @@ static inline struct lu_dirent *lu_dirent_next(struct lu_dirent *ent) { struct lu_dirent *next; - if (le16_to_cpu(ent->lde_reclen) != 0) - next = ((void *)ent) + le16_to_cpu(ent->lde_reclen); + if (__le16_to_cpu(ent->lde_reclen) != 0) + next = ((void *)ent) + __le16_to_cpu(ent->lde_reclen); else next = NULL; @@ -1840,11 +1841,11 @@ static inline ssize_t lmv_mds_md_size(int stripe_count, unsigned int lmm_magic) static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm) { - switch (le32_to_cpu(lmm->lmv_magic)) { + switch (__le32_to_cpu(lmm->lmv_magic)) { case LMV_MAGIC_V1: - return le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count); + return __le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count); case LMV_USER_MAGIC: - return le32_to_cpu(lmm->lmv_user_md.lum_stripe_count); + return __le32_to_cpu(lmm->lmv_user_md.lum_stripe_count); default: return -EINVAL; } -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:19 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:19 -0400 Subject: [lustre-devel] [PATCH 51/64] staging: lustre: mdc: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-52-git-send-email-jsimmons@infradead.org> Rationalize include paths in the mdc source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/mdc/Makefile | 3 +++ drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 22 ++++++++++---------- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_request.c | 26 ++++++++++++------------ 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/drivers/staging/lustre/lustre/mdc/Makefile b/drivers/staging/lustre/lustre/mdc/Makefile index 99ba9ff..c7bc335 100644 --- a/drivers/staging/lustre/lustre/mdc/Makefile +++ b/drivers/staging/lustre/lustre/mdc/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += mdc.o mdc-y := mdc_request.o mdc_reint.o mdc_lib.o mdc_locks.o lproc_mdc.o diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c index 51a7047..f685137 100644 --- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c +++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include #include "mdc_internal.h" static ssize_t active_show(struct kobject *kobj, struct attribute *attr, diff --git a/drivers/staging/lustre/lustre/mdc/mdc_internal.h b/drivers/staging/lustre/lustre/mdc/mdc_internal.h index fecedc88..cbf0115 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_internal.h +++ b/drivers/staging/lustre/lustre/mdc/mdc_internal.h @@ -33,7 +33,7 @@ #ifndef _MDC_INTERNAL_H #define _MDC_INTERNAL_H -#include "../include/lustre_mdc.h" +#include void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index bfd8fbe..ba13f089 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -31,8 +31,8 @@ */ #define DEBUG_SUBSYSTEM S_MDC -#include "../include/lustre_net.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #include "mdc_internal.h" static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index 3eb66ce..b9bf440 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -32,17 +32,17 @@ #define DEBUG_SUBSYSTEM S_MDC -# include - -#include "../include/lustre_intent.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_mdc.h" -#include "../include/lustre_net.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_swab.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "mdc_internal.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c index 2287bd4..f45c91d 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c @@ -35,9 +35,9 @@ # include # include -#include "../include/obd_class.h" +#include #include "mdc_internal.h" -#include "../include/lustre_fid.h" +#include /* mdc_setattr does its own semaphore handling */ static int mdc_reint(struct ptlrpc_request *request, int level) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 3556307..6ef8dde 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -38,19 +38,19 @@ # include # include -#include "../include/lustre_errno.h" -#include "../include/cl_object.h" -#include "../include/llog_swab.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_acl.h" -#include "../include/lustre_fid.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_kernelcomm.h" -#include "../include/lustre_lmv.h" -#include "../include/lustre_log.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_swab.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "mdc_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:30 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:30 -0400 Subject: [lustre-devel] [PATCH 62/64] staging: lustre: libcfs: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-63-git-send-email-jsimmons@infradead.org> Rationalize include paths in the libcfs source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/Makefile | 3 +++ drivers/staging/lustre/lnet/libcfs/debug.c | 2 +- drivers/staging/lustre/lnet/libcfs/fail.c | 2 +- drivers/staging/lustre/lnet/libcfs/hash.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_mem.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_string.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c | 4 ++-- drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-module.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/module.c | 8 ++++---- drivers/staging/lustre/lnet/libcfs/prng.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.h | 2 +- drivers/staging/lustre/lnet/libcfs/workitem.c | 2 +- 21 files changed, 27 insertions(+), 24 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/Makefile b/drivers/staging/lustre/lnet/libcfs/Makefile index 8c89455..215fa23 100644 --- a/drivers/staging/lustre/lnet/libcfs/Makefile +++ b/drivers/staging/lustre/lnet/libcfs/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET) += libcfs.o libcfs-linux-objs := linux-tracefile.o linux-debug.o diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 49deb44..1ab394c 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -37,7 +37,7 @@ # define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include #include "tracefile.h" static char debug_file_name[1024]; diff --git a/drivers/staging/lustre/lnet/libcfs/fail.c b/drivers/staging/lustre/lnet/libcfs/fail.c index 12dd50a..24f4701 100644 --- a/drivers/staging/lustre/lnet/libcfs/fail.c +++ b/drivers/staging/lustre/lnet/libcfs/fail.c @@ -29,7 +29,7 @@ * Lustre is a trademark of Oracle Corporation, Inc. */ -#include "../../include/linux/libcfs/libcfs.h" +#include unsigned long cfs_fail_loc; EXPORT_SYMBOL(cfs_fail_loc); diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index ff54eaf..49a04a2 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -105,7 +105,7 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" +#include #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1 static unsigned int warn_on_depth = 8; diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c index 55caa19..2ddd09a 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c @@ -30,7 +30,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include /** Global CPU partition table */ struct cfs_cpt_table *cfs_cpt_table __read_mostly; diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c index 1967b97..77fd3d06 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c @@ -27,7 +27,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include /** destroy cpu-partition lock, see libcfs_private.h for more detail */ void diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c b/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c index ef085ba..1a0c7ca 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c @@ -28,7 +28,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include struct cfs_var_array { unsigned int va_count; /* # of buffers */ diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_string.c b/drivers/staging/lustre/lnet/libcfs/libcfs_string.c index 02de1ee..333e47f 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_string.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_string.c @@ -36,7 +36,7 @@ * Author: Nathan Rutman */ -#include "../../include/linux/libcfs/libcfs.h" +#include /* Convert a text string to a bitmask */ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c index 4d35a37..2da051c 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -31,7 +31,7 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" +#include #ifdef CONFIG_SMP diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c index 68e34b4..5566339 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c @@ -29,8 +29,8 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/libcfs/libcfs_crypto.h" +#include +#include #include "linux-crypto.h" /** diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c index 3e22cad..528d497 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c @@ -44,7 +44,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../../include/linux/libcfs/libcfs.h" +#include /* * Implementation of cfs_curproc API (see portals/include/libcfs/curproc.h) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c index 7035356..972677b 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c @@ -51,7 +51,7 @@ # define DEBUG_SUBSYSTEM S_LNET -#include "../../../include/linux/libcfs/libcfs.h" +#include #include "../tracefile.h" diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c index 8f63826..3f5dec1 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c @@ -29,7 +29,7 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" +#include void *libcfs_kvzalloc(size_t size, gfp_t flags) { diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c index c6837bc..4357221 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c @@ -32,7 +32,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../../include/linux/libcfs/libcfs.h" +#include #define LNET_MINOR 240 diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c index bcf9f3d..4e331e7 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c @@ -36,7 +36,7 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" +#include #if defined(CONFIG_KGDB) #include diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c index a5a9478..16a3ae7 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c @@ -33,7 +33,7 @@ #define DEBUG_SUBSYSTEM S_LNET #define LUSTRE_TRACEFILE_PRIVATE -#include "../../../include/linux/libcfs/libcfs.h" +#include #include "../tracefile.h" /* percents to share the total debug memory for each type */ diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index 657c495..6aed98f 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -50,12 +50,12 @@ # define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../../include/linux/libcfs/libcfs_crypto.h" -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" +#include +#include +#include #include "tracefile.h" static struct dentry *lnet_debugfs_root; diff --git a/drivers/staging/lustre/lnet/libcfs/prng.c b/drivers/staging/lustre/lnet/libcfs/prng.c index 21d5a39..963ef4a 100644 --- a/drivers/staging/lustre/lnet/libcfs/prng.c +++ b/drivers/staging/lustre/lnet/libcfs/prng.c @@ -35,7 +35,7 @@ * algorithm recommended by Marsaglia */ -#include "../../include/linux/libcfs/libcfs.h" +#include /* * From: George Marsaglia diff --git a/drivers/staging/lustre/lnet/libcfs/tracefile.c b/drivers/staging/lustre/lnet/libcfs/tracefile.c index d1aa79b..68f283a 100644 --- a/drivers/staging/lustre/lnet/libcfs/tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/tracefile.c @@ -40,7 +40,7 @@ #define pr_fmt(fmt) "Lustre: " fmt #include "tracefile.h" -#include "../../include/linux/libcfs/libcfs.h" +#include /* XXX move things up to the top, comment */ union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline_aligned; diff --git a/drivers/staging/lustre/lnet/libcfs/tracefile.h b/drivers/staging/lustre/lnet/libcfs/tracefile.h index f644cbc..c3547cd 100644 --- a/drivers/staging/lustre/lnet/libcfs/tracefile.h +++ b/drivers/staging/lustre/lnet/libcfs/tracefile.h @@ -33,7 +33,7 @@ #ifndef __LIBCFS_TRACEFILE_H__ #define __LIBCFS_TRACEFILE_H__ -#include "../../include/linux/libcfs/libcfs.h" +#include enum cfs_trace_buf_type { CFS_TCD_TYPE_PROC = 0, diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..038ed8c 100644 --- a/drivers/staging/lustre/lnet/libcfs/workitem.c +++ b/drivers/staging/lustre/lnet/libcfs/workitem.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include #define CFS_WS_NAME_LEN 16 -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:35 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:35 -0400 Subject: [lustre-devel] [PATCH 07/64] staging: lustre: uapi: remove userland version of obd_ioctl_*() In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-8-git-send-email-jsimmons@infradead.org> The header lustre_ioctl.h has both kernel and user space versions of obd_ioctl_*() functions. Lets remove the user land version which have been integrated into the lustre tools. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_ioctl.h | 87 ---------------------- 1 file changed, 87 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index eb08df3..84654af 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -208,8 +208,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) return 0; } -#ifdef __KERNEL__ - int obd_ioctl_getdata(char **buf, int *len, void __user *arg); int obd_ioctl_popdata(void __user *arg, void *data, int len); @@ -218,91 +216,6 @@ static inline void obd_ioctl_freedata(char *buf, size_t len) kvfree(buf); } -#else /* __KERNEL__ */ - -static inline int obd_ioctl_pack(struct obd_ioctl_data *data, char **pbuf, - int max_len) -{ - char *ptr; - struct obd_ioctl_data *overlay; - - data->ioc_len = obd_ioctl_packlen(data); - data->ioc_version = OBD_IOCTL_VERSION; - - if (*pbuf && data->ioc_len > max_len) { - fprintf(stderr, "pbuf = %p, ioc_len = %u, max_len = %d\n", - *pbuf, data->ioc_len, max_len); - return -EINVAL; - } - - if (!*pbuf) - *pbuf = malloc(data->ioc_len); - - if (!*pbuf) - return -ENOMEM; - - overlay = (struct obd_ioctl_data *)*pbuf; - memcpy(*pbuf, data, sizeof(*data)); - - ptr = overlay->ioc_bulk; - if (data->ioc_inlbuf1) - LOGL(data->ioc_inlbuf1, data->ioc_inllen1, ptr); - - if (data->ioc_inlbuf2) - LOGL(data->ioc_inlbuf2, data->ioc_inllen2, ptr); - - if (data->ioc_inlbuf3) - LOGL(data->ioc_inlbuf3, data->ioc_inllen3, ptr); - - if (data->ioc_inlbuf4) - LOGL(data->ioc_inlbuf4, data->ioc_inllen4, ptr); - - if (obd_ioctl_is_invalid(overlay)) { - fprintf(stderr, "invalid ioctl data: ioc_len = %u, max_len = %d\n", - data->ioc_len, max_len); - return -EINVAL; - } - - return 0; -} - -static inline int -obd_ioctl_unpack(struct obd_ioctl_data *data, char *pbuf, int max_len) -{ - char *ptr; - struct obd_ioctl_data *overlay; - - if (!pbuf) - return 1; - - overlay = (struct obd_ioctl_data *)pbuf; - - /* Preserve the caller's buffer pointers */ - overlay->ioc_inlbuf1 = data->ioc_inlbuf1; - overlay->ioc_inlbuf2 = data->ioc_inlbuf2; - overlay->ioc_inlbuf3 = data->ioc_inlbuf3; - overlay->ioc_inlbuf4 = data->ioc_inlbuf4; - - memcpy(data, pbuf, sizeof(*data)); - - ptr = overlay->ioc_bulk; - if (data->ioc_inlbuf1) - LOGU(data->ioc_inlbuf1, data->ioc_inllen1, ptr); - - if (data->ioc_inlbuf2) - LOGU(data->ioc_inlbuf2, data->ioc_inllen2, ptr); - - if (data->ioc_inlbuf3) - LOGU(data->ioc_inlbuf3, data->ioc_inllen3, ptr); - - if (data->ioc_inlbuf4) - LOGU(data->ioc_inlbuf4, data->ioc_inllen4, ptr); - - return 0; -} - -#endif /* !__KERNEL__ */ - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:58 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:58 -0400 Subject: [lustre-devel] [PATCH 30/64] staging: lustre: uapi: label lustre_cfg.h as an uapi header In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-31-git-send-email-jsimmons@infradead.org> Change LUSTRE_CFG_H to _UAPI_LUSTRE_CFG_H_ now that it is a proper UAPI header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 2d37d1b..1533dcb 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -30,8 +30,8 @@ * Lustre is a trademark of Sun Microsystems, Inc. */ -#ifndef _LUSTRE_CFG_H -#define _LUSTRE_CFG_H +#ifndef _UAPI_LUSTRE_CFG_H_ +#define _UAPI_LUSTRE_CFG_H_ #include #include @@ -258,4 +258,4 @@ static inline int lustre_cfg_sanity_check(void *buf, size_t len) /** @} cfg */ -#endif /* _LUSTRE_CFG_H */ +#endif /* _UAPI_LUSTRE_CFG_H_ */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:02 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:02 -0400 Subject: [lustre-devel] [PATCH 34/64] staging: lustre: socklnd: create socklnd.h UAPI header In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-35-git-send-email-jsimmons@infradead.org> Break out the parts from libcfs_debug.h that is used by both user land and kernel space into a new UAPI header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/socklnd.h | 10 +---- .../lustre/include/uapi/linux/lnet/socklnd.h | 44 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h index a1ae66e..27ce6ce 100644 --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h @@ -35,15 +35,7 @@ #define __LNET_LNET_SOCKLND_H__ #include "types.h" - -#define SOCKLND_CONN_NONE (-1) -#define SOCKLND_CONN_ANY 0 -#define SOCKLND_CONN_CONTROL 1 -#define SOCKLND_CONN_BULK_IN 2 -#define SOCKLND_CONN_BULK_OUT 3 -#define SOCKLND_CONN_NTYPES 4 - -#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN +#include "../../uapi/linux/lnet/socklnd.h" struct ksock_hello_msg { __u32 kshm_magic; /* magic number of socklnd message */ diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h b/drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h new file mode 100644 index 0000000..6453e05 --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h @@ -0,0 +1,44 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * #defines shared between socknal implementation and utilities + */ +#ifndef __UAPI_LNET_SOCKLND_H__ +#define __UAPI_LNET_SOCKLND_H__ + +#define SOCKLND_CONN_NONE (-1) +#define SOCKLND_CONN_ANY 0 +#define SOCKLND_CONN_CONTROL 1 +#define SOCKLND_CONN_BULK_IN 2 +#define SOCKLND_CONN_BULK_OUT 3 +#define SOCKLND_CONN_NTYPES 4 + +#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN + +#endif -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:13 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:13 -0400 Subject: [lustre-devel] [PATCH 45/64] staging: lustre: fid: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-46-git-send-email-jsimmons@infradead.org> Start to rationalize include paths in the fid source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/fid/Makefile | 3 +++ drivers/staging/lustre/lustre/fid/fid_internal.h | 4 ++-- drivers/staging/lustre/lustre/fid/fid_lib.c | 4 ++-- drivers/staging/lustre/lustre/fid/fid_request.c | 12 ++++++------ drivers/staging/lustre/lustre/fid/lproc_fid.c | 12 ++++++------ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lustre/fid/Makefile b/drivers/staging/lustre/lustre/fid/Makefile index b7ef314..77b65b9 100644 --- a/drivers/staging/lustre/lustre/fid/Makefile +++ b/drivers/staging/lustre/lustre/fid/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/ + obj-$(CONFIG_LUSTRE_FS) += fid.o fid-y := fid_request.o fid_lib.o lproc_fid.o diff --git a/drivers/staging/lustre/lustre/fid/fid_internal.h b/drivers/staging/lustre/lustre/fid/fid_internal.h index 5f8d15b..f48ab9d 100644 --- a/drivers/staging/lustre/lustre/fid/fid_internal.h +++ b/drivers/staging/lustre/lustre/fid/fid_internal.h @@ -36,8 +36,8 @@ #ifndef __FID_INTERNAL_H #define __FID_INTERNAL_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/linux/libcfs/libcfs.h" +#include +#include /* Functions used internally in module. */ diff --git a/drivers/staging/lustre/lustre/fid/fid_lib.c b/drivers/staging/lustre/lustre/fid/fid_lib.c index 6ab06ef..c21a5f5 100644 --- a/drivers/staging/lustre/lustre/fid/fid_lib.c +++ b/drivers/staging/lustre/lustre/fid/fid_lib.c @@ -39,9 +39,9 @@ #define DEBUG_SUBSYSTEM S_FID -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/lustre_fid.h" +#include /** * A cluster-wide range from which fid-sequences are granted to servers and diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index 19895fa..ba73623 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -38,15 +38,15 @@ #define DEBUG_SUBSYSTEM S_FID -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include +#include /* mdc RPC locks */ -#include "../include/lustre_mdc.h" +#include #include "fid_internal.h" static struct dentry *seq_debugfs_dir; diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c index 3eed838..1a269fb 100644 --- a/drivers/staging/lustre/lustre/fid/lproc_fid.c +++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c @@ -38,14 +38,14 @@ #define DEBUG_SUBSYSTEM S_FID -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fid.h" +#include +#include +#include +#include +#include #include "fid_internal.h" /* Format: [0x64BIT_INT - 0x64BIT_INT] + 32 bytes just in case */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:22 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:22 -0400 Subject: [lustre-devel] [PATCH 54/64] staging: lustre: obdecho: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-55-git-send-email-jsimmons@infradead.org> Rationalize include paths in the obdecho source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdecho/Makefile | 3 +++ .../staging/lustre/lustre/obdecho/echo_client.c | 24 +++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdecho/Makefile b/drivers/staging/lustre/lustre/obdecho/Makefile index a659a37..6be66fb 100644 --- a/drivers/staging/lustre/lustre/obdecho/Makefile +++ b/drivers/staging/lustre/lustre/obdecho/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += obdecho.o obdecho-y := echo_client.o diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 31e549f..b377dc7 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -31,18 +31,18 @@ */ #define DEBUG_SUBSYSTEM S_ECHO -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/obd.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_debug.h" -#include "../include/lprocfs_status.h" -#include "../include/cl_object.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_acl.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_net.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "echo_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:24 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:24 -0400 Subject: [lustre-devel] [PATCH 56/64] staging: lustre: lustre: cleanup paths for lustre internal headers In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-57-git-send-email-jsimmons@infradead.org> Rationalize include paths for the lustre internal headers Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/cl_object.h | 4 ++-- drivers/staging/lustre/lustre/include/llog_swab.h | 2 +- .../staging/lustre/lustre/include/lprocfs_status.h | 6 ++--- drivers/staging/lustre/lustre/include/lu_object.h | 6 ++--- .../staging/lustre/lustre/include/lustre_compat.h | 2 +- .../staging/lustre/lustre/include/lustre_debug.h | 4 ++-- .../staging/lustre/lustre/include/lustre_disk.h | 4 +++- drivers/staging/lustre/lustre/include/lustre_dlm.h | 12 +++++----- .../staging/lustre/lustre/include/lustre_export.h | 6 ++--- drivers/staging/lustre/lustre/include/lustre_fid.h | 8 +++---- drivers/staging/lustre/lustre/include/lustre_fld.h | 6 ++--- .../staging/lustre/lustre/include/lustre_handles.h | 2 +- .../staging/lustre/lustre/include/lustre_import.h | 4 ++-- .../lustre/lustre/include/lustre_kernelcomm.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 12 +++++----- drivers/staging/lustre/lustre/include/lustre_lmv.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 4 ++-- drivers/staging/lustre/lustre/include/lustre_mdc.h | 14 +++++------ drivers/staging/lustre/lustre/include/lustre_mds.h | 10 ++++---- drivers/staging/lustre/lustre/include/lustre_net.h | 28 +++++++++++----------- drivers/staging/lustre/lustre/include/lustre_nrs.h | 2 +- .../staging/lustre/lustre/include/lustre_obdo.h | 2 +- .../staging/lustre/lustre/include/lustre_swab.h | 2 +- drivers/staging/lustre/lustre/include/obd.h | 18 +++++++------- drivers/staging/lustre/lustre/include/obd_cksum.h | 6 ++--- drivers/staging/lustre/lustre/include/obd_class.h | 12 +++++----- .../staging/lustre/lustre/include/obd_support.h | 6 ++--- drivers/staging/lustre/lustre/include/seq_range.h | 2 +- 28 files changed, 95 insertions(+), 93 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 6887b81..9ba184b 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -88,8 +88,8 @@ /* * super-class definitions. */ -#include "lu_object.h" -#include "lustre_compat.h" +#include +#include #include #include #include diff --git a/drivers/staging/lustre/lustre/include/llog_swab.h b/drivers/staging/lustre/lustre/include/llog_swab.h index 25516d3..925271d 100644 --- a/drivers/staging/lustre/lustre/include/llog_swab.h +++ b/drivers/staging/lustre/lustre/include/llog_swab.h @@ -48,7 +48,7 @@ #ifndef _LLOG_SWAB_H_ #define _LLOG_SWAB_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include struct lustre_cfg; diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index f5abca8..98d6b13 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -43,9 +43,9 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_cfg.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include +#include struct lprocfs_vars { const char *name; diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index ea77d9c..4f213c4 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -35,9 +35,9 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lu_ref.h" +#include +#include +#include struct seq_file; struct lustre_cfg; diff --git a/drivers/staging/lustre/lustre/include/lustre_compat.h b/drivers/staging/lustre/lustre/include/lustre_compat.h index da9ce19..69bfd6a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_compat.h +++ b/drivers/staging/lustre/lustre/include/lustre_compat.h @@ -37,7 +37,7 @@ #include #include -#include "lustre_patchless_compat.h" +#include /* * set ATTR_BLOCKS to a high value to avoid any risk of collision with other diff --git a/drivers/staging/lustre/lustre/include/lustre_debug.h b/drivers/staging/lustre/lustre/include/lustre_debug.h index 93c1bda..0be6a53 100644 --- a/drivers/staging/lustre/lustre/include/lustre_debug.h +++ b/drivers/staging/lustre/lustre/include/lustre_debug.h @@ -38,8 +38,8 @@ * @{ */ -#include "lustre_net.h" -#include "obd.h" +#include +#include /* lib/debug.c */ int dump_req(struct ptlrpc_request *req); diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index 05cdc66..2d862b3 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -44,8 +44,10 @@ * @{ */ -#include "../../include/linux/libcfs/libcfs.h" +#include +#include #include +#include /****************** persistent mount data *********************/ diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index eb2de13..13c3d2f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -44,12 +44,12 @@ #ifndef _LUSTRE_DLM_H__ #define _LUSTRE_DLM_H__ -#include "lustre_lib.h" -#include "lustre_net.h" -#include "lustre_import.h" -#include "lustre_handles.h" -#include "interval_tree.h" /* for interval_node{}, ldlm_extent */ -#include "lu_ref.h" +#include +#include +#include +#include +#include /* for interval_node{}, ldlm_extent */ +#include #include "lustre_dlm_flags.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 3502d15..3631a69 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -42,9 +42,9 @@ * @{ */ -#include "lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lustre_dlm.h" +#include +#include +#include enum obd_option { OBD_OPT_FORCE = 0x0001, diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 8998a34..e0f2b82 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -148,10 +148,10 @@ * Even so, the MDT and OST resources are also in different LDLM namespaces. */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_fid.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/uapi/linux/lustre/lustre_ostid.h" +#include +#include +#include +#include struct lu_env; struct lu_site; diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index e335d88..6125eb0 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -38,9 +38,9 @@ * @{ */ -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/linux/libcfs/libcfs.h" -#include "seq_range.h" +#include +#include +#include struct lu_client_fld; struct lu_server_fld; diff --git a/drivers/staging/lustre/lustre/include/lustre_handles.h b/drivers/staging/lustre/lustre/include/lustre_handles.h index e071bac..d499326 100644 --- a/drivers/staging/lustre/lustre/include/lustre_handles.h +++ b/drivers/staging/lustre/lustre/include/lustre_handles.h @@ -44,7 +44,7 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" +#include struct portals_handle_ops { void (*hop_addref)(void *object); diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index 0b54e28..d71d047 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -43,8 +43,8 @@ * @{ */ -#include "lustre_handles.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include /** * Adaptive Timeout stuff diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h index c06648f..f1899a3d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h @@ -38,7 +38,7 @@ #define __LUSTRE_KERNELCOMM_H__ /* For declarations shared with userspace */ -#include "../../include/uapi/linux/lustre/lustre_kernelcomm.h" +#include /* prototype for callback function on kuc groups */ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index a7a184f..81b9cbf 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -45,18 +45,18 @@ #include #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../../include/uapi/linux/lustre/lustre_cfg.h" +#include +#include +#include +#include /* target.c */ struct ptlrpc_request; struct obd_export; struct lu_target; struct l_wait_info; -#include "lustre_ha.h" -#include "lustre_net.h" +#include +#include #define LI_POISON 0x5a5a5a5a #if BITS_PER_LONG > 32 diff --git a/drivers/staging/lustre/lustre/include/lustre_lmv.h b/drivers/staging/lustre/lustre/include/lustre_lmv.h index f2b8574..98a82be2 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lmv.h +++ b/drivers/staging/lustre/lustre/include/lustre_lmv.h @@ -32,7 +32,7 @@ #ifndef _LUSTRE_LMV_H #define _LUSTRE_LMV_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include struct lmv_oinfo { struct lu_fid lmo_fid; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 70fdc0b..24a7777 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -52,8 +52,8 @@ * @{ */ -#include "obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #define LOG_NAME_LIMIT(logname, name) \ snprintf(logname, sizeof(logname), "LOGS/%s", name) diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h index 99abbde..c0c4497 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mdc.h +++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h @@ -46,13 +46,13 @@ #include #include -#include "lustre_intent.h" -#include "lustre_handles.h" -#include "../../include/linux/libcfs/libcfs.h" -#include "obd_class.h" -#include "lustre_lib.h" -#include "lustre_dlm.h" -#include "lustre_export.h" +#include +#include +#include +#include +#include +#include +#include struct ptlrpc_client; struct obd_export; diff --git a/drivers/staging/lustre/lustre/include/lustre_mds.h b/drivers/staging/lustre/lustre/include/lustre_mds.h index 2a552ee..c424e12 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mds.h +++ b/drivers/staging/lustre/lustre/include/lustre_mds.h @@ -43,11 +43,11 @@ * @{ */ -#include "lustre_handles.h" -#include "../../include/linux/libcfs/libcfs.h" -#include "lustre_lib.h" -#include "lustre_dlm.h" -#include "lustre_export.h" +#include +#include +#include +#include +#include struct mds_group_info { struct obd_uuid *uuid; diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 1ae7e83..0dbd6b2 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -51,19 +51,19 @@ */ #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lnet/nidstr.h" -#include "../../include/linux/lnet/api.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lustre_ha.h" -#include "lustre_sec.h" -#include "lustre_import.h" -#include "lprocfs_status.h" -#include "lu_object.h" -#include "lustre_req_layout.h" - -#include "obd_support.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include /* MD flags we _always_ use */ #define PTLRPC_MD_OPTIONS 0 @@ -521,7 +521,7 @@ struct ptlrpc_request_pool { struct ldlm_lock; -#include "lustre_nrs.h" +#include /** * Basic request prioritization operations structure. diff --git a/drivers/staging/lustre/lustre/include/lustre_nrs.h b/drivers/staging/lustre/lustre/include/lustre_nrs.h index a5028aa..51f45f7 100644 --- a/drivers/staging/lustre/lustre/include/lustre_nrs.h +++ b/drivers/staging/lustre/lustre/include/lustre_nrs.h @@ -669,7 +669,7 @@ enum { NRS_RES_MAX }; -#include "lustre_nrs_fifo.h" +#include /** * NRS request diff --git a/drivers/staging/lustre/lustre/include/lustre_obdo.h b/drivers/staging/lustre/lustre/include/lustre_obdo.h index 252191d..53379f8 100644 --- a/drivers/staging/lustre/lustre/include/lustre_obdo.h +++ b/drivers/staging/lustre/lustre/include/lustre_obdo.h @@ -35,7 +35,7 @@ #ifndef _LUSTRE_OBDO_H_ #define _LUSTRE_OBDO_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include /** * Create an obdo to send over the wire diff --git a/drivers/staging/lustre/lustre/include/lustre_swab.h b/drivers/staging/lustre/lustre/include/lustre_swab.h index 9e13afd..765e923 100644 --- a/drivers/staging/lustre/lustre/include/lustre_swab.h +++ b/drivers/staging/lustre/lustre/include/lustre_swab.h @@ -48,7 +48,7 @@ #ifndef _LUSTRE_SWAB_H_ #define _LUSTRE_SWAB_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); void lustre_swab_connect(struct obd_connect_data *ocd); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index aedc550..a986737 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -35,15 +35,15 @@ #include -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lustre_lib.h" -#include "lu_ref.h" -#include "lustre_export.h" -#include "lustre_fid.h" -#include "lustre_fld.h" -#include "lustre_handles.h" -#include "lustre_intent.h" -#include "cl_object.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #define MAX_OBD_DEVICES 8192 diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h b/drivers/staging/lustre/lustre/include/obd_cksum.h index 54bde73..cda3d28 100644 --- a/drivers/staging/lustre/lustre/include/obd_cksum.h +++ b/drivers/staging/lustre/lustre/include/obd_cksum.h @@ -30,9 +30,9 @@ #ifndef __OBD_CKSUM #define __OBD_CKSUM -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/libcfs/libcfs_crypto.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include +#include static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type) { diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 6ae6479..976005a 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -32,12 +32,12 @@ #ifndef __CLASS_OBD_H #define __CLASS_OBD_H -#include "obd_support.h" -#include "lustre_import.h" -#include "lustre_net.h" -#include "obd.h" -#include "lustre_lib.h" -#include "lprocfs_status.h" +#include +#include +#include +#include +#include +#include #define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay * and resends for avoid deadlocks diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index 3330404..aea193a 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -36,9 +36,9 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "lustre_compat.h" -#include "lprocfs_status.h" +#include +#include +#include /* global variables */ extern unsigned int obd_debug_peer_on_timeout; diff --git a/drivers/staging/lustre/lustre/include/seq_range.h b/drivers/staging/lustre/lustre/include/seq_range.h index 74a9c63..d717548 100644 --- a/drivers/staging/lustre/lustre/include/seq_range.h +++ b/drivers/staging/lustre/lustre/include/seq_range.h @@ -34,7 +34,7 @@ #ifndef _SEQ_RANGE_H_ #define _SEQ_RANGE_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include /** * computes the sequence range type \a range -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:44 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:44 -0400 Subject: [lustre-devel] [PATCH 16/64] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-17-git-send-email-jsimmons@infradead.org> Move all the kernel specific function prototypes from lustre_param.h into obd_config.h which is a kernel only header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_param.h | 11 ----------- drivers/staging/lustre/lustre/include/obd_class.h | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/lustre/include/lustre_param.h index 8061a04..2620e02 100644 --- a/drivers/staging/lustre/lustre/include/lustre_param.h +++ b/drivers/staging/lustre/lustre/include/lustre_param.h @@ -47,17 +47,6 @@ * @{ */ -/* For interoperability */ -struct cfg_interop_param { - char *old_param; - char *new_param; -}; - -/* obd_config.c */ -int class_find_param(char *buf, char *key, char **valp); -int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh); -int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh); - /****************** User-settable parameter keys *********************/ /* e.g. tunefs.lustre --param="failover.node=192.168.0.13 at tcp0" /dev/sda diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index d4a632a..8cc13ea 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -105,10 +105,28 @@ void obd_put_mod_rpc_slot(struct client_obd *cli, u32 opc, struct llog_rec_hdr; typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *, struct llog_rec_hdr *, void *); + /* obd_config.c */ int class_process_config(struct lustre_cfg *lcfg); int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, struct lustre_cfg *lcfg, void *data); + +/* For interoperability */ +struct cfg_interop_param { + char *old_param; + char *new_param; +}; + +int class_find_param(char *buf, char *key, char **valp); +struct cfg_interop_param *class_find_old_param(const char *param, + struct cfg_interop_param *ptr); +int class_get_next_param(char **params, char *copy); +int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh); +int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh); +int class_parse_net(char *buf, u32 *net, char **endh); +int class_match_nid(char *buf, char *key, lnet_nid_t nid); +int class_match_net(char *buf, char *key, u32 net); + struct obd_device *class_incref(struct obd_device *obd, const char *scope, const void *source); void class_decref(struct obd_device *obd, -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:47 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:47 -0400 Subject: [lustre-devel] [PATCH 19/64] staging: lustre: uapi: label lustre_param.h as an uapi header In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-20-git-send-email-jsimmons@infradead.org> Change LUSTRE_PARAM_H_ to _UAPI_LUSTRE_PARAM_H_ now that is a proper UAPI header Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h index f6f4752..cab0056 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h @@ -29,15 +29,13 @@ * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * lustre/include/lustre_param.h - * * User-settable parameter keys * * Author: Nathan Rutman */ -#ifndef _LUSTRE_PARAM_H -#define _LUSTRE_PARAM_H +#ifndef _UAPI_LUSTRE_PARAM_H_ +#define _UAPI_LUSTRE_PARAM_H_ /** \defgroup param param * @@ -92,4 +90,4 @@ /** @} param */ -#endif /* _LUSTRE_PARAM_H */ +#endif /* _UAPI_LUSTRE_PARAM_H_ */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:46:55 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:46:55 -0400 Subject: [lustre-devel] [PATCH 27/64] staging: lustre: uapi: change variable type to match In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-28-git-send-email-jsimmons@infradead.org> Change i from int to __u32 to match lcfg_bufcount field. Also this matches what the other functions also do. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index a45d167..4d23938 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -199,7 +199,7 @@ static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, struct lustre_cfg_bufs *bufs) { char *ptr; - int i; + __u32 i; lcfg->lcfg_version = LUSTRE_CFG_VERSION; lcfg->lcfg_command = cmd; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:31 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:31 -0400 Subject: [lustre-devel] [PATCH 63/64] staging: lustre: libcfs: cleanup paths for libcfs headers In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-64-git-send-email-jsimmons@infradead.org> Rationalize include paths in all the libcfs header files. Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs.h | 24 +++++++++++----------- .../lustre/include/linux/libcfs/libcfs_debug.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 3a5ebc2..b48e2f0 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -36,18 +36,18 @@ #include #include -#include "../../uapi/linux/lnet/libcfs_ioctl.h" -#include "linux/libcfs.h" -#include "libcfs_debug.h" -#include "libcfs_private.h" -#include "libcfs_cpu.h" -#include "libcfs_prim.h" -#include "libcfs_time.h" -#include "libcfs_string.h" -#include "libcfs_workitem.h" -#include "libcfs_hash.h" -#include "libcfs_fail.h" -#include "curproc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define LIBCFS_VERSION "0.7.0" diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 91d141d..e7c3741 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -38,7 +38,7 @@ #ifndef __LIBCFS_DEBUG_H__ #define __LIBCFS_DEBUG_H__ -#include "../../uapi/linux/lnet/libcfs_debug.h" +#include /* * Debugging -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:29 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:29 -0400 Subject: [lustre-devel] [PATCH 61/64] staging: lustre: ksocklnd: add include path to Makefile In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-62-git-send-email-jsimmons@infradead.org> Rationalize include paths in the ksocklnd source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/klnds/socklnd/Makefile | 3 +++ drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/Makefile b/drivers/staging/lustre/lnet/klnds/socklnd/Makefile index c011581..a7da1ab 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/Makefile +++ b/drivers/staging/lustre/lnet/klnds/socklnd/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET) += ksocklnd.o ksocklnd-y := socklnd.o socklnd_cb.o socklnd_proto.o socklnd_modparams.o socklnd_lib.o diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 88afe09..e6428c4 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -46,9 +46,9 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lib-lnet.h" -#include "../../../include/linux/lnet/socklnd.h" +#include +#include +#include /* assume one thread for each connection type */ #define SOCKNAL_NSCHEDS 3 -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 15:47:32 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 11:47:32 -0400 Subject: [lustre-devel] [PATCH 64/64] staging: lustre: lnet: cleanup paths for all LNet headers In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502725652-26280-65-git-send-email-jsimmons@infradead.org> Rationalize include paths in all the lnet header files. Signed-off-by: James Simmons --- drivers/staging/lustre/include/linux/lnet/api.h | 2 +- drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 14 +++++++------- drivers/staging/lustre/include/linux/lnet/lib-types.h | 4 ++-- drivers/staging/lustre/include/linux/lnet/socklnd.h | 4 ++-- drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h | 4 ++-- drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h | 2 +- drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h index 01ae62e..9c37f3e 100644 --- a/drivers/staging/lustre/include/linux/lnet/api.h +++ b/drivers/staging/lustre/include/linux/lnet/api.h @@ -44,7 +44,7 @@ * @{ */ -#include "../../uapi/linux/lnet/lnet-types.h" +#include /** \defgroup lnet_init_fini Initialization and cleanup * The LNet must be properly initialized before any LNet calls can be made. diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index bc55d57..e0968ab 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -35,13 +35,13 @@ #ifndef __LNET_LIB_LNET_H__ #define __LNET_LIB_LNET_H__ -#include "../libcfs/libcfs.h" -#include "api.h" -#include "lib-types.h" -#include "../../uapi/linux/lnet/lnet-dlc.h" -#include "../../uapi/linux/lnet/lnet-types.h" -#include "../../uapi/linux/lnet/lnetctl.h" -#include "../../uapi/linux/lnet/nidstr.h" +#include +#include +#include +#include +#include +#include +#include extern struct lnet the_lnet; /* THE network */ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 94d3a53..eea3b8e 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -40,8 +40,8 @@ #include #include -#include "../../uapi/linux/lnet/lnet-types.h" -#include "../../uapi/linux/lnet/lnetctl.h" +#include +#include /* Max payload size */ #define LNET_MAX_PAYLOAD CONFIG_LNET_MAX_PAYLOAD diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h index c24fe45..553fb64 100644 --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h @@ -34,8 +34,8 @@ #ifndef __LNET_LNET_SOCKLND_H__ #define __LNET_LNET_SOCKLND_H__ -#include "../../uapi/linux/lnet/lnet-types.h" -#include "../../uapi/linux/lnet/socklnd.h" +#include +#include struct ksock_hello_msg { __u32 kshm_magic; /* magic number of socklnd message */ diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h index a3821d9..e45d828 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h @@ -29,8 +29,8 @@ #ifndef LNET_DLC_H #define LNET_DLC_H -#include "libcfs_ioctl.h" -#include "lnet-types.h" +#include +#include #define MAX_NUM_SHOW_ENTRIES 32 #define LNET_MAX_STR_LEN 128 diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index f7ffc53..d9da625 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -15,7 +15,7 @@ #ifndef _LNETCTL_H_ #define _LNETCTL_H_ -#include "lnet-types.h" +#include /** \addtogroup lnet_fault_simulation * @{ diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h index d153c97..882074e 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h @@ -28,7 +28,7 @@ #ifndef _LNET_NIDSTRINGS_H #define _LNET_NIDSTRINGS_H -#include "lnet-types.h" +#include /** * Lustre Network Driver types. -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:50 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:50 -0400 Subject: [lustre-devel] [PATCH 00/14] staging: lustre: llite: xattr related handling fixes Message-ID: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> This batch of patches resolves several issues with how lustre handles xattrs. Some of the patches also resolve some style issues with the code. The patch set is order dependent. These fixes resolve some of the test failures that happen. Bobi Jam (2): staging: lustre: llite: break up ll_setstripe_ea function staging: lustre: llite: return from ll_adjust_lum() if lump is NULL Dmitry Eremin (1): staging: lustre: llite: add support set_acl method in inode operations James Simmons (8): staging: lustre: llite: eat -EEXIST on setting trunsted.lov staging: lustre: llite: fix sparse variable length array warning staging: lustre: llite: fix invalid size test in ll_setstripe_ea() staging: lustre: llite: record in stats attempted removal of lma/link xattr staging: lustre: llite: cleanup posix acl xattr code staging: lustre: llite: use proper types in the xattr code staging: lustre: llite: cleanup xattr code comments staging: lustre: llite: style changes in xattr.c Niu Yawei (2): staging: lustre: llite: refactor lustre.lov xattr handling staging: lustre: llite: add simple comment about lustre.lov xattrs Robin Humble (1): staging: lustre: llite: Remove filtering of seclabel xattr drivers/staging/lustre/lustre/llite/file.c | 58 ++++++ .../staging/lustre/lustre/llite/llite_internal.h | 4 + drivers/staging/lustre/lustre/llite/namei.c | 10 +- drivers/staging/lustre/lustre/llite/xattr.c | 222 ++++++++++++--------- 4 files changed, 196 insertions(+), 98 deletions(-) -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:56 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:56 -0400 Subject: [lustre-devel] [PATCH 06/14] staging: lustre: llite: eat -EEXIST on setting trunsted.lov In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-7-git-send-email-jsimmons@infradead.org> Tools like rsync, tar, cp may copy and restore the xattrs on a file. The client previously ignored the setting of trusted.lov/lustre.lov if the layout had already been specified, to avoid causing these tools to fail for no reason. For PFL files we still need to silently eat -EEXIST on setting these attributes to avoid problems. Signed-off-by: Bobi Jam Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9484 Reviewed-on: https://review.whamcloud.com/27126 Reviewed-by: Dmitry Eremin Reviewed-by: Niu Yawei Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index d862189..ca803ed 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -251,12 +251,20 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, lum_size = ll_lov_user_md_size(lump); if (lum_size < 0 || size < lum_size) - return 0; /* b=10667: ignore error */ + return -ERANGE; rc = ll_lov_setstripe_ea_info(inode, dentry, it_flags, lump, lum_size); - /* b=10667: rc always be 0 here for now */ - rc = 0; + /** + * b=10667: ignore -EEXIST. + * Silently eat error on setting trusted.lov/lustre.lov + * attribute for platforms that added the default option + * to copy all attributes in 'cp' command. Both rsync and + * tar --xattrs also will try to set LOVEA for existing + * files. + */ + if (rc == -EEXIST) + rc = 0; } else if (S_ISDIR(inode->i_mode)) { rc = ll_dir_setstripe(inode, lump, 0); } -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:53 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:53 -0400 Subject: [lustre-devel] [PATCH 03/14] staging: lustre: llite: add simple comment about lustre.lov xattrs In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-4-git-send-email-jsimmons@infradead.org> From: Niu Yawei Simple comment added to ll_xattr_set. Signed-off-by: Bobi Jam Signed-off-by: Niu Yawei Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8998 Reviewed-on: https://review.whamcloud.com/24851 Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Jinshan Xiong Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index fb53942..f201021 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -261,6 +261,7 @@ static int ll_xattr_set(const struct xattr_handler *handler, CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p), xattr %s\n", PFID(ll_inode2fid(inode)), inode, name); + /* lustre/trusted.lov.xxx would be passed through xattr API */ if (!strcmp(name, "lov")) { int op_type = flags == XATTR_REPLACE ? LPROC_LL_REMOVEXATTR : LPROC_LL_SETXATTR; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:54 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:54 -0400 Subject: [lustre-devel] [PATCH 04/14] staging: lustre: llite: break up ll_setstripe_ea function In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-5-git-send-email-jsimmons@infradead.org> From: Bobi Jam Place all the handling of information of trusted.lov that is not stripe related into the new function ll_adjust_lum(). Now ll_setstripe_ea() only handles striping information. Signed-off-by: Bobi Jam Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9484 Reviewed-on: https://review.whamcloud.com/27126 Reviewed-by: Dmitry Eremin Reviewed-by: Niu Yawei Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 37 +++++++++++++++++++---------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index f201021..7a17114 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -183,22 +183,10 @@ static int get_hsm_state(struct inode *inode, u32 *hus_states) return rc; } -static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, - size_t size) +static int ll_adjust_lum(struct inode *inode, struct lov_user_md *lump) { - struct inode *inode = d_inode(dentry); int rc = 0; - if (size != 0 && size < sizeof(struct lov_user_md)) - return -EINVAL; - - /* - * It is possible to set an xattr to a "" value of zero size. - * For this case we are going to treat it as a removal. - */ - if (!size && lump) - lump = NULL; - /* Attributes that are saved via getxattr will always have * the stripe_offset as 0. Instead, the MDS should be * allowed to pick the starting OST index. b=17846 @@ -231,6 +219,29 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, } } + return rc; +} + +static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, + size_t size) +{ + struct inode *inode = d_inode(dentry); + int rc = 0; + + if (size != 0 && size < sizeof(struct lov_user_md)) + return -EINVAL; + + /* + * It is possible to set an xattr to a "" value of zero size. + * For this case we are going to treat it as a removal. + */ + if (!size && lump) + lump = NULL; + + rc = ll_adjust_lum(inode, lump); + if (rc) + return rc; + if (lump && S_ISREG(inode->i_mode)) { __u64 it_flags = FMODE_WRITE; int lum_size; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:21:00 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:21:00 -0400 Subject: [lustre-devel] [PATCH 10/14] staging: lustre: llite: cleanup posix acl xattr code In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-11-git-send-email-jsimmons@infradead.org> Have extra ifdef makes the code harder to read. For the case of ll_xattr_get_common() we have a variable initialized at the start of the function but it is only used in XATTR_ACL_ACCESS_T code block. Lets move that variable to that location since its only used there and make the code look cleaner. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/27240 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 5728579..64fa65a 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -397,9 +397,6 @@ static int ll_xattr_get_common(const struct xattr_handler *handler, const char *name, void *buffer, size_t size) { struct ll_sb_info *sbi = ll_i2sbi(inode); -#ifdef CONFIG_FS_POSIX_ACL - struct ll_inode_info *lli = ll_i2info(inode); -#endif char *fullname; int rc; @@ -423,6 +420,7 @@ static int ll_xattr_get_common(const struct xattr_handler *handler, * chance that cached ACL is uptodate. */ if (handler->flags == XATTR_ACL_ACCESS_T) { + struct ll_inode_info *lli = ll_i2info(inode); struct posix_acl *acl; spin_lock(&lli->lli_lock); -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:21:03 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:21:03 -0400 Subject: [lustre-devel] [PATCH 13/14] staging: lustre: llite: style changes in xattr.c In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-14-git-send-email-jsimmons@infradead.org> Small style changes to match more the kernel code standard and it make it more readable. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/27240 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index adaff56..0f5271a 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -81,11 +81,10 @@ static int xattr_type_filter(struct ll_sb_info *sbi, return 0; } -static int -ll_xattr_set_common(const struct xattr_handler *handler, - struct dentry *dentry, struct inode *inode, - const char *name, const void *value, size_t size, - int flags) +static int ll_xattr_set_common(const struct xattr_handler *handler, + struct dentry *dentry, struct inode *inode, + const char *name, const void *value, size_t size, + int flags) { struct ll_sb_info *sbi = ll_i2sbi(inode); struct ptlrpc_request *req = NULL; @@ -140,9 +139,8 @@ static int xattr_type_filter(struct ll_sb_info *sbi, if (!fullname) return -ENOMEM; - rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), - valid, fullname, pv, size, 0, flags, - ll_i2suppgid(inode), &req); + rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid, fullname, + pv, size, 0, flags, ll_i2suppgid(inode), &req); kfree(fullname); if (rc) { if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) { @@ -308,9 +306,8 @@ static int ll_xattr_set(const struct xattr_handler *handler, flags); } -int -ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer, - size_t size, u64 valid) +int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer, + size_t size, u64 valid) { struct ll_inode_info *lli = ll_i2info(inode); struct ll_sb_info *sbi = ll_i2sbi(inode); @@ -565,6 +562,7 @@ ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size) OBD_MD_FLXATTRLS); if (rc < 0) return rc; + /* * If we're being called to get the size of the xattr list * (size == 0) then just assume that a lustre.lov xattr -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:21:04 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:21:04 -0400 Subject: [lustre-devel] [PATCH 14/14] staging: lustre: llite: add support set_acl method in inode operations In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-15-git-send-email-jsimmons@infradead.org> From: Dmitry Eremin Linux kernel v3.14 adds set_acl method to inode operations. This patch adds support to Lustre for proper acl management. Signed-off-by: Dmitry Eremin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/25965 Reviewed-by: Bob Glossman Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/file.c | 58 ++++++++++++++++++++++ .../staging/lustre/lustre/llite/llite_internal.h | 4 ++ drivers/staging/lustre/lustre/llite/namei.c | 10 +++- 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 215479a..06a474e 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -3027,6 +3027,7 @@ static int ll_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, return rc; } +#ifdef CONFIG_FS_POSIX_ACL struct posix_acl *ll_get_acl(struct inode *inode, int type) { struct ll_inode_info *lli = ll_i2info(inode); @@ -3040,6 +3041,60 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type) return acl; } +int ll_set_acl(struct inode *inode, struct posix_acl *acl, int type) +{ + const char *name = NULL; + char *value = NULL; + size_t size = 0; + int rc = 0; + + switch (type) { + case ACL_TYPE_ACCESS: + if (acl) { + rc = posix_acl_update_mode(inode, &inode->i_mode, &acl); + if (rc) + goto out; + } + name = XATTR_NAME_POSIX_ACL_ACCESS; + break; + case ACL_TYPE_DEFAULT: + if (!S_ISDIR(inode->i_mode)) { + rc = acl ? -EACCES : 0; + goto out; + } + name = XATTR_NAME_POSIX_ACL_DEFAULT; + break; + default: + rc = -EINVAL; + goto out; + } + + if (acl) { + size = posix_acl_xattr_size(acl->a_count); + value = kmalloc(size, GFP_NOFS); + if (!value) { + rc = -ENOMEM; + goto out; + } + + rc = posix_acl_to_xattr(&init_user_ns, acl, value, size); + if (rc < 0) + goto out_free; + } + + /* dentry is only used for *.lov attributes so it's safe to be NULL */ + rc = __vfs_setxattr(NULL, inode, name, value, size, XATTR_CREATE); +out_free: + kfree(value); +out: + if (!rc) + set_cached_acl(inode, type, acl); + else + forget_cached_acl(inode, type); + return rc; +} +#endif /* CONFIG_FS_POSIX_ACL */ + int ll_inode_permission(struct inode *inode, int mask) { struct ll_sb_info *sbi; @@ -3161,7 +3216,10 @@ int ll_inode_permission(struct inode *inode, int mask) .permission = ll_inode_permission, .listxattr = ll_listxattr, .fiemap = ll_fiemap, +#ifdef CONFIG_FS_POSIX_ACL .get_acl = ll_get_acl, + .set_acl = ll_set_acl, +#endif }; /* dynamic ioctl number support routines */ diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index cd3311a..18e350e 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -751,7 +751,11 @@ enum ldlm_mode ll_take_md_lock(struct inode *inode, __u64 bits, int ll_md_real_close(struct inode *inode, fmode_t fmode); int ll_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags); +#ifdef CONFIG_FS_POSIX_ACL struct posix_acl *ll_get_acl(struct inode *inode, int type); +int ll_set_acl(struct inode *inode, struct posix_acl *acl, int type); +#endif /* CONFIG_FS_POSIX_ACL */ + int ll_migrate(struct inode *parent, struct file *file, int mdtidx, const char *name, int namelen); int ll_get_fid_by_name(struct inode *parent, const char *name, diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index a208a8b..3f8f2ce 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -1186,7 +1186,10 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild, .getattr = ll_getattr, .permission = ll_inode_permission, .listxattr = ll_listxattr, - .get_acl = ll_get_acl, +#ifdef CONFIG_FS_POSIX_ACL + .get_acl = ll_get_acl, + .set_acl = ll_set_acl, +#endif }; const struct inode_operations ll_special_inode_operations = { @@ -1194,5 +1197,8 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild, .getattr = ll_getattr, .permission = ll_inode_permission, .listxattr = ll_listxattr, - .get_acl = ll_get_acl, +#ifdef CONFIG_FS_POSIX_ACL + .get_acl = ll_get_acl, + .set_acl = ll_set_acl, +#endif }; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:55 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:55 -0400 Subject: [lustre-devel] [PATCH 05/14] staging: lustre: llite: return from ll_adjust_lum() if lump is NULL In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-6-git-send-email-jsimmons@infradead.org> From: Bobi Jam No need to check several times if lump is NULL. Just test once and return 0 if NULL. Signed-off-by: Bobi Jam Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9484 Reviewed-on: https://review.whamcloud.com/27126 Reviewed-by: Dmitry Eremin Reviewed-by: Niu Yawei Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 7a17114..d862189 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -187,15 +187,18 @@ static int ll_adjust_lum(struct inode *inode, struct lov_user_md *lump) { int rc = 0; + if (!lump) + return 0; + /* Attributes that are saved via getxattr will always have * the stripe_offset as 0. Instead, the MDS should be * allowed to pick the starting OST index. b=17846 */ - if (lump && lump->lmm_stripe_offset == 0) + if (lump->lmm_stripe_offset == 0) lump->lmm_stripe_offset = -1; /* Avoid anyone directly setting the RELEASED flag. */ - if (lump && (lump->lmm_pattern & LOV_PATTERN_F_RELEASED)) { + if (lump->lmm_pattern & LOV_PATTERN_F_RELEASED) { /* Only if we have a released flag check if the file * was indeed archived. */ -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:21:01 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:21:01 -0400 Subject: [lustre-devel] [PATCH 11/14] staging: lustre: llite: use proper types in the xattr code In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-12-git-send-email-jsimmons@infradead.org> Convert __uXX types to uXX types since this is kernel code. The function ll_lov_user_md_size() returns ssize_t so change lum_size from int to ssize_t. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/27240 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 64fa65a..ff11dd8 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -91,7 +91,7 @@ static int xattr_type_filter(struct ll_sb_info *sbi, struct ptlrpc_request *req = NULL; const char *pv = value; char *fullname; - __u64 valid; + u64 valid; int rc; if (flags == XATTR_REPLACE) { @@ -247,8 +247,8 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, return rc; if (lump && S_ISREG(inode->i_mode)) { - __u64 it_flags = FMODE_WRITE; - int lum_size; + u64 it_flags = FMODE_WRITE; + ssize_t lum_size; lum_size = ll_lov_user_md_size(lump); if (lum_size < 0 || size < lum_size) @@ -310,7 +310,7 @@ static int ll_xattr_set(const struct xattr_handler *handler, int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer, - size_t size, __u64 valid) + size_t size, u64 valid) { struct ll_inode_info *lli = ll_i2info(inode); struct ll_sb_info *sbi = ll_i2sbi(inode); -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:57 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:57 -0400 Subject: [lustre-devel] [PATCH 07/14] staging: lustre: llite: fix sparse variable length array warning In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-8-git-send-email-jsimmons@infradead.org> Currently sparse reports "warning: Variable length array is used." The solution is use kasprintf to allocate full xattr name. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/27240 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index ca803ed..86b5df9 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -87,10 +87,10 @@ static int xattr_type_filter(struct ll_sb_info *sbi, const char *name, const void *value, size_t size, int flags) { - char fullname[strlen(handler->prefix) + strlen(name) + 1]; struct ll_sb_info *sbi = ll_i2sbi(inode); struct ptlrpc_request *req = NULL; const char *pv = value; + char *fullname; __u64 valid; int rc; @@ -136,10 +136,14 @@ static int xattr_type_filter(struct ll_sb_info *sbi, return -EPERM; } - sprintf(fullname, "%s%s\n", handler->prefix, name); + fullname = kasprintf(GFP_KERNEL, "%s%s", handler->prefix, name); + if (!fullname) + return -ENOMEM; + rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid, fullname, pv, size, 0, flags, ll_i2suppgid(inode), &req); + kfree(fullname); if (rc) { if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) { LCONSOLE_INFO("Disabling user_xattr feature because it is not supported on the server\n"); @@ -389,11 +393,11 @@ static int ll_xattr_get_common(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, void *buffer, size_t size) { - char fullname[strlen(handler->prefix) + strlen(name) + 1]; struct ll_sb_info *sbi = ll_i2sbi(inode); #ifdef CONFIG_FS_POSIX_ACL struct ll_inode_info *lli = ll_i2info(inode); #endif + char *fullname; int rc; CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p)\n", @@ -432,9 +436,15 @@ static int ll_xattr_get_common(const struct xattr_handler *handler, if (handler->flags == XATTR_ACL_DEFAULT_T && !S_ISDIR(inode->i_mode)) return -ENODATA; #endif - sprintf(fullname, "%s%s\n", handler->prefix, name); - return ll_xattr_list(inode, fullname, handler->flags, buffer, size, - OBD_MD_FLXATTR); + + fullname = kasprintf(GFP_KERNEL, "%s%s", handler->prefix, name); + if (!fullname) + return -ENOMEM; + + rc = ll_xattr_list(inode, fullname, handler->flags, buffer, size, + OBD_MD_FLXATTR); + kfree(fullname); + return rc; } static ssize_t ll_getxattr_lov(struct inode *inode, void *buf, size_t buf_size) -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:58 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:58 -0400 Subject: [lustre-devel] [PATCH 08/14] staging: lustre: llite: fix invalid size test in ll_setstripe_ea() In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-9-git-send-email-jsimmons@infradead.org> The size check at the start of ll_setstripe_ea() is only valid for a directory. Move that check to the section of code handling the S_ISDIR case. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/27240 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 86b5df9..a54be09 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -235,9 +235,6 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, struct inode *inode = d_inode(dentry); int rc = 0; - if (size != 0 && size < sizeof(struct lov_user_md)) - return -EINVAL; - /* * It is possible to set an xattr to a "" value of zero size. * For this case we are going to treat it as a removal. @@ -270,6 +267,9 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, if (rc == -EEXIST) rc = 0; } else if (S_ISDIR(inode->i_mode)) { + if (size != 0 && size < sizeof(struct lov_user_md)) + return -EINVAL; + rc = ll_dir_setstripe(inode, lump, 0); } -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:21:02 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:21:02 -0400 Subject: [lustre-devel] [PATCH 12/14] staging: lustre: llite: cleanup xattr code comments In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-13-git-send-email-jsimmons@infradead.org> Add proper punctuation to the comments. Change buf_size to size for comment in ll_listxattr() since buf_size doesn't exit which will confuse someone reading the code. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/27240 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index ff11dd8..adaff56 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -567,7 +567,7 @@ ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size) return rc; /* * If we're being called to get the size of the xattr list - * (buf_size == 0) then just assume that a lustre.lov xattr + * (size == 0) then just assume that a lustre.lov xattr * exists. */ if (!size) @@ -580,14 +580,14 @@ ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size) len = strnlen(xattr_name, rem - 1) + 1; rem -= len; if (!xattr_type_filter(sbi, get_xattr_type(xattr_name))) { - /* Skip OK xattr type leave it in buffer */ + /* Skip OK xattr type, leave it in buffer. */ xattr_name += len; continue; } /* * Move up remaining xattrs in buffer - * removing the xattr that is not OK + * removing the xattr that is not OK. */ memmove(xattr_name, xattr_name + len, rem); rc -= len; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:52 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:52 -0400 Subject: [lustre-devel] [PATCH 02/14] staging: lustre: llite: refactor lustre.lov xattr handling In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-3-git-send-email-jsimmons@infradead.org> From: Niu Yawei The function ll_xattr_set() contains special code to handle the lustre specific xattr lustre.lov. Move all this code to a new function ll_setstripe_ea(). Signed-off-by: Bobi Jam Signed-off-by: Niu Yawei Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8998 Reviewed-on: https://review.whamcloud.com/24851 Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Jinshan Xiong Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 131 +++++++++++++++------------- 1 file changed, 69 insertions(+), 62 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 56f42b8..fb53942 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -183,6 +183,73 @@ static int get_hsm_state(struct inode *inode, u32 *hus_states) return rc; } +static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump, + size_t size) +{ + struct inode *inode = d_inode(dentry); + int rc = 0; + + if (size != 0 && size < sizeof(struct lov_user_md)) + return -EINVAL; + + /* + * It is possible to set an xattr to a "" value of zero size. + * For this case we are going to treat it as a removal. + */ + if (!size && lump) + lump = NULL; + + /* Attributes that are saved via getxattr will always have + * the stripe_offset as 0. Instead, the MDS should be + * allowed to pick the starting OST index. b=17846 + */ + if (lump && lump->lmm_stripe_offset == 0) + lump->lmm_stripe_offset = -1; + + /* Avoid anyone directly setting the RELEASED flag. */ + if (lump && (lump->lmm_pattern & LOV_PATTERN_F_RELEASED)) { + /* Only if we have a released flag check if the file + * was indeed archived. + */ + u32 state = HS_NONE; + + rc = get_hsm_state(inode, &state); + if (rc) + return rc; + + if (!(state & HS_ARCHIVED)) { + CDEBUG(D_VFSTRACE, + "hus_states state = %x, pattern = %x\n", + state, lump->lmm_pattern); + /* + * Here the state is: real file is not + * archived but user is requesting to set + * the RELEASED flag so we mask off the + * released flag from the request + */ + lump->lmm_pattern ^= LOV_PATTERN_F_RELEASED; + } + } + + if (lump && S_ISREG(inode->i_mode)) { + __u64 it_flags = FMODE_WRITE; + int lum_size; + + lum_size = ll_lov_user_md_size(lump); + if (lum_size < 0 || size < lum_size) + return 0; /* b=10667: ignore error */ + + rc = ll_lov_setstripe_ea_info(inode, dentry, it_flags, lump, + lum_size); + /* b=10667: rc always be 0 here for now */ + rc = 0; + } else if (S_ISDIR(inode->i_mode)) { + rc = ll_dir_setstripe(inode, lump, 0); + } + + return rc; +} + static int ll_xattr_set(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, const void *value, size_t size, @@ -195,73 +262,13 @@ static int ll_xattr_set(const struct xattr_handler *handler, PFID(ll_inode2fid(inode)), inode, name); if (!strcmp(name, "lov")) { - struct lov_user_md *lump = (struct lov_user_md *)value; int op_type = flags == XATTR_REPLACE ? LPROC_LL_REMOVEXATTR : LPROC_LL_SETXATTR; - int rc = 0; ll_stats_ops_tally(ll_i2sbi(inode), op_type, 1); - if (size != 0 && size < sizeof(struct lov_user_md)) - return -EINVAL; - - /* - * It is possible to set an xattr to a "" value of zero size. - * For this case we are going to treat it as a removal. - */ - if (!size && lump) - lump = NULL; - - /* Attributes that are saved via getxattr will always have - * the stripe_offset as 0. Instead, the MDS should be - * allowed to pick the starting OST index. b=17846 - */ - if (lump && lump->lmm_stripe_offset == 0) - lump->lmm_stripe_offset = -1; - - /* Avoid anyone directly setting the RELEASED flag. */ - if (lump && (lump->lmm_pattern & LOV_PATTERN_F_RELEASED)) { - /* Only if we have a released flag check if the file - * was indeed archived. - */ - u32 state = HS_NONE; - - rc = get_hsm_state(inode, &state); - if (rc) - return rc; - - if (!(state & HS_ARCHIVED)) { - CDEBUG(D_VFSTRACE, - "hus_states state = %x, pattern = %x\n", - state, lump->lmm_pattern); - /* - * Here the state is: real file is not - * archived but user is requesting to set - * the RELEASED flag so we mask off the - * released flag from the request - */ - lump->lmm_pattern ^= LOV_PATTERN_F_RELEASED; - } - } - - if (lump && S_ISREG(inode->i_mode)) { - __u64 it_flags = FMODE_WRITE; - int lum_size; - - lum_size = ll_lov_user_md_size(lump); - if (lum_size < 0 || size < lum_size) - return 0; /* b=10667: ignore error */ - - rc = ll_lov_setstripe_ea_info(inode, dentry, it_flags, - lump, lum_size); - /* b=10667: rc always be 0 here for now */ - rc = 0; - } else if (S_ISDIR(inode->i_mode)) { - rc = ll_dir_setstripe(inode, lump, 0); - } - - return rc; - + return ll_setstripe_ea(dentry, (struct lov_user_md *)value, + size); } else if (!strcmp(name, "lma") || !strcmp(name, "link")) { ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_SETXATTR, 1); return 0; -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:51 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:51 -0400 Subject: [lustre-devel] [PATCH v2 01/14] staging: lustre: llite: Remove filtering of seclabel xattr In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-2-git-send-email-jsimmons@infradead.org> From: Robin Humble The security.capability xattr is used to implement File Capabilities in recent Linux versions. Capabilities are a fine grained approach to granting executables elevated privileges. eg. /bin/ping can have capabilities cap_net_admin, cap_net_raw+ep instead of being setuid root. This xattr has long been filtered out by llite, initially for stability reasons (b15587), and later over performance concerns as this xattr is read for every file with eg. 'ls --color'. Since LU-2869 xattr's are cached on clients, alleviating most performance concerns. Removing llite's filtering of the security.capability xattr enables using Lustre as a root filesystem, which is used on some large clusters. Signed-off-by: Robin Humble Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9562 Reviewed-on: https://review.whamcloud.com/27292 Reviewed-by: John L. Hammond Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- Changelog: v1) Initial submit with wrong patch attached. v2) Proper patch this time. drivers/staging/lustre/lustre/llite/xattr.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index d0cad7e..56f42b8 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -117,11 +117,6 @@ static int xattr_type_filter(struct ll_sb_info *sbi, (handler->flags == XATTR_LUSTRE_T && !strcmp(name, "lov")))) return 0; - /* b15587: ignore security.capability xattr for now */ - if ((handler->flags == XATTR_SECURITY_T && - !strcmp(name, "capability"))) - return 0; - /* LU-549: Disable security.selinux when selinux is disabled */ if (handler->flags == XATTR_SECURITY_T && !selinux_is_enabled() && strcmp(name, "selinux") == 0) @@ -380,10 +375,6 @@ static int ll_xattr_get_common(const struct xattr_handler *handler, if (rc) return rc; - /* b15587: ignore security.capability xattr for now */ - if ((handler->flags == XATTR_SECURITY_T && !strcmp(name, "capability"))) - return -ENODATA; - /* LU-549: Disable security.selinux when selinux is disabled */ if (handler->flags == XATTR_SECURITY_T && !selinux_is_enabled() && !strcmp(name, "selinux")) -- 1.8.3.1 From jsimmons at infradead.org Mon Aug 14 16:20:59 2017 From: jsimmons at infradead.org (James Simmons) Date: Mon, 14 Aug 2017 12:20:59 -0400 Subject: [lustre-devel] [PATCH 09/14] staging: lustre: llite: record in stats attempted removal of lma/link xattr In-Reply-To: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> Message-ID: <1502727664-29438-10-git-send-email-jsimmons@infradead.org> Keep track of attempted deletions as well as changing of the lma/link xattrs. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183 Reviewed-on: https://review.whamcloud.com/27240 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/xattr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index a54be09..5728579 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -297,7 +297,10 @@ static int ll_xattr_set(const struct xattr_handler *handler, return ll_setstripe_ea(dentry, (struct lov_user_md *)value, size); } else if (!strcmp(name, "lma") || !strcmp(name, "link")) { - ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_SETXATTR, 1); + int op_type = flags == XATTR_REPLACE ? LPROC_LL_REMOVEXATTR : + LPROC_LL_SETXATTR; + + ll_stats_ops_tally(ll_i2sbi(inode), op_type, 1); return 0; } -- 1.8.3.1 From dan.carpenter at oracle.com Tue Aug 15 11:12:14 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Tue, 15 Aug 2017 14:12:14 +0300 Subject: [lustre-devel] [bug report] staging: lustre: lov: Ensure correct operation for large object sizes In-Reply-To: References: <20170801111058.xlmx7tmvmfkyihxh@mwanda> Message-ID: <20170815110145.i5gn3cxn4ss5mm3k@mwanda> On Mon, Aug 14, 2017 at 04:09:34PM +0100, James Simmons wrote: > > > Hello Nathaniel Clark, > > > > The patch 476f575cf070: "staging: lustre: lov: Ensure correct > > operation for large object sizes" from Jul 26, 2017, leads to the > > following static checker warning: > > > > drivers/staging/lustre/lustre/lov/lov_ea.c:207 lsm_unpackmd_common() > > warn: signed overflow undefined. 'min_stripe_maxbytes * stripe_count < min_stripe_maxbytes' > > > > drivers/staging/lustre/lustre/lov/lov_ea.c > > 148 static int lsm_unpackmd_common(struct lov_obd *lov, > > 149 struct lov_stripe_md *lsm, > > 150 struct lov_mds_md *lmm, > > 151 struct lov_ost_data_v1 *objects) > > 152 { > > 153 loff_t min_stripe_maxbytes = 0; > > ^^^^^^ > > loff_t is long long. > > > > 154 unsigned int stripe_count; > > 155 struct lov_oinfo *loi; > > 156 loff_t lov_bytes; > > 157 unsigned int i; > > 158 > > 159 /* > > 160 * This supposes lov_mds_md_v1/v3 first fields are > > 161 * are the same > > 162 */ > > 163 lmm_oi_le_to_cpu(&lsm->lsm_oi, &lmm->lmm_oi); > > 164 lsm->lsm_stripe_size = le32_to_cpu(lmm->lmm_stripe_size); > > 165 lsm->lsm_pattern = le32_to_cpu(lmm->lmm_pattern); > > 166 lsm->lsm_layout_gen = le16_to_cpu(lmm->lmm_layout_gen); > > 167 lsm->lsm_pool_name[0] = '\0'; > > 168 > > 169 stripe_count = lsm_is_released(lsm) ? 0 : lsm->lsm_stripe_count; > > 170 > > 171 for (i = 0; i < stripe_count; i++) { > > 172 loi = lsm->lsm_oinfo[i]; > > 173 ostid_le_to_cpu(&objects[i].l_ost_oi, &loi->loi_oi); > > 174 loi->loi_ost_idx = le32_to_cpu(objects[i].l_ost_idx); > > 175 loi->loi_ost_gen = le32_to_cpu(objects[i].l_ost_gen); > > 176 if (lov_oinfo_is_dummy(loi)) > > 177 continue; > > 178 > > 179 if (loi->loi_ost_idx >= lov->desc.ld_tgt_count && > > 180 !lov2obd(lov)->obd_process_conf) { > > 181 CERROR("%s: OST index %d more than OST count %d\n", > > 182 (char *)lov->desc.ld_uuid.uuid, > > 183 loi->loi_ost_idx, lov->desc.ld_tgt_count); > > 184 lov_dump_lmm_v1(D_WARNING, lmm); > > 185 return -EINVAL; > > 186 } > > 187 > > 188 if (!lov->lov_tgts[loi->loi_ost_idx]) { > > 189 CERROR("%s: OST index %d missing\n", > > 190 (char *)lov->desc.ld_uuid.uuid, > > 191 loi->loi_ost_idx); > > 192 lov_dump_lmm_v1(D_WARNING, lmm); > > 193 continue; > > 194 } > > 195 > > 196 lov_bytes = lov_tgt_maxbytes(lov->lov_tgts[loi->loi_ost_idx]); > > 197 if (min_stripe_maxbytes == 0 || lov_bytes < min_stripe_maxbytes) > > 198 min_stripe_maxbytes = lov_bytes; > > 199 } > > 200 > > 201 if (min_stripe_maxbytes == 0) > > 202 min_stripe_maxbytes = LUSTRE_EXT3_STRIPE_MAXBYTES; > > 203 > > 204 stripe_count = lsm->lsm_stripe_count ?: lov->desc.ld_tgt_count; > > 205 lov_bytes = min_stripe_maxbytes * stripe_count; > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > This is undefined in C. > > > > 206 > > 207 if (lov_bytes < min_stripe_maxbytes) /* handle overflow */ > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > So this might be wrong. > > > > 208 lsm->lsm_maxbytes = MAX_LFS_FILESIZE; > > 209 else > > 210 lsm->lsm_maxbytes = lov_bytes; > > 211 > > 212 return 0; > > 213 } > > Dan what exact command did you use to find this bug? We do use smatch to > find these kinds of issues before patches land but some how we are missing > this class from time to time. > > Just to let you know the bug is being tracked under > > https://jira.hpdd.intel.com/browse/LU-9862 > > We do have a patch as well under going testing and review. It's something I hadn't pushed. I'll push that check right now. But it has few warnings and I'm not actually sure it matters with the kernel. regards, dan carpenter From cakturk at gmail.com Wed Aug 16 14:44:15 2017 From: cakturk at gmail.com (Cihangir Akturk) Date: Wed, 16 Aug 2017 17:44:15 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: fix structure size for ARM OABI Message-ID: <1502894655-9731-1-git-send-email-cakturk@gmail.com> When building the kernel for the ARM architecture without setting CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 differs, due to different alignment requirements of OABI and EABI. Marking the anonymous union within struct lov_user_md_v3 as '_packed' solves this issue. Otherwise we get the following error: drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion of macro ‘BUILD_BUG_ON’ BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3)); Signed-off-by: Cihangir Akturk --- drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index edff8dc..4f72cb6 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -388,7 +388,7 @@ struct lov_user_md_v3 { /* LOV EA user data (host-endian) */ __u16 lmm_layout_gen; /* layout generation number * used when reading */ - }; + } __packed; char lmm_pool_name[LOV_MAXPOOLNAME + 1]; /* pool name */ struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */ } __packed; -- 2.7.4 From gregkh at linuxfoundation.org Thu Aug 17 15:47:52 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Thu, 17 Aug 2017 08:47:52 -0700 Subject: [lustre-devel] [PATCH] staging: lustre: lustre: Off by two in lmv_fid2path() In-Reply-To: References: <20170728144227.uml3x27mqug3ciox@mwanda> Message-ID: <20170817154752.GA18912@kroah.com> On Mon, Aug 14, 2017 at 04:01:17PM +0100, James Simmons wrote: > > > We want to concatonate join string one, a '/' character, string two and > > then a NUL terminator. The destination buffer holds ori_gf->gf_pathlen > > characters. The strlen() function returns the number of characters not > > counting the NUL terminator. So we should be adding two extra spaces, > > one for the foward slash and one for the NUL. > > > > Signed-off-by: Dan Carpenter > > --- > > Not tested. Please review this one carefully. > > This is a real bug which is impacting users. The bug is being tracked > at https://jira.hpdd.intel.com/browse/LU-9863. It passed our test suite > and its being reviewed. So what am I supposed to do with this patch? From gregkh at linuxfoundation.org Thu Aug 17 16:22:39 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Thu, 17 Aug 2017 09:22:39 -0700 Subject: [lustre-devel] [PATCH 00/64] staging: lustre: uapi: normalize the lustre headers In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> References: <1502725652-26280-1-git-send-email-jsimmons@infradead.org> Message-ID: <20170817162239.GA22674@kroah.com> On Mon, Aug 14, 2017 at 11:46:28AM -0400, James Simmons wrote: > The headers for lustre/LNet for a long time lacked a clean separation in > its internal headers which resulted in kernel specific data structures > being exposed in user land code. This work unravels this mess and creates > a clear separation between lustre kernel space and lustre user land. > With this work done the include paths in the lustre kernel code can now > be normalized. Nice work, all now applied. greg k-h From gregkh at linuxfoundation.org Thu Aug 17 16:23:48 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Thu, 17 Aug 2017 09:23:48 -0700 Subject: [lustre-devel] [PATCH v2 01/14] staging: lustre: llite: Remove filtering of seclabel xattr In-Reply-To: <1502727664-29438-2-git-send-email-jsimmons@infradead.org> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> <1502727664-29438-2-git-send-email-jsimmons@infradead.org> Message-ID: <20170817162348.GA22834@kroah.com> On Mon, Aug 14, 2017 at 12:20:51PM -0400, James Simmons wrote: > From: Robin Humble > > The security.capability xattr is used to implement File > Capabilities in recent Linux versions. Capabilities are a > fine grained approach to granting executables elevated > privileges. eg. /bin/ping can have capabilities > cap_net_admin, cap_net_raw+ep instead of being setuid root. > > This xattr has long been filtered out by llite, initially for > stability reasons (b15587), and later over performance > concerns as this xattr is read for every file with eg. > 'ls --color'. Since LU-2869 xattr's are cached on clients, > alleviating most performance concerns. > > Removing llite's filtering of the security.capability xattr > enables using Lustre as a root filesystem, which is used on > some large clusters. > > Signed-off-by: Robin Humble > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9562 > Reviewed-on: https://review.whamcloud.com/27292 > Reviewed-by: John L. Hammond > Reviewed-by: Sebastien Buisson > Reviewed-by: Oleg Drokin > Signed-off-by: James Simmons > --- > Changelog: > > v1) Initial submit with wrong patch attached. > v2) Proper patch this time. I don't see a v1 patch anywhere... Anyway, when you do this, please make your subject such that I can sort the emails properly and they show up in the correct order, so put the "v2" after the patch number like this: Subject: [PATCH 01/14 v2] staging: lustre: llite: Remove filtering of I think git does that correctly for you automatically if you use it... thanks, greg k-h From gregkh at linuxfoundation.org Thu Aug 17 16:26:39 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Thu, 17 Aug 2017 09:26:39 -0700 Subject: [lustre-devel] [PATCH] staging: lustre: fix structure size for ARM OABI In-Reply-To: <1502894655-9731-1-git-send-email-cakturk@gmail.com> References: <1502894655-9731-1-git-send-email-cakturk@gmail.com> Message-ID: <20170817162639.GA13066@kroah.com> On Wed, Aug 16, 2017 at 05:44:15PM +0300, Cihangir Akturk wrote: > When building the kernel for the ARM architecture without setting > CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 > differs, due to different alignment requirements of OABI and EABI. > > Marking the anonymous union within struct lov_user_md_v3 as > '_packed' solves this issue. Otherwise we get the following > error: > > drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion > of macro ‘BUILD_BUG_ON’ > BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3)); > > Signed-off-by: Cihangir Akturk > --- > drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This file is no longer in the tree :( thanks, greg k-h From simmonsja at ornl.gov Thu Aug 17 19:57:45 2017 From: simmonsja at ornl.gov (Simmons, James A.) Date: Thu, 17 Aug 2017 19:57:45 +0000 Subject: [lustre-devel] Lustre on Summitdev In-Reply-To: <445D4849EC1E0340982C153449289314E666380559@AMASMAI-ED21.main.glb.corp.local> References: <445D4849EC1E0340982C153449289314E6661BE9A4@AMASMAI-ED21.main.glb.corp.local> <90FC3FDD-9209-4644-84F0-71F50C408AF4@ornl.gov> <445D4849EC1E0340982C153449289314E666265378@AMASMAI-ED21.main.glb.corp.local> <80db2b91-d214-b1ee-aee3-088694b0759f@ornl.gov> <6a83013203104b0685a3329b386741f1@EXCHCS32.ornl.gov> <91303b99ba744c6baba08d57f6fe71da@EXCHCS32.ornl.gov> <445D4849EC1E0340982C153449289314E66626560F@AMASMAI-ED21.main.glb.corp.local> <85782fcbfc294f4283ba1dd058fb1d94@EXCHCS32.ornl.gov> <090073ac2a76451888737dc755d5f64e@EXCHCS32.ornl.gov> <445D4849EC1E0340982C153449289314E666380559@AMASMAI-ED21.main.glb.corp.local> Message-ID: >Hi James, > >Are you able to disclose what OS version/stack you’re running on Summitdev where you have Lustre mounted? Is the machine running Ubuntu? > >There seem to be significant pains to get the client working here on the ppcle platform, under RHEL/Centos 7. Moved this topic to lustre-devel. So my Power8 clients are RHEL7.3. First to make life easy for you please download the latest lustre 2.10 client. git clone git://git.hpdd.intel.com/fs/lustre/lustre-release git checkout –b b2_10 origin/b2_10 The latest has almost all the patches you need. The reason for your build failure is due to the lack of SNMP on the nodes. The lustre spec file assumes SNMP is always there. This is wrong and I opened a ticket - https://jira.hpdd.intel.com/browse/LU-9870. I created a patch that resolves this. Just download from here - https://review.whamcloud.com/#/c/28494 and apply. With that you should be able to build your rpms. Now you try to mount and run into https://jira.hpdd.intel.com/browse/LU-9823 I can’t help you since I don’t have a solution. I do have a patch in the works to fix several of the config log issues (LU-7004) which I hope will fix this issue. From: Russell JONES Sent: Wednesday, August 09, 2017 4:41 PM To: 'Simmons, James A.'; Donny COOPER; Leverman, Dustin B.; Mehta, Kshitij V.; Oral, H. Sarp; Hill, Jason J. Subject: RE: Lustre on Summitdev No worries about the delay ☺ No, not cross compiling. I have been giving it that configure flag because without it, it was not detecting the architecture correctly (gave me an error about attempting to build for big endian when system is little endian). I suppose I should have pointed that out at the beginning, sorry. I had been attempting to resolve these other issues long enough that I honestly forgot I was even adding it in there! This decision and the architecture error was prior to cloning the current lustre tree and applying your patch. I started over with a clean copy of the source tree again, reapplied your patch, and re-ran autogen and configure with the following flags: ./configure --disable-server --with-o2ib=/usr/src/ofa_kernel/default --disable-tests. Configure completes as does make. Make rpms errors with: + basemodpath=/tmp/rpmbuild-lustre-l0360328-nY6H5CMn/BUILDROOT/lustre-2.10.0_25_gc25132d_dirty-1.ppc64le/lib/modules/3.10.0-514.el7.ppc64le/extra/lustre-client + : + echo /usr/lib/systemd/system/lnet.service + echo /etc/init.d/lsvcgss + find /tmp/rpmbuild-lustre-l0360328-nY6H5CMn/BUILDROOT/lustre-2.10.0_25_gc25132d_dirty-1.ppc64le -name '*.so' -type f -exec chmod +x '{}' ';' + rm -f /tmp/rpmbuild-lustre-l0360328-nY6H5CMn/BUILDROOT/lustre-2.10.0_25_gc25132d_dirty-1.ppc64le/usr/lib64/liblnetconfig.la + echo '%attr(-, root, root) /usr/lib64/liblnetconfig.a' + echo '%attr(-, root, root) /usr/lib64/liblnetconfig.so' + echo '%attr(-, root, root) /usr/lib64/liblnetconfig.so.*' + '[' -d /tmp/rpmbuild-lustre-l0360328-nY6H5CMn/BUILDROOT/lustre-2.10.0_25_gc25132d_dirty-1.ppc64le/usr/lib64/lustre/snmp ']' + mkdir -p /tmp/rpmbuild-lustre-l0360328-nY6H5CMn/BUILDROOT/lustre-2.10.0_25_gc25132d_dirty-1.ppc64le//usr/share/lustre + find /tmp/rpmbuild-lustre-l0360328-nY6H5CMn/BUILDROOT/lustre-2.10.0_25_gc25132d_dirty-1.ppc64le/usr/lib64/lustre -name '*.la' -type f -exec rm -f '{}' ';' find: '/tmp/rpmbuild-lustre-l0360328-nY6H5CMn/BUILDROOT/lustre-2.10.0_25_gc25132d_dirty-1.ppc64le/usr/lib64/lustre': No such file or directory error: Bad exit status from /tmp/rpmbuild-lustre-l0360328-nY6H5CMn/TMP/rpm-tmp.XgLKEM (%install) From: Simmons, James A. [mailto:simmonsja at ornl.gov] Sent: Wednesday, August 09, 2017 3:18 PM To: Russell JONES; Donny COOPER; Leverman, Dustin B.; Mehta, Kshitij V.; Oral, H. Sarp; Hill, Jason J. Subject: RE: Lustre on Summitdev >> Did you install libyaml-devel rpm? >Yes, both libyaml and libyaml-devel are installed. > > >I have successfully cloned and applied the patch without errors. Autogen and configure finish just fine, however a make errors out with: >gcc -DHAVE_CONFIG_H -I. -I../.. -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1 -include /home/l0360328/lustre->release/undef.h -include /home/l0360328/lustre-release/config.h -I/home/l0360328/lustre-release/libcfs/include -I/home/l0360328/lustre->release/lnet/include -I/home/l0360328/lustre-release/lustre/include -I/home/l0360328/lustre-release/lustre/include/uapi -fPIC -g -O2 -MT >libcfsutil_a-parser.o -MD -MP -MF .deps/libcfsutil_a-parser.Tpo -c -o libcfsutil_a-parser.o `test -f 'util/parser.c' || echo './'`util/parser.c >In file included from :0:0: >/usr/include/stdc-predef.h:40:1: fatal error: /home/l0360328/lustre-release/undef.h: No such file or directory >#endif … >Configure line: ./configure --build=ppc64le --disable-server --with-o2ib=/usr/src/ofa_kernel/default --disable-tests Never tried build=ppc64le. Are you cross compiling? BTW I can reproduce your rpm build issue. That is why I didn’t response right away. I was attempting to figure out what is wrong. So basically autoconf is setting your libdir to /usr/lib64 and the rpm macros expect the libraries to be in /usr/lib. I see other projects have had issues with this before but I didn’t find a good solution yet. It will take me a bit to figure it out. From: Simmons, James A. [mailto:simmonsja at ornl.gov] Sent: Tuesday, August 08, 2017 9:20 AM To: Russell JONES; Donny COOPER; Leverman, Dustin B.; Mehta, Kshitij V.; Oral, H. Sarp; Hill, Jason J. Subject: RE: Lustre on Summitdev >James, > >When setting the new configuration options I noticed that I didn’t appear to have lnetctl on the system. I found an older bug report that hinted I needed libyaml and libyaml-devel for the binary to get built. Installed those and >ran another rpmbuild, but unfortunately I still didn’t get an RPM created that included that binary. Did you install libyaml-devel rpm? >I decided to try the route of patching the source tree to fix LUA-9758 and see if building that route would give me the binary, however I’m still getting the same error with the updated lustre.spec.in downloaded and put in place, >and a make clean, configure, make, make rpms ran. I viewed the new lustre.spec that gets created after configure to make sure your changed lines appear there, and they seem to be there. Did the patch apply? The reason I ask is that I created that patch against a later lustre 2.10 version. Patches are still landing to the 2.10 branch for the 2.10.1 release. Try the following git clone git://git.hpdd.intel.com/fs/lustre-release git checkout –b b2_10 origin/b2_10 Then apply the LU-9758 patch and with libyaml-devel installed try a build. >I know this discussion is getting a bit long and technical, if there’s a better place to continue it (devel list or bug tracker?) I’ll be happy to move to wherever is more convenient for you. I’m fine where ever the discuss takes place. From: Simmons, James A. [mailto:simmonsja at ornl.gov] Sent: Monday, August 07, 2017 4:19 PM To: Donny COOPER; Russell JONES; Leverman, Dustin B.; Mehta, Kshitij V.; Oral, H. Sarp; Hill, Jason J. Subject: RE: Lustre on Summitdev >James, > >Is the configuration of OLCF Lustre filesystem that is connecting to the Summitdev (ppcle64) machine using mlx5 -> mlx5 on both Lustre client and server? Is not so much a mlx4 vs mlx5 driver issue but what the hardware supports. So here is the correct technical explanation of what is going. IB hardware support something called queue pairs. How deep the queue pair can go depends on the hardware. In our testbed the back end file system I was testing with, which does have mlx4 based hardware, could support a queue depth of 64K. This is also true of our production file system storage back end. This setup allows us to set our lnet peer credits to 63. The Power8 nodes Mellanox hardware in our testbed has a maximum queue pair depth of 32K. Because of this I couldn’t push the lnet peer credits to 63. So what I did to get around that is turn on map_on_demand. The map_on_demand option in ko2iblnd turns on RDMA transfers. This helped me to support the 63 peer credits I wanted on the Power8 nodes but it exposed a problem due to different page sizes. That is what caused me some headaches. Now for our Summitdev machine its hardware, even with it using the mlx5 driver, doesn’t seem to have problems with our back end production file system. So how this will impact you will depend on your setup. You just have to try and see with the LNet peer_credits you are using. From: Simmons, James A. [mailto:simmonsja at ornl.gov] Sent: Monday, August 07, 2017 3:20 PM To: Russell JONES >; Leverman, Dustin B. >; Donny COOPER >; Mehta, Kshitij V. >; Oral, H. Sarp >; Hill, Jason J. > Subject: RE: Lustre on Summitdev >Thanks for the feedback! >Yes we do have a mlx5 -> mlx4 connection in play, our lustre servers are mlx4. > >I will start work on getting the configuration put into place you recommended. You might still have issues mounting due the LU-9823 bug. I collected the debug log but it is going to take some time for me to figure out what is wrong. As for the mlx5 <-> mlx4 if you have trouble, if you manage to get around LU-9823, let me know and I can help you with that. From: Simmons, James A. [mailto:simmonsja at ornl.gov] Sent: Monday, August 07, 2017 2:18 PM To: Russell JONES; Leverman, Dustin B.; Donny COOPER; Mehta, Kshitij V.; Oral, H. Sarp; Hill, Jason J. Subject: RE: Lustre on Summitdev >Hi all, > >Appreciate the assistance! Here’s a quick overview of what we are experiencing, and then further answers inline below. > >If we do a simple rpmbuild against the 2.10 source RPM, the build completes and I am able to modprobe the lustre module and issue a mount command against our Lustre filesystem. However as soon as I do that, or >attempt any writes, we begin getting the following errors recorded in /var/log/messages on the node, and the filesystem is unusable from this client: > >Aug 7 13:32:49 p8eval kernel: Lustre: Lustre: Build Version: 2.10.0 >Aug 7 13:32:49 p8eval kernel: LNet: Added LNI 172.40.120.231 at o2ib4 [8/256/0/180] >Aug 7 13:33:06 p8eval kernel: Lustre: 61690:0:(client.c:2114:ptlrpc_expire_one_request()) @@@ Request sent has timed out for slow reply: [sent >1502130781/real 1502130781] req at c000000fd85e0300 x1575098273234960/t0(0) o250->MGC172.40.2.60 at o2ib4@172.40.2.60 at o2ib4:26/25 lens 520/544 e 0 to >.1 dl 1502130786 ref 1 fl Rpc:XN/0/ffffffff rc 0/-1 >Aug 7 13:33:07 p8eval kernel: LustreError: 61858:0:(mgc_request.c:251:do_config_log_add()) MGC172.40.2.60 at o2ib4: failed processing log, type 1: >rc = -5 >Aug 7 13:33:26 p8eval kernel: Lustre: Server MGS version (2.5.42.8) is much older than client. Consider upgrading server (2.10.0) >Aug 7 13:33:26 p8eval kernel: Lustre: Mounted lustre4-client >Aug 7 13:33:31 p8eval kernel: Lustre: 61690:0:(client.c:2114:ptlrpc_expire_one_request()) @@@ Request sent has timed out for slow reply: [sent >1502130806/real 1502130806] req at c000000fdb620300 x1575098273235408/t0(0) o8->lustre4-OST0006-osc-c000001e3c4e9000 at 172.40.2.62@o2ib4:28/4 lens >520/544 e 0 to 1 dl 1502130811 ref 1 fl Rpc:XN/0/ffffffff rc 0/-1 > I know this bug. I can reproduce it on the Cray ARM machine. I haven’t fix it yet since I can’t reproduce this one on a x86 platform. The ticket URL is https://jira.hpdd.intel.com/browse/LU-9823. I will look to collect some debug logs today on the ARM machine to track it down. >If I attempt to build from the source .tar.gz with the following configure flags, the configure and make complete, however “make rpms” gets an error: > >./configure --disable-tests --disable-server --with-linux=/usr/src/kernels/3.10.0-514.el7.ppc64le/ --with-o2ib=/usr/src/ofa_kernel/default -->target=ppc64le > >+ basemodpath=/tmp/rpmbuild-lustre-root-dLLJioYr/BUILDROOT/lustre-2.10.0-1.ppc64le/lib/modules/3.10.0-514.el7.ppc64le/extra/lustre-client >+ : >+ echo /usr/lib/systemd/system/lnet.service >+ echo /etc/init.d/lsvcgss >+ find /tmp/rpmbuild-lustre-root-dLLJioYr/BUILDROOT/lustre-2.10.0-1.ppc64le -name '*.so' -type f -exec chmod +x '{}' ';' >+ '[' -d /tmp/rpmbuild-lustre-root-dLLJioYr/BUILDROOT/lustre-2.10.0-1.ppc64le/usr/lib64/lustre/snmp ']' >+ mkdir -p /tmp/rpmbuild-lustre-root-dLLJioYr/BUILDROOT/lustre-2.10.0-1.ppc64le//usr/share/lustre >+ find /tmp/rpmbuild-lustre-root-dLLJioYr/BUILDROOT/lustre-2.10.0-1.ppc64le/usr/lib64/lustre -name '*.la' -type f -exec rm -f '{}' ';' >find: '/tmp/rpmbuild-lustre-root-dLLJioYr/BUILDROOT/lustre-2.10.0-1.ppc64le/usr/lib64/lustre': No such file or directory >error: Bad exit status from /tmp/rpmbuild-lustre-root-dLLJioYr/TMP/rpm-tmp.QuU8wT (%install) > >RPM build errors: > Bad exit status from /tmp/rpmbuild-lustre-root-dLLJioYr/TMP/rpm-tmp.QuU8wT (%install) I know this one since I fixed it ☺ That is LU-9758 and I have a patch for 2.10 already. Just waiting to land. You can get it here: https://review.whamcloud.com/#/c/28372 >> Is lnet running over InfiniBand interfaces? If so, is it using the mlx4 or mlx5 driver > >Yes, here’s the output of lustre.conf: > >[root at p8eval modprobe.d]# cat lustre.conf >options lnet networks=o2ib4(ib0) >> Also what OFED stack are you running? Are you using the Lustre 2.10 or 2.8 client? >Mellanox OFED 3.4, and attempting to use 2.9 and 2.10, same errors for both versions. The version of lustre on the servers is 2.5. This one is a but more complicated. If by default the queue pair depth is too small. You will need to create the following file: /etc/modprobe.d/ib_mad.conf With the following: # Module parameters for infiniband core to increase queue pair size options ib_mad send_queue_size=4096 options ib_mad recv_queue_size=4096 Now for the LNet configurate. Please don’t use the modprobe config file lustre.conf. That is deprecated. You should be using lnetctl. First you need a /etc/sysconfig/lnet.conf file. Something like this. ------------------------------------------------- net: - net: o2ib6 status: up interfaces: 0: ib0 lnd tunables: peercredits_hiw: 63 #map_on_demand: 16 concurrent_sends: 31 fmr_pool_size: 1280 fmr_flush_trigger: 1024 fmr_cache: 1 tunables: peer_timeout: 180 peer_credits: 63 peer_buffer_credits: 0 credits: 2560 route: - net: o2ib gateway: 10.39.232.10 at o2ib6 hop: 1 priority: 0 - net: o2ib gateway: 10.39.232.11 at o2ib6 hop: 1 priority: 0 Once you have that file you need to run the following command: modprobe lnet; lnetctl lnet configure; lnetctl import < /etc/sysconfig/lnet.conf Now if you have a mlx4 <-> mlx5 connection then you will have problems with page size difference between x86 and PPC. Is that the case for you? Let me know because in that case it will take some more magic to get it working. Hope that helps. Hmmm. I need to create a wiki for this on lustre.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.dilger at intel.com Fri Aug 18 23:57:58 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Fri, 18 Aug 2017 23:57:58 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: fix structure size for ARM OABI In-Reply-To: <20170817162639.GA13066@kroah.com> References: <1502894655-9731-1-git-send-email-cakturk@gmail.com> <20170817162639.GA13066@kroah.com> Message-ID: On Aug 17, 2017, at 10:26, Greg KH wrote: > > On Wed, Aug 16, 2017 at 05:44:15PM +0300, Cihangir Akturk wrote: >> When building the kernel for the ARM architecture without setting >> CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 >> differs, due to different alignment requirements of OABI and EABI. >> >> Marking the anonymous union within struct lov_user_md_v3 as >> '_packed' solves this issue. Otherwise we get the following >> error: >> >> drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion >> of macro ‘BUILD_BUG_ON’ >> BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3)); >> >> Signed-off-by: Cihangir Akturk >> --- >> drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > This file is no longer in the tree :( With James' recent patch series, this has moved to include/uapi/linux/lustre/lustre_user.h Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From andreas.dilger at intel.com Sat Aug 19 00:07:13 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Sat, 19 Aug 2017 00:07:13 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: lustre: Off by two in lmv_fid2path() In-Reply-To: <20170817154752.GA18912@kroah.com> References: <20170728144227.uml3x27mqug3ciox@mwanda> <20170817154752.GA18912@kroah.com> Message-ID: <62C696A2-E013-4473-85DB-F378ADF61605@intel.com> > On Aug 17, 2017, at 09:47, Greg Kroah-Hartman wrote: > > On Mon, Aug 14, 2017 at 04:01:17PM +0100, James Simmons wrote: >> >>> We want to concatonate join string one, a '/' character, string two and >>> then a NUL terminator. The destination buffer holds ori_gf->gf_pathlen >>> characters. The strlen() function returns the number of characters not >>> counting the NUL terminator. So we should be adding two extra spaces, >>> one for the foward slash and one for the NUL. >>> >>> Signed-off-by: Dan Carpenter >>> --- >>> Not tested. Please review this one carefully. >> >> This is a real bug which is impacting users. The bug is being tracked >> at https://jira.hpdd.intel.com/browse/LU-9863. It passed our test suite >> and its being reviewed. > > So what am I supposed to do with this patch? The patch has been reviewed and you could add them before landing: Reviewed-by: John L. Hammond Reviewed-by: frank zago Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From jsimmons at infradead.org Sat Aug 19 03:04:14 2017 From: jsimmons at infradead.org (James Simmons) Date: Fri, 18 Aug 2017 23:04:14 -0400 Subject: [lustre-devel] [PATCH] staging: lustre: uapi: properly include lustre_errno.h Message-ID: <1503111854-29944-1-git-send-email-jsimmons@infradead.org> The path for lustre_errno.h was not updated to the new path for errno.c. Also the header lustre_net.h uses code found in lustre_errno.h but doesn't include the header directly. It is easy to forget to add the header lustre_errno.h before including lustre_net.h so it is just easier to include lustre_errno.h in lustre_net.h. This should resolve the build issues seen on the ia64 platform. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_net.h | 1 + drivers/staging/lustre/lustre/ptlrpc/errno.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 1ae7e83..bc18131 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -55,6 +55,7 @@ #include "../../include/uapi/linux/lnet/nidstr.h" #include "../../include/linux/lnet/api.h" #include "../../include/uapi/linux/lustre/lustre_idl.h" +#include "lustre_errno.h" #include "lustre_ha.h" #include "lustre_sec.h" #include "lustre_import.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/errno.c b/drivers/staging/lustre/lustre/ptlrpc/errno.c index 73f8374..faad8d8 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/errno.c +++ b/drivers/staging/lustre/lustre/ptlrpc/errno.c @@ -26,7 +26,7 @@ */ #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/lustre_errno.h" +#include "../include/lustre_errno.h" /* * The two translation tables below must define a one-to-one mapping between -- 1.8.3.1 From gregkh at linuxfoundation.org Sat Aug 19 03:41:45 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Fri, 18 Aug 2017 20:41:45 -0700 Subject: [lustre-devel] [PATCH] staging: lustre: uapi: properly include lustre_errno.h In-Reply-To: <1503111854-29944-1-git-send-email-jsimmons@infradead.org> References: <1503111854-29944-1-git-send-email-jsimmons@infradead.org> Message-ID: <20170819034145.GB4144@kroah.com> On Fri, Aug 18, 2017 at 11:04:14PM -0400, James Simmons wrote: > The path for lustre_errno.h was not updated to the new path > for errno.c. Also the header lustre_net.h uses code found in > lustre_errno.h but doesn't include the header directly. It > is easy to forget to add the header lustre_errno.h before > including lustre_net.h so it is just easier to include > lustre_errno.h in lustre_net.h. This should resolve the > build issues seen on the ia64 platform. > > Signed-off-by: James Simmons > --- > drivers/staging/lustre/lustre/include/lustre_net.h | 1 + > drivers/staging/lustre/lustre/ptlrpc/errno.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) Merge this into the correct patch and send both patch series again please. thanks, greg k-h From jsimmons at infradead.org Sun Aug 20 02:25:55 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:25:55 -0400 Subject: [lustre-devel] [PATCH 01/64 v2] staging: lustre: uapi: Move functions out of lustre_idl.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-2-git-send-email-jsimmons@infradead.org> From: Ben Evans Migrate functions set/get_mrc_cr_flags, ldlm_res_eq ldlm_extent_overlap, ldlm_extent_contain, ldlm_request_bufsize, and all the PTLRPC dump_* functions out of lustre_idl.h which is a UAPI header to the places in the kernel code they are actually used. Delete unused lmv_mds_md_stripe_count and agent_req_in_final_state. Signed-off-by: Ben Evans Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: http://review.whamcloud.com/21484 Reviewed-by: Frank Zago Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h | 73 ---------------------- drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 ++++ .../staging/lustre/lustre/include/lustre_swab.h | 6 ++ drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 6 ++ drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 27 ++++++++ drivers/staging/lustre/lustre/mdc/mdc_lib.c | 6 ++ 6 files changed, 58 insertions(+), 73 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 1db1ab8..1e8ecdf 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -2130,17 +2130,6 @@ struct mdt_rec_create { __u32 cr_padding_4; /* rr_padding_4 */ }; -static inline void set_mrc_cr_flags(struct mdt_rec_create *mrc, __u64 flags) -{ - mrc->cr_flags_l = (__u32)(flags & 0xFFFFFFFFUll); - mrc->cr_flags_h = (__u32)(flags >> 32); -} - -static inline __u64 get_mrc_cr_flags(struct mdt_rec_create *mrc) -{ - return ((__u64)(mrc->cr_flags_l) | ((__u64)mrc->cr_flags_h << 32)); -} - /* instance of mdt_reint_rec */ struct mdt_rec_link { __u32 lk_opcode; @@ -2403,25 +2392,6 @@ static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm) } } -static inline int lmv_mds_md_stripe_count_set(union lmv_mds_md *lmm, - unsigned int stripe_count) -{ - int rc = 0; - - switch (le32_to_cpu(lmm->lmv_magic)) { - case LMV_MAGIC_V1: - lmm->lmv_md_v1.lmv_stripe_count = cpu_to_le32(stripe_count); - break; - case LMV_USER_MAGIC: - lmm->lmv_user_md.lum_stripe_count = cpu_to_le32(stripe_count); - break; - default: - rc = -EINVAL; - break; - } - return rc; -} - enum fld_rpc_opc { FLD_QUERY = 900, FLD_READ = 901, @@ -2502,12 +2472,6 @@ struct ldlm_res_id { #define PLDLMRES(res) (res)->lr_name.name[0], (res)->lr_name.name[1], \ (res)->lr_name.name[2], (res)->lr_name.name[3] -static inline bool ldlm_res_eq(const struct ldlm_res_id *res0, - const struct ldlm_res_id *res1) -{ - return !memcmp(res0, res1, sizeof(*res0)); -} - /* lock types */ enum ldlm_mode { LCK_MINMODE = 0, @@ -2540,19 +2504,6 @@ struct ldlm_extent { __u64 gid; }; -static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1, - const struct ldlm_extent *ex2) -{ - return (ex1->start <= ex2->end) && (ex2->start <= ex1->end); -} - -/* check if @ex1 contains @ex2 */ -static inline int ldlm_extent_contain(const struct ldlm_extent *ex1, - const struct ldlm_extent *ex2) -{ - return (ex1->start <= ex2->start) && (ex1->end >= ex2->end); -} - struct ldlm_inodebits { __u64 bits; }; @@ -2627,18 +2578,6 @@ struct ldlm_request { struct lustre_handle lock_handle[LDLM_LOCKREQ_HANDLES]; }; -/* If LDLM_ENQUEUE, 1 slot is already occupied, 1 is available. - * Otherwise, 2 are available. - */ -#define ldlm_request_bufsize(count, type) \ -({ \ - int _avail = LDLM_LOCKREQ_HANDLES; \ - _avail -= (type == LDLM_ENQUEUE ? LDLM_ENQUEUE_CANCEL_OFF : 0); \ - sizeof(struct ldlm_request) + \ - (count > _avail ? count - _avail : 0) * \ - sizeof(struct lustre_handle); \ -}) - struct ldlm_reply { __u32 lock_flags; __u32 lock_padding; /* also fix lustre_swab_ldlm_reply */ @@ -2942,12 +2881,6 @@ static inline const char *agent_req_status2name(const enum agent_req_status ars) } } -static inline bool agent_req_in_final_state(enum agent_req_status ars) -{ - return ((ars == ARS_SUCCEED) || (ars == ARS_FAILED) || - (ars == ARS_CANCELED)); -} - struct llog_agent_req_rec { struct llog_rec_hdr arr_hdr; /**< record header */ __u32 arr_status; /**< status of the request */ @@ -3142,12 +3075,6 @@ struct ll_fiemap_info_key { struct fiemap lfik_fiemap; }; -/* Functions for dumping PTLRPC fields */ -void dump_rniobuf(struct niobuf_remote *rnb); -void dump_ioo(struct obd_ioobj *nb); -void dump_ost_body(struct ost_body *ob); -void dump_rcs(__u32 *rc); - /* security opcodes */ enum sec_cmd { SEC_CTX_INIT = 801, diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 1e86fb5..eb2de13 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -1336,5 +1336,18 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns, void ldlm_pool_del(struct ldlm_pool *pl, struct ldlm_lock *lock); /** @} */ +static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1, + const struct ldlm_extent *ex2) +{ + return ex1->start <= ex2->end && ex2->start <= ex1->end; +} + +/* check if @ex1 contains @ex2 */ +static inline int ldlm_extent_contain(const struct ldlm_extent *ex1, + const struct ldlm_extent *ex2) +{ + return ex1->start <= ex2->start && ex1->end >= ex2->end; +} + #endif /** @} LDLM */ diff --git a/drivers/staging/lustre/lustre/include/lustre_swab.h b/drivers/staging/lustre/lustre/include/lustre_swab.h index 26d01c2..5c1bdc0 100644 --- a/drivers/staging/lustre/lustre/include/lustre_swab.h +++ b/drivers/staging/lustre/lustre/include/lustre_swab.h @@ -99,4 +99,10 @@ void lustre_swab_lov_user_md_objects(struct lov_user_ost_data *lod, void lustre_swab_close_data(struct close_data *data); void lustre_swab_lmv_user_md(struct lmv_user_md *lum); +/* Functions for dumping PTLRPC fields */ +void dump_rniobuf(struct niobuf_remote *rnb); +void dump_ioo(struct obd_ioobj *nb); +void dump_ost_body(struct ost_body *ob); +void dump_rcs(__u32 *rc); + #endif diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index 2bf5c84..36808db 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -333,3 +333,9 @@ void ldlm_flock_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, union ldlm_policy_data *lpolicy); void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy, union ldlm_wire_policy_data *wpolicy); + +static inline bool ldlm_res_eq(const struct ldlm_res_id *res0, + const struct ldlm_res_id *res1) +{ + return memcmp(res0, res1, sizeof(*res0)) == 0; +} diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 4028e11..2e3db5e 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -83,6 +83,33 @@ struct ldlm_async_args { struct lustre_handle lock_handle; }; +/** + * ldlm_request_bufsize + * + * @count: number of ldlm handles + * @type: ldlm opcode + * + * If opcode=LDLM_ENQUEUE, 1 slot is already occupied, + * LDLM_LOCKREQ_HANDLE -1 slots are available. + * Otherwise, LDLM_LOCKREQ_HANDLE slots are available. + * + * Return: size of the request buffer + */ +static int ldlm_request_bufsize(int count, int type) +{ + int avail = LDLM_LOCKREQ_HANDLES; + + if (type == LDLM_ENQUEUE) + avail -= LDLM_ENQUEUE_CANCEL_OFF; + + if (count > avail) + avail = (count - avail) * sizeof(struct lustre_handle); + else + avail = 0; + + return sizeof(struct ldlm_request) + avail; +} + static int ldlm_expired_completion_wait(void *data) { struct lock_wait_data *lwd = data; diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index b1853ff..aabdcec 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -35,6 +35,12 @@ #include "../include/lustre/lustre_idl.h" #include "mdc_internal.h" +static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags) +{ + mrc->cr_flags_l = (u32)(flags & 0xFFFFFFFFUll); + mrc->cr_flags_h = (u32)(flags >> 32); +} + static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid) { b->mbo_suppgid = suppgid; -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:25:54 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:25:54 -0400 Subject: [lustre-devel] [PATCH 00/64 v2] staging: lustre: uapi: normalize the lustre headers Message-ID: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> The headers for lustre/LNet for a long time lacked a clean separation in its internal headers which resulted in kernel specific data structures being exposed in user land code. This work unravels this mess and creates a clear separation between lustre kernel space and lustre user land. With this work done the include paths in the lustre kernel code can now be normalized. This is the second version of the patch series which includes a fix to include lustre_errno.h in the header lustre_net.h. For some reason this only showed up on ia64 platforms but should be resolved now. Second change was to add errno.h into lustre_ostid.h. It is needed to handle the error codes returned for both user land and kernel space. Ben Evans (4): staging: lustre: uapi: Move functions out of lustre_idl.h staging: lustre: uapi: return error code for ostid_set_id staging: lustre: uapi: update URL doc link in lustre_fid.h staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h James Simmons (60): staging: lustre: uapi: remove unused functions for lustre_fid.h staging: lustre: uapi: remove unused function in lustre_disk.h staging: lustre: uapi: remove userland version of obd_ioctl_*() staging: lustre: uapi: remove obd_ioctl_freedata() wrapper staging: lustre: uapi: remove obd_ioctl_popdata() wrapper staging: lustre: uapi: move obd_ioctl_getdata() declaration staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c staging: lustre: uapi: move lustre_ioctl.h to uapi directory staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h staging: lustre: uapi: cleanup headers for lustre_ioctl.h staging: lustre: uapi: label lustre_ioctl.h as a UAPI header staging: lustre: uapi: move kernel only prototypes out of lustre_param.h staging: lustre: uapi: remove included headers out of lustre_param.h staging: lustre: uapi: move lustre_param.h to uapi directory staging: lustre: uapi: label lustre_param.h as an uapi header staging: lustre: uapi: style cleanups for lustre_param.h staging: lustre: uapi: remove lustre_cfg_free wrapper staging: lustre: uapi: don't memory allocate in UAPI header staging: lustre: uapi: move lustre_cfg_string() to obd_config.c staging: lustre: obdclass: no need to check for kfree staging: lustre: uapi: move lustre_cfg.h to uapi directory staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h staging: lustre: uapi: change variable type to match staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL staging: lustre: uapi: style cleanup of lustre_cfg.h staging: lustre: uapi: label lustre_cfg.h as an uapi header staging: lustre: libcfs: remove htonl hack in libcfs.h staging: lustre: libcfs: remove LOGL and LOGU macros staging: lustre: libcfs: create libcfs_debug.h UAPI header staging: lustre: socklnd: create socklnd.h UAPI header staging: lustre: lnet: delete lnet.h staging: lustre: lnet: migrate headers to lnet uapi directory staging: lustre: libcfs: sort headers in libcfs.h staging: lustre: lnet: remove userland function prototype in lnetctl.h staging: lustre: lnet: remove BIT macro from lnetctl.h staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h staging: lustre: uapi: migrate remaining uapi headers to uapi directory staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL staging: lustre: uapi: use proper byteorder functions in lustre_idl.h staging: lustre: uapi: remove BIT macro from UAPI headers staging: lustre: fid: add include path to Makefile staging: lustre: fld: add include path to Makefile staging: lustre: ptlrpc: add include path to Makefile staging: lustre: llite: add include path to Makefile staging: lustre: lmv: add include path to Makefile staging: lustre: lov: add include path to Makefile staging: lustre: mdc: add include path to Makefile staging: lustre: mgc: add include path to Makefile staging: lustre: obdclass: add include path to Makefile staging: lustre: obdecho: add include path to Makefile staging: lustre: osc: add include path to Makefile staging: lustre: lustre: cleanup paths for lustre internal headers staging: lustre: lustre: cleanup paths for lustre UAPI headers staging: lustre: lnet: selftest: add include path to Makefile staging: lustre: lnet: add include path to Makefile staging: lustre: ko2iblnd: add include path to Makefile staging: lustre: ksocklnd: add include path to Makefile staging: lustre: libcfs: add include path to Makefile staging: lustre: libcfs: cleanup paths for libcfs headers staging: lustre: lnet: cleanup paths for all LNet headers .../staging/lustre/include/linux/libcfs/libcfs.h | 28 +- .../lustre/include/linux/libcfs/libcfs_debug.h | 104 +--- .../lustre/include/linux/libcfs/libcfs_private.h | 26 - drivers/staging/lustre/include/linux/lnet/api.h | 2 +- .../staging/lustre/include/linux/lnet/lib-lnet.h | 12 +- .../staging/lustre/include/linux/lnet/lib-types.h | 4 +- .../staging/lustre/include/linux/lnet/socklnd.h | 12 +- .../lustre/include/uapi/linux/lnet/libcfs_debug.h | 149 +++++ .../libcfs => uapi/linux/lnet}/libcfs_ioctl.h | 0 .../lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} | 4 +- .../lnet/types.h => uapi/linux/lnet/lnet-types.h} | 0 .../lustre/include/{ => uapi}/linux/lnet/lnetctl.h | 51 +- .../lustre/include/{ => uapi}/linux/lnet/lnetst.h | 0 .../lustre/include/{ => uapi}/linux/lnet/nidstr.h | 2 +- .../lnet/lnet.h => uapi/linux/lnet/socklnd.h} | 24 +- .../uapi/linux/lustre}/lustre_cfg.h | 188 +++--- .../lustre/include/uapi/linux/lustre/lustre_fid.h | 293 +++++++++ .../uapi/linux/lustre/lustre_fiemap.h} | 6 +- .../uapi/linux}/lustre/lustre_idl.h | 682 +-------------------- .../uapi/linux}/lustre/lustre_ioctl.h | 203 +----- .../uapi/linux/lustre/lustre_kernelcomm.h} | 6 +- .../include/uapi/linux/lustre/lustre_ostid.h | 236 +++++++ .../include/uapi/linux/lustre/lustre_param.h | 94 +++ .../uapi/linux}/lustre/lustre_user.h | 15 +- .../uapi/linux/lustre}/lustre_ver.h | 0 drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile | 3 + .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 5 +- drivers/staging/lustre/lnet/klnds/socklnd/Makefile | 3 + .../staging/lustre/lnet/klnds/socklnd/socklnd.h | 7 +- drivers/staging/lustre/lnet/libcfs/Makefile | 3 + drivers/staging/lustre/lnet/libcfs/debug.c | 2 +- drivers/staging/lustre/lnet/libcfs/fail.c | 2 +- drivers/staging/lustre/lnet/libcfs/hash.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_mem.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_string.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 2 +- .../lustre/lnet/libcfs/linux/linux-crypto.c | 4 +- .../lustre/lnet/libcfs/linux/linux-curproc.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-debug.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-mem.c | 2 +- .../lustre/lnet/libcfs/linux/linux-module.c | 2 +- .../staging/lustre/lnet/libcfs/linux/linux-prim.c | 2 +- .../lustre/lnet/libcfs/linux/linux-tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/module.c | 9 +- drivers/staging/lustre/lnet/libcfs/prng.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.h | 2 +- drivers/staging/lustre/lnet/libcfs/workitem.c | 2 +- drivers/staging/lustre/lnet/lnet/Makefile | 3 + drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 4 +- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-eq.c | 3 +- drivers/staging/lustre/lnet/lnet/lib-md.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-me.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-msg.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-socket.c | 4 +- drivers/staging/lustre/lnet/lnet/lo.c | 3 +- drivers/staging/lustre/lnet/lnet/module.c | 5 +- drivers/staging/lustre/lnet/lnet/net_fault.c | 4 +- drivers/staging/lustre/lnet/lnet/nidstrings.c | 4 +- drivers/staging/lustre/lnet/lnet/peer.c | 4 +- drivers/staging/lustre/lnet/lnet/router.c | 3 +- drivers/staging/lustre/lnet/lnet/router_proc.c | 5 +- drivers/staging/lustre/lnet/selftest/Makefile | 3 + drivers/staging/lustre/lnet/selftest/conctl.c | 6 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 4 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 7 +- drivers/staging/lustre/lnet/selftest/console.c | 4 +- drivers/staging/lustre/lnet/selftest/console.h | 7 +- drivers/staging/lustre/lnet/selftest/rpc.h | 2 +- drivers/staging/lustre/lnet/selftest/selftest.h | 9 +- drivers/staging/lustre/lustre/Kconfig | 10 - drivers/staging/lustre/lustre/fid/Makefile | 3 + drivers/staging/lustre/lustre/fid/fid_internal.h | 4 +- drivers/staging/lustre/lustre/fid/fid_lib.c | 5 +- drivers/staging/lustre/lustre/fid/fid_request.c | 12 +- drivers/staging/lustre/lustre/fid/lproc_fid.c | 12 +- drivers/staging/lustre/lustre/fld/Makefile | 3 + drivers/staging/lustre/lustre/fld/fld_cache.c | 16 +- drivers/staging/lustre/lustre/fld/fld_internal.h | 8 +- drivers/staging/lustre/lustre/fld/fld_request.c | 18 +- drivers/staging/lustre/lustre/fld/lproc_fld.c | 14 +- drivers/staging/lustre/lustre/include/cl_object.h | 4 +- drivers/staging/lustre/lustre/include/llog_swab.h | 3 +- .../staging/lustre/lustre/include/lprocfs_status.h | 6 +- drivers/staging/lustre/lustre/include/lu_object.h | 6 +- .../staging/lustre/lustre/include/lustre_compat.h | 2 +- .../staging/lustre/lustre/include/lustre_debug.h | 4 +- .../staging/lustre/lustre/include/lustre_disk.h | 23 +- drivers/staging/lustre/lustre/include/lustre_dlm.h | 25 +- .../lustre/include/{lustre => }/lustre_errno.h | 0 .../staging/lustre/lustre/include/lustre_export.h | 6 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 84 ++- drivers/staging/lustre/lustre/include/lustre_fld.h | 5 +- .../staging/lustre/lustre/include/lustre_handles.h | 2 +- .../staging/lustre/lustre/include/lustre_import.h | 4 +- .../lustre/lustre/include/lustre_kernelcomm.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 12 +- drivers/staging/lustre/lustre/include/lustre_lmv.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 4 +- drivers/staging/lustre/lustre/include/lustre_mdc.h | 15 +- drivers/staging/lustre/lustre/include/lustre_mds.h | 11 +- drivers/staging/lustre/lustre/include/lustre_net.h | 29 +- drivers/staging/lustre/lustre/include/lustre_nrs.h | 2 +- .../staging/lustre/lustre/include/lustre_obdo.h | 2 +- .../staging/lustre/lustre/include/lustre_param.h | 109 ---- .../staging/lustre/lustre/include/lustre_swab.h | 8 +- drivers/staging/lustre/lustre/include/obd.h | 18 +- drivers/staging/lustre/lustre/include/obd_cksum.h | 6 +- drivers/staging/lustre/lustre/include/obd_class.h | 35 +- .../staging/lustre/lustre/include/obd_support.h | 6 +- drivers/staging/lustre/lustre/include/seq_range.h | 2 +- drivers/staging/lustre/lustre/ldlm/interval_tree.c | 6 +- drivers/staging/lustre/lustre/ldlm/l_lock.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 12 +- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 8 +- .../staging/lustre/lustre/ldlm/ldlm_inodebits.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 6 + drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 12 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 +- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_plain.c | 6 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 8 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 34 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 6 +- drivers/staging/lustre/lustre/llite/Makefile | 3 + drivers/staging/lustre/lustre/llite/dcache.c | 6 +- drivers/staging/lustre/lustre/llite/dir.c | 22 +- drivers/staging/lustre/lustre/llite/file.c | 10 +- drivers/staging/lustre/lustre/llite/glimpse.c | 16 +- drivers/staging/lustre/lustre/llite/lcommon_cl.c | 35 +- drivers/staging/lustre/lustre/llite/lcommon_misc.c | 8 +- .../staging/lustre/lustre/llite/llite_internal.h | 20 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 21 +- drivers/staging/lustre/lustre/llite/lproc_llite.c | 4 +- drivers/staging/lustre/lustre/llite/namei.c | 7 +- drivers/staging/lustre/lustre/llite/range_lock.c | 2 +- drivers/staging/lustre/lustre/llite/range_lock.h | 4 +- drivers/staging/lustre/lustre/llite/rw.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 4 +- drivers/staging/lustre/lustre/llite/super25.c | 6 +- drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_internal.h | 4 +- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_lock.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_object.c | 4 +- drivers/staging/lustre/lustre/llite/xattr.c | 5 +- drivers/staging/lustre/lustre/llite/xattr_cache.c | 5 +- drivers/staging/lustre/lustre/lmv/Makefile | 3 + drivers/staging/lustre/lustre/lmv/lmv_fld.c | 15 +- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 17 +- drivers/staging/lustre/lustre/lmv/lmv_internal.h | 6 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 19 +- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 4 +- drivers/staging/lustre/lustre/lov/Makefile | 3 + .../staging/lustre/lustre/lov/lov_cl_internal.h | 6 +- drivers/staging/lustre/lustre/lov/lov_dev.c | 2 +- drivers/staging/lustre/lustre/lov/lov_ea.c | 6 +- drivers/staging/lustre/lustre/lov/lov_internal.h | 4 +- drivers/staging/lustre/lustre/lov/lov_merge.c | 4 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 40 +- drivers/staging/lustre/lustre/lov/lov_offset.c | 4 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 13 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 4 +- drivers/staging/lustre/lustre/lov/lov_request.c | 6 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 4 +- drivers/staging/lustre/lustre/mdc/Makefile | 3 + drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 4 +- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 10 +- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 22 +- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 4 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 25 +- drivers/staging/lustre/lustre/mgc/Makefile | 3 + drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 4 +- drivers/staging/lustre/lustre/mgc/mgc_internal.h | 11 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 23 +- drivers/staging/lustre/lustre/obdclass/Makefile | 3 + drivers/staging/lustre/lustre/obdclass/cl_io.c | 8 +- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 8 +- drivers/staging/lustre/lustre/obdclass/cl_object.c | 14 +- drivers/staging/lustre/lustre/obdclass/cl_page.c | 8 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 35 +- drivers/staging/lustre/lustre/obdclass/debug.c | 6 +- drivers/staging/lustre/lustre/obdclass/genops.c | 6 +- .../staging/lustre/lustre/obdclass/kernelcomm.c | 4 +- drivers/staging/lustre/lustre/obdclass/linkea.c | 6 +- .../lustre/lustre/obdclass/linux/linux-module.c | 100 ++- .../lustre/lustre/obdclass/linux/linux-sysctl.c | 6 +- drivers/staging/lustre/lustre/obdclass/llog.c | 6 +- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 2 +- .../staging/lustre/lustre/obdclass/llog_internal.h | 2 +- drivers/staging/lustre/lustre/obdclass/llog_obd.c | 4 +- drivers/staging/lustre/lustre/obdclass/llog_swab.c | 4 +- .../lustre/lustre/obdclass/lprocfs_counters.c | 4 +- .../lustre/lustre/obdclass/lprocfs_status.c | 6 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 20 +- drivers/staging/lustre/lustre/obdclass/lu_ref.c | 10 +- .../lustre/lustre/obdclass/lustre_handles.c | 6 +- .../staging/lustre/lustre/obdclass/lustre_peer.c | 14 +- .../staging/lustre/lustre/obdclass/obd_config.c | 74 ++- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 44 +- drivers/staging/lustre/lustre/obdclass/obdo.c | 6 +- .../staging/lustre/lustre/obdclass/statfs_pack.c | 8 +- drivers/staging/lustre/lustre/obdclass/uuid.c | 6 +- drivers/staging/lustre/lustre/obdecho/Makefile | 3 + .../staging/lustre/lustre/obdecho/echo_client.c | 31 +- drivers/staging/lustre/lustre/osc/Makefile | 3 + drivers/staging/lustre/lustre/osc/lproc_osc.c | 6 +- .../staging/lustre/lustre/osc/osc_cl_internal.h | 6 +- drivers/staging/lustre/lustre/osc/osc_dev.c | 2 +- drivers/staging/lustre/lustre/osc/osc_internal.h | 2 +- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- drivers/staging/lustre/lustre/osc/osc_lock.c | 4 +- drivers/staging/lustre/lustre/osc/osc_object.c | 9 +- drivers/staging/lustre/lustre/osc/osc_quota.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 32 +- drivers/staging/lustre/lustre/ptlrpc/Makefile | 3 + drivers/staging/lustre/lustre/ptlrpc/client.c | 12 +- drivers/staging/lustre/lustre/ptlrpc/connection.c | 6 +- drivers/staging/lustre/lustre/ptlrpc/errno.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/events.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/import.c | 16 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/llog_net.c | 6 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 12 +- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c | 6 +- .../staging/lustre/lustre/ptlrpc/pack_generic.c | 20 +- drivers/staging/lustre/lustre/ptlrpc/pers.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 4 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_module.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/recover.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/sec.c | 16 +- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 20 +- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 13 +- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 16 +- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 11 +- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 8 +- 250 files changed, 2091 insertions(+), 2182 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h rename drivers/staging/lustre/include/{linux/libcfs => uapi/linux/lnet}/libcfs_ioctl.h (100%) rename drivers/staging/lustre/include/{linux/lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} (97%) rename drivers/staging/lustre/include/{linux/lnet/types.h => uapi/linux/lnet/lnet-types.h} (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetctl.h (62%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetst.h (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/nidstr.h (98%) rename drivers/staging/lustre/include/{linux/lnet/lnet.h => uapi/linux/lnet/socklnd.h} (70%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_cfg.h (52%) create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h rename drivers/staging/lustre/{lustre/include/lustre/ll_fiemap.h => include/uapi/linux/lustre/lustre_fiemap.h} (96%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_idl.h (83%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h (63%) rename drivers/staging/lustre/{lustre/include/uapi_kernelcomm.h => include/uapi/linux/lustre/lustre_kernelcomm.h} (95%) create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_user.h (99%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_ver.h (100%) rename drivers/staging/lustre/lustre/include/{lustre => }/lustre_errno.h (100%) delete mode 100644 drivers/staging/lustre/lustre/include/lustre_param.h ----- Changelog) 1) Initial patch set submitted with lustre_errno.h build issues. 2) Include lustre_errno.h in the header lustre_net.h Add to lustre_ostid.h header. -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:08 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:08 -0400 Subject: [lustre-devel] [PATCH 14/64 v2] staging: lustre: uapi: cleanup headers for lustre_ioctl.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-15-git-send-email-jsimmons@infradead.org> With the cleanups we no longer need to drag in tons of user land headers. Lets simplify the include headers. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index a7e2fc4..fb87a8b 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -28,19 +28,11 @@ #ifndef LUSTRE_IOCTL_H_ #define LUSTRE_IOCTL_H_ +#include #include #include #include "../../../../lustre/include/lustre/lustre_idl.h" -#ifdef __KERNEL__ -# include -# include -#else /* __KERNEL__ */ -# include -# include -#include -#endif /* !__KERNEL__ */ - #if !defined(__KERNEL__) && !defined(LUSTRE_UTILS) # error This file is for Lustre internal use only. #endif -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:00 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:00 -0400 Subject: [lustre-devel] [PATCH 06/64 v2] staging: lustre: uapi: remove unused function in lustre_disk.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-7-git-send-email-jsimmons@infradead.org> Delete code that is used by only the server or just in user land. Now this file is a normal kernel header. The UAPI version of this header is only needed for server side so no need to create a new header in uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25194 Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_disk.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index a676bcc..1a532ad 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -108,14 +108,6 @@ struct lustre_mount_data { #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT) -/****************** last_rcvd file *********************/ - -/** version recovery epoch */ -#define LR_EPOCH_BITS 32 -#define lr_epoch(a) ((a) >> LR_EPOCH_BITS) -#define LR_EXPIRE_INTERVALS 16 /**< number of intervals to track transno */ -#define ENOENT_VERSION 1 /** 'virtual' version of non-existent object */ - /****************** superblock additional info *********************/ struct ll_sb_info; @@ -141,16 +133,6 @@ struct lustre_sb_info { #define s2lsi_nocast(sb) ((sb)->s_fs_info) #define get_profile_name(sb) (s2lsi(sb)->lsi_lmd->lmd_profile) -#define get_mount_flags(sb) (s2lsi(sb)->lsi_lmd->lmd_flags) -#define get_mntdev_name(sb) (s2lsi(sb)->lsi_lmd->lmd_dev) - -/****************** mount lookup info *********************/ - -struct lustre_mount_info { - char *lmi_name; - struct super_block *lmi_sb; - struct list_head lmi_list_chain; -}; /****************** prototypes *********************/ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:06 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:06 -0400 Subject: [lustre-devel] [PATCH 12/64 v2] staging: lustre: uapi: move lustre_ioctl.h to uapi directory In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-13-git-send-email-jsimmons@infradead.org> Move the header lustre_ioctl.h to proper uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h | 5 ++--- drivers/staging/lustre/lustre/llite/dir.c | 2 +- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 +- drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- 12 files changed, 13 insertions(+), 14 deletions(-) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_ioctl.h (98%) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h similarity index 98% rename from drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 8585302..880dd92 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -29,13 +29,12 @@ #define LUSTRE_IOCTL_H_ #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "lustre_idl.h" +#include "../../../linux/libcfs/libcfs.h" +#include "../../../../lustre/include/lustre/lustre_idl.h" #ifdef __KERNEL__ # include # include -# include "../obd_support.h" #else /* __KERNEL__ */ # include # include diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index dd592d9..4b46271 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -46,7 +46,7 @@ #include "../include/obd_support.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_lib.h" #include "../include/lustre_dlm.h" #include "../include/lustre_fid.h" diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 215479a..71d1878 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -43,7 +43,7 @@ #include #include #include "../include/lustre/ll_fiemap.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_swab.h" #include "../include/cl_object.h" diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 451e4fa..e7d5228 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -41,7 +41,7 @@ #include #include -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_ha.h" #include "../include/lustre_dlm.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 1c9ff24..ab77dbe 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -49,7 +49,7 @@ #include "../include/lprocfs_status.h" #include "../include/cl_object.h" #include "../include/lustre_fid.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_kernelcomm.h" #include "lmv_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 8871624..8777d4b 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../include/lustre/lustre_idl.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/cl_object.h" #include "../include/lustre_dlm.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index dc775bb..93fb195 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -45,7 +45,7 @@ #include "../include/lprocfs_status.h" #include "../include/lustre_acl.h" #include "../include/lustre_fid.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_kernelcomm.h" #include "../include/lustre_lmv.h" #include "../include/lustre_log.h" diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 477d611..ed30333 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -40,7 +40,7 @@ #include "../include/lprocfs_status.h" #include #include "../include/cl_object.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "llog_internal.h" struct obd_device *obd_devs[MAX_OBD_DEVICES]; diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 092e68a..9f83345 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -65,7 +65,7 @@ #include "../../include/obd_support.h" #include "../../include/obd_class.h" #include "../../include/lprocfs_status.h" -#include "../../include/lustre/lustre_ioctl.h" +#include "../../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../../include/lustre_ver.h" static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 6a7e7a7..2a93d67 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -38,7 +38,7 @@ #include -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" #include "../include/lustre_log.h" diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 363d205..3f28db3 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -41,7 +41,7 @@ #include "../include/cl_object.h" #include "../include/lustre_fid.h" #include "../include/lustre_acl.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_net.h" #include "echo_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 922d0cb..e103d5a 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -41,7 +41,7 @@ #include "../include/lustre_ha.h" #include "../include/lprocfs_status.h" -#include "../include/lustre/lustre_ioctl.h" +#include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_debug.h" #include "../include/lustre_obdo.h" #include "../include/lustre_param.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:25:59 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:25:59 -0400 Subject: [lustre-devel] [PATCH 05/64 v2] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-6-git-send-email-jsimmons@infradead.org> From: Ben Evans Move lu_fid functions into lustre/lustre_fid.h Move ost_id functions into lustre/lustre_ostid.h Fix indenting, include new headers as needed. Several inline functions in the header lustre_ostid.h are using debug macros instead of returning proper errors. Remove the debug macros and properly handle the returned error codes. Place both UAPI headers lustre_fid.h and lustre_ostid.h into the uapi directory. Signed-off-by: Ben Evans Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/22712 Reviewed-on: https://review.whamcloud.com/24569 Reviewed-by: James Simmons Reviewed-by: Frank Zago Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lustre/lustre_fid.h | 293 +++++++++++ .../include/uapi/linux/lustre/lustre_ostid.h | 237 +++++++++ .../lustre/lustre/include/lustre/lustre_idl.h | 541 +-------------------- drivers/staging/lustre/lustre/include/lustre_fid.h | 49 +- drivers/staging/lustre/lustre/include/lustre_fld.h | 1 + drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 2 + drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 + 7 files changed, 587 insertions(+), 538 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h create mode 100644 drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h new file mode 100644 index 0000000..9adc106 --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h @@ -0,0 +1,293 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * 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) 2011, 2014, Intel Corporation. + * + * Copyright 2016 Cray Inc, all rights reserved. + * Author: Ben Evans. + * + * all fid manipulation functions go here + * + * FIDS are globally unique within a Lustre filessytem, and are made up + * of three parts: sequence, Object ID, and version. + * + */ +#ifndef _UAPI_LUSTRE_FID_H_ +#define _UAPI_LUSTRE_FID_H_ + +#include "../../../../lustre/include/lustre/lustre_idl.h" + +/** returns fid object sequence */ +static inline __u64 fid_seq(const struct lu_fid *fid) +{ + return fid->f_seq; +} + +/** returns fid object id */ +static inline __u32 fid_oid(const struct lu_fid *fid) +{ + return fid->f_oid; +} + +/** returns fid object version */ +static inline __u32 fid_ver(const struct lu_fid *fid) +{ + return fid->f_ver; +} + +static inline void fid_zero(struct lu_fid *fid) +{ + memset(fid, 0, sizeof(*fid)); +} + +static inline __u64 fid_ver_oid(const struct lu_fid *fid) +{ + return (__u64)fid_ver(fid) << 32 | fid_oid(fid); +} + +static inline bool fid_seq_is_mdt0(__u64 seq) +{ + return seq == FID_SEQ_OST_MDT0; +} + +static inline bool fid_seq_is_mdt(__u64 seq) +{ + return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL; +}; + +static inline bool fid_seq_is_echo(__u64 seq) +{ + return seq == FID_SEQ_ECHO; +} + +static inline bool fid_is_echo(const struct lu_fid *fid) +{ + return fid_seq_is_echo(fid_seq(fid)); +} + +static inline bool fid_seq_is_llog(__u64 seq) +{ + return seq == FID_SEQ_LLOG; +} + +static inline bool fid_is_llog(const struct lu_fid *fid) +{ + /* file with OID == 0 is not llog but contains last oid */ + return fid_seq_is_llog(fid_seq(fid)) && fid_oid(fid) > 0; +} + +static inline bool fid_seq_is_rsvd(__u64 seq) +{ + return seq > FID_SEQ_OST_MDT0 && seq <= FID_SEQ_RSVD; +}; + +static inline bool fid_seq_is_special(__u64 seq) +{ + return seq == FID_SEQ_SPECIAL; +}; + +static inline bool fid_seq_is_local_file(__u64 seq) +{ + return seq == FID_SEQ_LOCAL_FILE || + seq == FID_SEQ_LOCAL_NAME; +}; + +static inline bool fid_seq_is_root(__u64 seq) +{ + return seq == FID_SEQ_ROOT; +} + +static inline bool fid_seq_is_dot(__u64 seq) +{ + return seq == FID_SEQ_DOT_LUSTRE; +} + +static inline bool fid_seq_is_default(__u64 seq) +{ + return seq == FID_SEQ_LOV_DEFAULT; +} + +static inline bool fid_is_mdt0(const struct lu_fid *fid) +{ + return fid_seq_is_mdt0(fid_seq(fid)); +} + +/** + * Check if a fid is igif or not. + * \param fid the fid to be tested. + * \return true if the fid is an igif; otherwise false. + */ +static inline bool fid_seq_is_igif(__u64 seq) +{ + return seq >= FID_SEQ_IGIF && seq <= FID_SEQ_IGIF_MAX; +} + +static inline bool fid_is_igif(const struct lu_fid *fid) +{ + return fid_seq_is_igif(fid_seq(fid)); +} + +/** + * Check if a fid is idif or not. + * \param fid the fid to be tested. + * \return true if the fid is an idif; otherwise false. + */ +static inline bool fid_seq_is_idif(__u64 seq) +{ + return seq >= FID_SEQ_IDIF && seq <= FID_SEQ_IDIF_MAX; +} + +static inline bool fid_is_idif(const struct lu_fid *fid) +{ + return fid_seq_is_idif(fid_seq(fid)); +} + +static inline bool fid_is_local_file(const struct lu_fid *fid) +{ + return fid_seq_is_local_file(fid_seq(fid)); +} + +static inline bool fid_seq_is_norm(__u64 seq) +{ + return (seq >= FID_SEQ_NORMAL); +} + +static inline bool fid_is_norm(const struct lu_fid *fid) +{ + return fid_seq_is_norm(fid_seq(fid)); +} + +/* convert an OST objid into an IDIF FID SEQ number */ +static inline __u64 fid_idif_seq(__u64 id, __u32 ost_idx) +{ + return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff); +} + +/* convert a packed IDIF FID into an OST objid */ +static inline __u64 fid_idif_id(__u64 seq, __u32 oid, __u32 ver) +{ + return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid; +} + +static inline __u32 idif_ost_idx(__u64 seq) +{ + return (seq >> 16) & 0xffff; +} + +/* extract ost index from IDIF FID */ +static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid) +{ + return idif_ost_idx(fid_seq(fid)); +} + +/** + * Get inode number from an igif. + * \param fid an igif to get inode number from. + * \return inode number for the igif. + */ +static inline ino_t lu_igif_ino(const struct lu_fid *fid) +{ + return fid_seq(fid); +} + +/** + * Get inode generation from an igif. + * \param fid an igif to get inode generation from. + * \return inode generation for the igif. + */ +static inline __u32 lu_igif_gen(const struct lu_fid *fid) +{ + return fid_oid(fid); +} + +/** + * Build igif from the inode number/generation. + */ +static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen) +{ + fid->f_seq = ino; + fid->f_oid = gen; + fid->f_ver = 0; +} + +/* + * Fids are transmitted across network (in the sender byte-ordering), + * and stored on disk in big-endian order. + */ +static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __cpu_to_le64(fid_seq(src)); + dst->f_oid = __cpu_to_le32(fid_oid(src)); + dst->f_ver = __cpu_to_le32(fid_ver(src)); +} + +static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __le64_to_cpu(fid_seq(src)); + dst->f_oid = __le32_to_cpu(fid_oid(src)); + dst->f_ver = __le32_to_cpu(fid_ver(src)); +} + +static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __cpu_to_be64(fid_seq(src)); + dst->f_oid = __cpu_to_be32(fid_oid(src)); + dst->f_ver = __cpu_to_be32(fid_ver(src)); +} + +static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src) +{ + dst->f_seq = __be64_to_cpu(fid_seq(src)); + dst->f_oid = __be32_to_cpu(fid_oid(src)); + dst->f_ver = __be32_to_cpu(fid_ver(src)); +} + +static inline bool fid_is_sane(const struct lu_fid *fid) +{ + return fid && ((fid_seq(fid) >= FID_SEQ_START && !fid_ver(fid)) || + fid_is_igif(fid) || fid_is_idif(fid) || + fid_seq_is_rsvd(fid_seq(fid))); +} + +static inline bool lu_fid_eq(const struct lu_fid *f0, const struct lu_fid *f1) +{ + return !memcmp(f0, f1, sizeof(*f0)); +} + +static inline int lu_fid_cmp(const struct lu_fid *f0, + const struct lu_fid *f1) +{ + if (fid_seq(f0) != fid_seq(f1)) + return fid_seq(f0) > fid_seq(f1) ? 1 : -1; + + if (fid_oid(f0) != fid_oid(f1)) + return fid_oid(f0) > fid_oid(f1) ? 1 : -1; + + if (fid_ver(f0) != fid_ver(f1)) + return fid_ver(f0) > fid_ver(f1) ? 1 : -1; + + return 0; +} +#endif diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h new file mode 100644 index 0000000..fe7c59f --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h @@ -0,0 +1,237 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * 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) 2011, 2014, Intel Corporation. + * + * Copyright 2015 Cray Inc, all rights reserved. + * Author: Ben Evans. + * + * Define ost_id associated functions + */ + +#ifndef _UAPI_LUSTRE_OSTID_H_ +#define _UAPI_LUSTRE_OSTID_H_ + +#include +#include "lustre_fid.h" +#include "../../../../lustre/include/lustre/lustre_idl.h" + +static inline __u64 lmm_oi_id(const struct ost_id *oi) +{ + return oi->oi.oi_id; +} + +static inline __u64 lmm_oi_seq(const struct ost_id *oi) +{ + return oi->oi.oi_seq; +} + +static inline void lmm_oi_set_seq(struct ost_id *oi, __u64 seq) +{ + oi->oi.oi_seq = seq; +} + +static inline void lmm_oi_set_id(struct ost_id *oi, __u64 oid) +{ + oi->oi.oi_id = oid; +} + +static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi, + const struct ost_id *src_oi) +{ + dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq); +} + +static inline void lmm_oi_cpu_to_le(struct ost_id *dst_oi, + const struct ost_id *src_oi) +{ + dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq); +} + +/* extract OST sequence (group) from a wire ost_id (id/seq) pair */ +static inline __u64 ostid_seq(const struct ost_id *ostid) +{ + if (fid_seq_is_mdt0(ostid->oi.oi_seq)) + return FID_SEQ_OST_MDT0; + + if (fid_seq_is_default(ostid->oi.oi_seq)) + return FID_SEQ_LOV_DEFAULT; + + if (fid_is_idif(&ostid->oi_fid)) + return FID_SEQ_OST_MDT0; + + return fid_seq(&ostid->oi_fid); +} + +/* extract OST objid from a wire ost_id (id/seq) pair */ +static inline __u64 ostid_id(const struct ost_id *ostid) +{ + if (fid_seq_is_mdt0(ostid->oi.oi_seq)) + return ostid->oi.oi_id & IDIF_OID_MASK; + + if (fid_seq_is_default(ostid->oi.oi_seq)) + return ostid->oi.oi_id; + + if (fid_is_idif(&ostid->oi_fid)) + return fid_idif_id(fid_seq(&ostid->oi_fid), + fid_oid(&ostid->oi_fid), 0); + + return fid_oid(&ostid->oi_fid); +} + +static inline void ostid_set_seq(struct ost_id *oi, __u64 seq) +{ + if (fid_seq_is_mdt0(seq) || fid_seq_is_default(seq)) { + oi->oi.oi_seq = seq; + } else { + oi->oi_fid.f_seq = seq; + /* + * Note: if f_oid + f_ver is zero, we need init it + * to be 1, otherwise, ostid_seq will treat this + * as old ostid (oi_seq == 0) + */ + if (!oi->oi_fid.f_oid && !oi->oi_fid.f_ver) + oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID; + } +} + +static inline void ostid_set_seq_mdt0(struct ost_id *oi) +{ + ostid_set_seq(oi, FID_SEQ_OST_MDT0); +} + +static inline void ostid_set_seq_echo(struct ost_id *oi) +{ + ostid_set_seq(oi, FID_SEQ_ECHO); +} + +static inline void ostid_set_seq_llog(struct ost_id *oi) +{ + ostid_set_seq(oi, FID_SEQ_LLOG); +} + +static inline void ostid_cpu_to_le(const struct ost_id *src_oi, + struct ost_id *dst_oi) +{ + if (fid_seq_is_mdt0(src_oi->oi.oi_seq)) { + dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq); + } else { + fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid); + } +} + +static inline void ostid_le_to_cpu(const struct ost_id *src_oi, + struct ost_id *dst_oi) +{ + if (fid_seq_is_mdt0(src_oi->oi.oi_seq)) { + dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id); + dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq); + } else { + fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid); + } +} + +/** + * Sigh, because pre-2.4 uses + * struct lov_mds_md_v1 { + * ........ + * __u64 lmm_object_id; + * __u64 lmm_object_seq; + * ...... + * } + * to identify the LOV(MDT) object, and lmm_object_seq will + * be normal_fid, which make it hard to combine these conversion + * to ostid_to FID. so we will do lmm_oi/fid conversion separately + * + * We can tell the lmm_oi by this way, + * 1.8: lmm_object_id = {inode}, lmm_object_gr = 0 + * 2.1: lmm_object_id = {oid < 128k}, lmm_object_seq = FID_SEQ_NORMAL + * 2.4: lmm_oi.f_seq = FID_SEQ_NORMAL, lmm_oi.f_oid = {oid < 128k}, + * lmm_oi.f_ver = 0 + * + * But currently lmm_oi/lsm_oi does not have any "real" usages, + * except for printing some information, and the user can always + * get the real FID from LMA, besides this multiple case check might + * make swab more complicate. So we will keep using id/seq for lmm_oi. + */ + +static inline void fid_to_lmm_oi(const struct lu_fid *fid, + struct ost_id *oi) +{ + oi->oi.oi_id = fid_oid(fid); + oi->oi.oi_seq = fid_seq(fid); +} + +/** + * Unpack an OST object id/seq (group) into a FID. This is needed for + * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper + * FIDs. Note that if an id/seq is already in FID/IDIF format it will + * be passed through unchanged. Only legacy OST objects in "group 0" + * will be mapped into the IDIF namespace so that they can fit into the + * struct lu_fid fields without loss. + */ +static inline int ostid_to_fid(struct lu_fid *fid, const struct ost_id *ostid, + __u32 ost_idx) +{ + __u64 seq = ostid_seq(ostid); + + if (ost_idx > 0xffff) + return -EBADF; + + if (fid_seq_is_mdt0(seq)) { + __u64 oid = ostid_id(ostid); + + /* This is a "legacy" (old 1.x/2.early) OST object in "group 0" + * that we map into the IDIF namespace. It allows up to 2^48 + * objects per OST, as this is the object namespace that has + * been in production for years. This can handle create rates + * of 1M objects/s/OST for 9 years, or combinations thereof. + */ + if (oid >= IDIF_MAX_OID) + return -EBADF; + + fid->f_seq = fid_idif_seq(oid, ost_idx); + /* truncate to 32 bits by assignment */ + fid->f_oid = oid; + /* in theory, not currently used */ + fid->f_ver = oid >> 48; + } else if (!fid_seq_is_default(seq)) { + /* This is either an IDIF object, which identifies objects + * across all OSTs, or a regular FID. The IDIF namespace + * maps legacy OST objects into the FID namespace. In both + * cases, we just pass the FID through, no conversion needed. + */ + if (ostid->oi_fid.f_ver) + return -EBADF; + + *fid = ostid->oi_fid; + } + + return 0; +} +#endif /* _UAPI_LUSTRE_OSTID_H_ */ diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index d70495d..fab624e 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -74,7 +74,6 @@ /* Defn's shared with user-space. */ #include "lustre_user.h" -#include "lustre_errno.h" #include "../lustre_ver.h" /* @@ -217,34 +216,6 @@ enum { LUSTRE_FID_INIT_OID = 1UL }; -/** returns fid object sequence */ -static inline __u64 fid_seq(const struct lu_fid *fid) -{ - return fid->f_seq; -} - -/** returns fid object id */ -static inline __u32 fid_oid(const struct lu_fid *fid) -{ - return fid->f_oid; -} - -/** returns fid object version */ -static inline __u32 fid_ver(const struct lu_fid *fid) -{ - return fid->f_ver; -} - -static inline void fid_zero(struct lu_fid *fid) -{ - memset(fid, 0, sizeof(*fid)); -} - -static inline __u64 fid_ver_oid(const struct lu_fid *fid) -{ - return ((__u64)fid_ver(fid) << 32 | fid_oid(fid)); -} - /* copytool uses a 32b bitmask field to encode archive-Ids during register * with MDT thru kuc. * archive num = 0 => all @@ -313,451 +284,12 @@ enum dot_lustre_oid { FID_OID_DOT_LUSTRE_OBF = 2UL, }; -static inline bool fid_seq_is_mdt0(__u64 seq) -{ - return (seq == FID_SEQ_OST_MDT0); -} - -static inline bool fid_seq_is_mdt(__u64 seq) -{ - return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL; +/** OID for FID_SEQ_ROOT */ +enum root_oid { + FID_OID_ROOT = 1UL, + FID_OID_ECHO_ROOT = 2UL, }; -static inline bool fid_seq_is_echo(__u64 seq) -{ - return (seq == FID_SEQ_ECHO); -} - -static inline bool fid_is_echo(const struct lu_fid *fid) -{ - return fid_seq_is_echo(fid_seq(fid)); -} - -static inline bool fid_seq_is_llog(__u64 seq) -{ - return (seq == FID_SEQ_LLOG); -} - -static inline bool fid_is_llog(const struct lu_fid *fid) -{ - /* file with OID == 0 is not llog but contains last oid */ - return fid_seq_is_llog(fid_seq(fid)) && fid_oid(fid) > 0; -} - -static inline bool fid_seq_is_rsvd(__u64 seq) -{ - return (seq > FID_SEQ_OST_MDT0 && seq <= FID_SEQ_RSVD); -}; - -static inline bool fid_seq_is_special(__u64 seq) -{ - return seq == FID_SEQ_SPECIAL; -}; - -static inline bool fid_seq_is_local_file(__u64 seq) -{ - return seq == FID_SEQ_LOCAL_FILE || - seq == FID_SEQ_LOCAL_NAME; -}; - -static inline bool fid_seq_is_root(__u64 seq) -{ - return seq == FID_SEQ_ROOT; -} - -static inline bool fid_seq_is_dot(__u64 seq) -{ - return seq == FID_SEQ_DOT_LUSTRE; -} - -static inline bool fid_seq_is_default(__u64 seq) -{ - return seq == FID_SEQ_LOV_DEFAULT; -} - -static inline bool fid_is_mdt0(const struct lu_fid *fid) -{ - return fid_seq_is_mdt0(fid_seq(fid)); -} - -static inline void lu_root_fid(struct lu_fid *fid) -{ - fid->f_seq = FID_SEQ_ROOT; - fid->f_oid = 1; - fid->f_ver = 0; -} - -/** - * Check if a fid is igif or not. - * \param fid the fid to be tested. - * \return true if the fid is a igif; otherwise false. - */ -static inline bool fid_seq_is_igif(__u64 seq) -{ - return seq >= FID_SEQ_IGIF && seq <= FID_SEQ_IGIF_MAX; -} - -static inline bool fid_is_igif(const struct lu_fid *fid) -{ - return fid_seq_is_igif(fid_seq(fid)); -} - -/** - * Check if a fid is idif or not. - * \param fid the fid to be tested. - * \return true if the fid is a idif; otherwise false. - */ -static inline bool fid_seq_is_idif(__u64 seq) -{ - return seq >= FID_SEQ_IDIF && seq <= FID_SEQ_IDIF_MAX; -} - -static inline bool fid_is_idif(const struct lu_fid *fid) -{ - return fid_seq_is_idif(fid_seq(fid)); -} - -static inline bool fid_is_local_file(const struct lu_fid *fid) -{ - return fid_seq_is_local_file(fid_seq(fid)); -} - -static inline bool fid_seq_is_norm(__u64 seq) -{ - return (seq >= FID_SEQ_NORMAL); -} - -static inline bool fid_is_norm(const struct lu_fid *fid) -{ - return fid_seq_is_norm(fid_seq(fid)); -} - -/* convert an OST objid into an IDIF FID SEQ number */ -static inline __u64 fid_idif_seq(__u64 id, __u32 ost_idx) -{ - return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff); -} - -/* convert a packed IDIF FID into an OST objid */ -static inline __u64 fid_idif_id(__u64 seq, __u32 oid, __u32 ver) -{ - return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid; -} - -/* extract ost index from IDIF FID */ -static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid) -{ - return (fid_seq(fid) >> 16) & 0xffff; -} - -/* extract OST sequence (group) from a wire ost_id (id/seq) pair */ -static inline __u64 ostid_seq(const struct ost_id *ostid) -{ - if (fid_seq_is_mdt0(ostid->oi.oi_seq)) - return FID_SEQ_OST_MDT0; - - if (unlikely(fid_seq_is_default(ostid->oi.oi_seq))) - return FID_SEQ_LOV_DEFAULT; - - if (fid_is_idif(&ostid->oi_fid)) - return FID_SEQ_OST_MDT0; - - return fid_seq(&ostid->oi_fid); -} - -/* extract OST objid from a wire ost_id (id/seq) pair */ -static inline __u64 ostid_id(const struct ost_id *ostid) -{ - if (fid_seq_is_mdt0(ostid->oi.oi_seq)) - return ostid->oi.oi_id & IDIF_OID_MASK; - - if (unlikely(fid_seq_is_default(ostid->oi.oi_seq))) - return ostid->oi.oi_id; - - if (fid_is_idif(&ostid->oi_fid)) - return fid_idif_id(fid_seq(&ostid->oi_fid), - fid_oid(&ostid->oi_fid), 0); - - return fid_oid(&ostid->oi_fid); -} - -static inline void ostid_set_seq(struct ost_id *oi, __u64 seq) -{ - if (fid_seq_is_mdt0(seq) || fid_seq_is_default(seq)) { - oi->oi.oi_seq = seq; - } else { - oi->oi_fid.f_seq = seq; - /* Note: if f_oid + f_ver is zero, we need init it - * to be 1, otherwise, ostid_seq will treat this - * as old ostid (oi_seq == 0) - */ - if (oi->oi_fid.f_oid == 0 && oi->oi_fid.f_ver == 0) - oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID; - } -} - -static inline void ostid_set_seq_mdt0(struct ost_id *oi) -{ - ostid_set_seq(oi, FID_SEQ_OST_MDT0); -} - -static inline void ostid_set_seq_echo(struct ost_id *oi) -{ - ostid_set_seq(oi, FID_SEQ_ECHO); -} - -static inline void ostid_set_seq_llog(struct ost_id *oi) -{ - ostid_set_seq(oi, FID_SEQ_LLOG); -} - -/** - * Note: we need check oi_seq to decide where to set oi_id, - * so oi_seq should always be set ahead of oi_id. - */ -static inline int ostid_set_id(struct ost_id *oi, __u64 oid) -{ - if (fid_seq_is_mdt0(oi->oi.oi_seq)) { - if (oid >= IDIF_MAX_OID) - return -E2BIG; - oi->oi.oi_id = oid; - } else if (fid_is_idif(&oi->oi_fid)) { - if (oid >= IDIF_MAX_OID) - return -E2BIG; - oi->oi_fid.f_seq = fid_idif_seq(oid, - fid_idif_ost_idx(&oi->oi_fid)); - oi->oi_fid.f_oid = oid; - oi->oi_fid.f_ver = oid >> 48; - } else { - if (oid >= OBIF_MAX_OID) - return -E2BIG; - oi->oi_fid.f_oid = oid; - } - return 0; -} - -static inline int fid_set_id(struct lu_fid *fid, __u64 oid) -{ - if (unlikely(fid_seq_is_igif(fid->f_seq))) { - CERROR("bad IGIF, " DFID "\n", PFID(fid)); - return -EBADF; - } - - if (fid_is_idif(fid)) { - if (oid >= IDIF_MAX_OID) { - CERROR("Too large OID %#llx to set IDIF " DFID "\n", - (unsigned long long)oid, PFID(fid)); - return -EBADF; - } - fid->f_seq = fid_idif_seq(oid, fid_idif_ost_idx(fid)); - fid->f_oid = oid; - fid->f_ver = oid >> 48; - } else { - if (oid >= OBIF_MAX_OID) { - CERROR("Too large OID %#llx to set REG " DFID "\n", - (unsigned long long)oid, PFID(fid)); - return -EBADF; - } - fid->f_oid = oid; - } - return 0; -} - -/** - * Unpack an OST object id/seq (group) into a FID. This is needed for - * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper - * FIDs. Note that if an id/seq is already in FID/IDIF format it will - * be passed through unchanged. Only legacy OST objects in "group 0" - * will be mapped into the IDIF namespace so that they can fit into the - * struct lu_fid fields without loss. For reference see: - * http://wiki.old.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs - */ -static inline int ostid_to_fid(struct lu_fid *fid, struct ost_id *ostid, - __u32 ost_idx) -{ - __u64 seq = ostid_seq(ostid); - - if (ost_idx > 0xffff) { - CERROR("bad ost_idx, " DOSTID " ost_idx:%u\n", POSTID(ostid), - ost_idx); - return -EBADF; - } - - if (fid_seq_is_mdt0(seq)) { - __u64 oid = ostid_id(ostid); - - /* This is a "legacy" (old 1.x/2.early) OST object in "group 0" - * that we map into the IDIF namespace. It allows up to 2^48 - * objects per OST, as this is the object namespace that has - * been in production for years. This can handle create rates - * of 1M objects/s/OST for 9 years, or combinations thereof. - */ - if (oid >= IDIF_MAX_OID) { - CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n", - POSTID(ostid), ost_idx); - return -EBADF; - } - fid->f_seq = fid_idif_seq(oid, ost_idx); - /* truncate to 32 bits by assignment */ - fid->f_oid = oid; - /* in theory, not currently used */ - fid->f_ver = oid >> 48; - } else if (likely(!fid_seq_is_default(seq))) { - /* This is either an IDIF object, which identifies objects across - * all OSTs, or a regular FID. The IDIF namespace maps legacy - * OST objects into the FID namespace. In both cases, we just - * pass the FID through, no conversion needed. - */ - if (ostid->oi_fid.f_ver != 0) { - CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n", - POSTID(ostid), ost_idx); - return -EBADF; - } - *fid = ostid->oi_fid; - } - - return 0; -} - -/* pack any OST FID into an ostid (id/seq) for the wire/disk */ -static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid) -{ - if (unlikely(fid_seq_is_igif(fid->f_seq))) { - CERROR("bad IGIF, " DFID "\n", PFID(fid)); - return -EBADF; - } - - if (fid_is_idif(fid)) { - ostid_set_seq_mdt0(ostid); - ostid_set_id(ostid, fid_idif_id(fid_seq(fid), fid_oid(fid), - fid_ver(fid))); - } else { - ostid->oi_fid = *fid; - } - - return 0; -} - -/* Check whether the fid is for LAST_ID */ -static inline bool fid_is_last_id(const struct lu_fid *fid) -{ - return (fid_oid(fid) == 0); -} - -/** - * Get inode number from a igif. - * \param fid a igif to get inode number from. - * \return inode number for the igif. - */ -static inline ino_t lu_igif_ino(const struct lu_fid *fid) -{ - return fid_seq(fid); -} - -/** - * Get inode generation from a igif. - * \param fid a igif to get inode generation from. - * \return inode generation for the igif. - */ -static inline __u32 lu_igif_gen(const struct lu_fid *fid) -{ - return fid_oid(fid); -} - -/** - * Build igif from the inode number/generation. - */ -static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen) -{ - fid->f_seq = ino; - fid->f_oid = gen; - fid->f_ver = 0; -} - -/* - * Fids are transmitted across network (in the sender byte-ordering), - * and stored on disk in big-endian order. - */ -static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = cpu_to_le64(fid_seq(src)); - dst->f_oid = cpu_to_le32(fid_oid(src)); - dst->f_ver = cpu_to_le32(fid_ver(src)); -} - -static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = le64_to_cpu(fid_seq(src)); - dst->f_oid = le32_to_cpu(fid_oid(src)); - dst->f_ver = le32_to_cpu(fid_ver(src)); -} - -static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = cpu_to_be64(fid_seq(src)); - dst->f_oid = cpu_to_be32(fid_oid(src)); - dst->f_ver = cpu_to_be32(fid_ver(src)); -} - -static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src) -{ - dst->f_seq = be64_to_cpu(fid_seq(src)); - dst->f_oid = be32_to_cpu(fid_oid(src)); - dst->f_ver = be32_to_cpu(fid_ver(src)); -} - -static inline bool fid_is_sane(const struct lu_fid *fid) -{ - return fid && - ((fid_seq(fid) >= FID_SEQ_START && fid_ver(fid) == 0) || - fid_is_igif(fid) || fid_is_idif(fid) || - fid_seq_is_rsvd(fid_seq(fid))); -} - -static inline bool lu_fid_eq(const struct lu_fid *f0, const struct lu_fid *f1) -{ - return memcmp(f0, f1, sizeof(*f0)) == 0; -} - -#define __diff_normalize(val0, val1) \ -({ \ - typeof(val0) __val0 = (val0); \ - typeof(val1) __val1 = (val1); \ - \ - (__val0 == __val1 ? 0 : __val0 > __val1 ? 1 : -1); \ -}) - -static inline int lu_fid_cmp(const struct lu_fid *f0, - const struct lu_fid *f1) -{ - return - __diff_normalize(fid_seq(f0), fid_seq(f1)) ?: - __diff_normalize(fid_oid(f0), fid_oid(f1)) ?: - __diff_normalize(fid_ver(f0), fid_ver(f1)); -} - -static inline void ostid_cpu_to_le(const struct ost_id *src_oi, - struct ost_id *dst_oi) -{ - if (fid_seq_is_mdt0(ostid_seq(src_oi))) { - dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq); - } else { - fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid); - } -} - -static inline void ostid_le_to_cpu(const struct ost_id *src_oi, - struct ost_id *dst_oi) -{ - if (fid_seq_is_mdt0(ostid_seq(src_oi))) { - dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq); - } else { - fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid); - } -} - /** @} lu_fid */ /** \defgroup lu_dir lu_dir @@ -1377,71 +909,6 @@ struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */ struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */ }; -/** - * Sigh, because pre-2.4 uses - * struct lov_mds_md_v1 { - * ........ - * __u64 lmm_object_id; - * __u64 lmm_object_seq; - * ...... - * } - * to identify the LOV(MDT) object, and lmm_object_seq will - * be normal_fid, which make it hard to combine these conversion - * to ostid_to FID. so we will do lmm_oi/fid conversion separately - * - * We can tell the lmm_oi by this way, - * 1.8: lmm_object_id = {inode}, lmm_object_gr = 0 - * 2.1: lmm_object_id = {oid < 128k}, lmm_object_seq = FID_SEQ_NORMAL - * 2.4: lmm_oi.f_seq = FID_SEQ_NORMAL, lmm_oi.f_oid = {oid < 128k}, - * lmm_oi.f_ver = 0 - * - * But currently lmm_oi/lsm_oi does not have any "real" usages, - * except for printing some information, and the user can always - * get the real FID from LMA, besides this multiple case check might - * make swab more complicate. So we will keep using id/seq for lmm_oi. - */ - -static inline void fid_to_lmm_oi(const struct lu_fid *fid, - struct ost_id *oi) -{ - oi->oi.oi_id = fid_oid(fid); - oi->oi.oi_seq = fid_seq(fid); -} - -static inline void lmm_oi_set_seq(struct ost_id *oi, __u64 seq) -{ - oi->oi.oi_seq = seq; -} - -static inline void lmm_oi_set_id(struct ost_id *oi, __u64 oid) -{ - oi->oi.oi_id = oid; -} - -static inline __u64 lmm_oi_id(const struct ost_id *oi) -{ - return oi->oi.oi_id; -} - -static inline __u64 lmm_oi_seq(const struct ost_id *oi) -{ - return oi->oi.oi_seq; -} - -static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi, - const struct ost_id *src_oi) -{ - dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq); -} - -static inline void lmm_oi_cpu_to_le(struct ost_id *dst_oi, - const struct ost_id *src_oi) -{ - dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id); - dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq); -} - #define MAX_MD_SIZE \ (sizeof(struct lov_mds_md) + 4 * sizeof(struct lov_ost_data)) #define MIN_MD_SIZE \ diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 0446bec..7c51642 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -149,8 +149,9 @@ */ #include "../../include/linux/libcfs/libcfs.h" +#include "../../include/uapi/linux/lustre/lustre_fid.h" #include "lustre/lustre_idl.h" -#include "seq_range.h" +#include "../../include/uapi/linux/lustre/lustre_ostid.h" struct lu_env; struct lu_site; @@ -494,6 +495,52 @@ static inline int ostid_res_name_eq(const struct ost_id *oi, } } +/** + * Note: we need check oi_seq to decide where to set oi_id, + * so oi_seq should always be set ahead of oi_id. + */ +static inline int ostid_set_id(struct ost_id *oi, __u64 oid) +{ + if (fid_seq_is_mdt0(oi->oi.oi_seq)) { + if (oid >= IDIF_MAX_OID) + return -E2BIG; + oi->oi.oi_id = oid; + } else if (fid_is_idif(&oi->oi_fid)) { + if (oid >= IDIF_MAX_OID) + return -E2BIG; + oi->oi_fid.f_seq = fid_idif_seq(oid, + fid_idif_ost_idx(&oi->oi_fid)); + oi->oi_fid.f_oid = oid; + oi->oi_fid.f_ver = oid >> 48; + } else { + if (oid >= OBIF_MAX_OID) + return -E2BIG; + oi->oi_fid.f_oid = oid; + } + return 0; +} + +/* pack any OST FID into an ostid (id/seq) for the wire/disk */ +static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid) +{ + int rc = 0; + + if (fid_seq_is_igif(fid->f_seq)) + return -EBADF; + + if (fid_is_idif(fid)) { + u64 objid = fid_idif_id(fid_seq(fid), fid_oid(fid), + fid_ver(fid)); + + ostid_set_seq_mdt0(ostid); + rc = ostid_set_id(ostid, objid); + } else { + ostid->oi_fid = *fid; + } + + return rc; +} + /* The same as osc_build_res_name() */ static inline void ost_fid_build_resid(const struct lu_fid *fid, struct ldlm_res_id *resname) diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index 6ef1b03..f3c61d1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -40,6 +40,7 @@ #include "lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" +#include "seq_range.h" struct lu_client_fld; struct lu_server_fld; diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 2e3db5e..b8002e9 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -57,6 +57,8 @@ #define DEBUG_SUBSYSTEM S_LDLM +#include "../include/lustre/lustre_errno.h" + #include "../include/lustre_dlm.h" #include "../include/obd_class.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 1a3fa1b..dc775bb 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -38,6 +38,8 @@ # include # include +#include "../include/lustre/lustre_errno.h" + #include "../include/cl_object.h" #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:01 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:01 -0400 Subject: [lustre-devel] [PATCH 07/64 v2] staging: lustre: uapi: remove userland version of obd_ioctl_*() In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-8-git-send-email-jsimmons@infradead.org> The header lustre_ioctl.h has both kernel and user space versions of obd_ioctl_*() functions. Lets remove the user land version which have been integrated into the lustre tools. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_ioctl.h | 87 ---------------------- 1 file changed, 87 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index eb08df3..84654af 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -208,8 +208,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) return 0; } -#ifdef __KERNEL__ - int obd_ioctl_getdata(char **buf, int *len, void __user *arg); int obd_ioctl_popdata(void __user *arg, void *data, int len); @@ -218,91 +216,6 @@ static inline void obd_ioctl_freedata(char *buf, size_t len) kvfree(buf); } -#else /* __KERNEL__ */ - -static inline int obd_ioctl_pack(struct obd_ioctl_data *data, char **pbuf, - int max_len) -{ - char *ptr; - struct obd_ioctl_data *overlay; - - data->ioc_len = obd_ioctl_packlen(data); - data->ioc_version = OBD_IOCTL_VERSION; - - if (*pbuf && data->ioc_len > max_len) { - fprintf(stderr, "pbuf = %p, ioc_len = %u, max_len = %d\n", - *pbuf, data->ioc_len, max_len); - return -EINVAL; - } - - if (!*pbuf) - *pbuf = malloc(data->ioc_len); - - if (!*pbuf) - return -ENOMEM; - - overlay = (struct obd_ioctl_data *)*pbuf; - memcpy(*pbuf, data, sizeof(*data)); - - ptr = overlay->ioc_bulk; - if (data->ioc_inlbuf1) - LOGL(data->ioc_inlbuf1, data->ioc_inllen1, ptr); - - if (data->ioc_inlbuf2) - LOGL(data->ioc_inlbuf2, data->ioc_inllen2, ptr); - - if (data->ioc_inlbuf3) - LOGL(data->ioc_inlbuf3, data->ioc_inllen3, ptr); - - if (data->ioc_inlbuf4) - LOGL(data->ioc_inlbuf4, data->ioc_inllen4, ptr); - - if (obd_ioctl_is_invalid(overlay)) { - fprintf(stderr, "invalid ioctl data: ioc_len = %u, max_len = %d\n", - data->ioc_len, max_len); - return -EINVAL; - } - - return 0; -} - -static inline int -obd_ioctl_unpack(struct obd_ioctl_data *data, char *pbuf, int max_len) -{ - char *ptr; - struct obd_ioctl_data *overlay; - - if (!pbuf) - return 1; - - overlay = (struct obd_ioctl_data *)pbuf; - - /* Preserve the caller's buffer pointers */ - overlay->ioc_inlbuf1 = data->ioc_inlbuf1; - overlay->ioc_inlbuf2 = data->ioc_inlbuf2; - overlay->ioc_inlbuf3 = data->ioc_inlbuf3; - overlay->ioc_inlbuf4 = data->ioc_inlbuf4; - - memcpy(data, pbuf, sizeof(*data)); - - ptr = overlay->ioc_bulk; - if (data->ioc_inlbuf1) - LOGU(data->ioc_inlbuf1, data->ioc_inllen1, ptr); - - if (data->ioc_inlbuf2) - LOGU(data->ioc_inlbuf2, data->ioc_inllen2, ptr); - - if (data->ioc_inlbuf3) - LOGU(data->ioc_inlbuf3, data->ioc_inllen3, ptr); - - if (data->ioc_inlbuf4) - LOGU(data->ioc_inlbuf4, data->ioc_inllen4, ptr); - - return 0; -} - -#endif /* !__KERNEL__ */ - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:03 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:03 -0400 Subject: [lustre-devel] [PATCH 09/64 v2] staging: lustre: uapi: remove obd_ioctl_popdata() wrapper In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-10-git-send-email-jsimmons@infradead.org> Replace obd_ioctl_popdata() with direct copy_to_user() call. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_ioctl.h | 1 - drivers/staging/lustre/lustre/obdclass/class_obd.c | 18 +++++++----------- .../lustre/lustre/obdclass/linux/linux-module.c | 8 -------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index 7a61a00..da9a071 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -209,7 +209,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) } int obd_ioctl_getdata(char **buf, int *len, void __user *arg); -int obd_ioctl_popdata(void __user *arg, void *data, int len); /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 8cc1fdc..477d611 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -206,8 +206,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING, strlen(LUSTRE_VERSION_STRING) + 1); - err = obd_ioctl_popdata((void __user *)arg, data, len); - if (err) + if (copy_to_user((void __user *)arg, data, len)) err = -EFAULT; goto out; @@ -225,9 +224,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) goto out; } - err = obd_ioctl_popdata((void __user *)arg, data, - sizeof(*data)); - if (err) + if (copy_to_user((void __user *)arg, data, sizeof(*data))) err = -EFAULT; goto out; } @@ -263,8 +260,8 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) CDEBUG(D_IOCTL, "device name %s, dev %d\n", data->ioc_inlbuf1, dev); - err = obd_ioctl_popdata((void __user *)arg, data, - sizeof(*data)); + + if (copy_to_user((void __user *)arg, data, sizeof(*data))) if (err) err = -EFAULT; goto out; @@ -304,9 +301,9 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) (int)index, status, obd->obd_type->typ_name, obd->obd_name, obd->obd_uuid.uuid, atomic_read(&obd->obd_refcount)); - err = obd_ioctl_popdata((void __user *)arg, data, len); - err = 0; + if (copy_to_user((void __user *)arg, data, len)) + err = -EFAULT; goto out; } } @@ -361,8 +358,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) if (err) goto out; - err = obd_ioctl_popdata((void __user *)arg, data, len); - if (err) + if (copy_to_user((void __user *)arg, data, len)) err = -EFAULT; goto out; } diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index eb88bd9..3a394d2 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -151,14 +151,6 @@ int obd_ioctl_getdata(char **buf, int *len, void __user *arg) } EXPORT_SYMBOL(obd_ioctl_getdata); -int obd_ioctl_popdata(void __user *arg, void *data, int len) -{ - int err; - - err = copy_to_user(arg, data, len) ? -EFAULT : 0; - return err; -} - /* opening /dev/obd */ static int obd_class_open(struct inode *inode, struct file *file) { -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:10 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:10 -0400 Subject: [lustre-devel] [PATCH 16/64 v2] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-17-git-send-email-jsimmons@infradead.org> Move all the kernel specific function prototypes from lustre_param.h into obd_config.h which is a kernel only header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_param.h | 11 ----------- drivers/staging/lustre/lustre/include/obd_class.h | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/lustre/include/lustre_param.h index 8061a04..2620e02 100644 --- a/drivers/staging/lustre/lustre/include/lustre_param.h +++ b/drivers/staging/lustre/lustre/include/lustre_param.h @@ -47,17 +47,6 @@ * @{ */ -/* For interoperability */ -struct cfg_interop_param { - char *old_param; - char *new_param; -}; - -/* obd_config.c */ -int class_find_param(char *buf, char *key, char **valp); -int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh); -int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh); - /****************** User-settable parameter keys *********************/ /* e.g. tunefs.lustre --param="failover.node=192.168.0.13 at tcp0" /dev/sda diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index d4a632a..8cc13ea 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -105,10 +105,28 @@ void obd_put_mod_rpc_slot(struct client_obd *cli, u32 opc, struct llog_rec_hdr; typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *, struct llog_rec_hdr *, void *); + /* obd_config.c */ int class_process_config(struct lustre_cfg *lcfg); int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, struct lustre_cfg *lcfg, void *data); + +/* For interoperability */ +struct cfg_interop_param { + char *old_param; + char *new_param; +}; + +int class_find_param(char *buf, char *key, char **valp); +struct cfg_interop_param *class_find_old_param(const char *param, + struct cfg_interop_param *ptr); +int class_get_next_param(char **params, char *copy); +int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh); +int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh); +int class_parse_net(char *buf, u32 *net, char **endh); +int class_match_nid(char *buf, char *key, lnet_nid_t nid); +int class_match_net(char *buf, char *key, u32 net); + struct obd_device *class_incref(struct obd_device *obd, const char *scope, const void *source); void class_decref(struct obd_device *obd, -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:12 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:12 -0400 Subject: [lustre-devel] [PATCH 18/64 v2] staging: lustre: uapi: move lustre_param.h to uapi directory In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-19-git-send-email-jsimmons@infradead.org> Move the header lustre_param.h to proper uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/{lustre/include => include/uapi/linux/lustre}/lustre_param.h | 0 drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_param.h (100%) diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h similarity index 100% rename from drivers/staging/lustre/lustre/include/lustre_param.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index e7d5228..3ab3a63 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -46,7 +46,7 @@ #include "../include/lustre_dlm.h" #include "../include/lprocfs_status.h" #include "../include/lustre_disk.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_log.h" #include "../include/cl_object.h" #include "../include/obd_cksum.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 8777d4b..475bf7e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -49,7 +49,7 @@ #include "../include/lustre_lib.h" #include "../include/lustre_mds.h" #include "../include/lustre_net.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_swab.h" #include "../include/lprocfs_status.h" #include "../include/obd_class.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 93fb195..4dcf3902 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -49,7 +49,7 @@ #include "../include/lustre_kernelcomm.h" #include "../include/lustre_lmv.h" #include "../include/lustre_log.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_swab.h" #include "../include/obd_class.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 2a93d67..783f9e0 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -42,7 +42,7 @@ #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" #include "../include/lustre_log.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/obd_class.h" #include "llog_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 8e0d4b1..555e67e 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -46,7 +46,7 @@ #include "../include/lustre/lustre_user.h" #include "../include/lustre_log.h" #include "../include/lustre_disk.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" static int (*client_fill_super)(struct super_block *sb, struct vfsmount *mnt); diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index e103d5a..453a59a 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -44,7 +44,7 @@ #include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_debug.h" #include "../include/lustre_obdo.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_fid.h" #include "../include/obd_class.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index 2181a85..bb953d4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -39,7 +39,7 @@ #include "../include/obd.h" #include "../include/obd_support.h" #include "../include/lustre_import.h" -#include "../include/lustre_param.h" +#include "../../include/uapi/linux/lustre/lustre_param.h" #include "../include/lustre_sec.h" #include "ptlrpc_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:13 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:13 -0400 Subject: [lustre-devel] [PATCH 19/64 v2] staging: lustre: uapi: label lustre_param.h as an uapi header In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-20-git-send-email-jsimmons@infradead.org> Change LUSTRE_PARAM_H_ to _UAPI_LUSTRE_PARAM_H_ now that is a proper UAPI header Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h index f6f4752..cab0056 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h @@ -29,15 +29,13 @@ * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * lustre/include/lustre_param.h - * * User-settable parameter keys * * Author: Nathan Rutman */ -#ifndef _LUSTRE_PARAM_H -#define _LUSTRE_PARAM_H +#ifndef _UAPI_LUSTRE_PARAM_H_ +#define _UAPI_LUSTRE_PARAM_H_ /** \defgroup param param * @@ -92,4 +90,4 @@ /** @} param */ -#endif /* _LUSTRE_PARAM_H */ +#endif /* _UAPI_LUSTRE_PARAM_H_ */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:15 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:15 -0400 Subject: [lustre-devel] [PATCH 21/64 v2] staging: lustre: uapi: remove lustre_cfg_free wrapper In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-22-git-send-email-jsimmons@infradead.org> Replace all lustre_cfg_free() calls with direct kfree() call. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_cfg.h | 6 ------ drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_config.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 6 +++--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h index 8eb394e..3f280b5 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h @@ -246,12 +246,6 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd, return lcfg; } -static inline void lustre_cfg_free(struct lustre_cfg *lcfg) -{ - kfree(lcfg); - return; -} - static inline int lustre_cfg_sanity_check(void *buf, size_t len) { struct lustre_cfg *lcfg = (struct lustre_cfg *)buf; diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 36c3049..192b24d 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1293,7 +1293,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, prev_version, max_version, obdname, params); rc = class_process_config(lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); if (rc) CDEBUG(D_INFO, "process config for %s error %d\n", obdname, rc); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 783f9e0..4b5cd7d 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1262,7 +1262,7 @@ int class_config_llog_handler(const struct lu_env *env, lcfg_new->lcfg_nal = 0; /* illegal value for obsolete field */ rc = class_process_config(lcfg_new); - lustre_cfg_free(lcfg_new); + kfree(lcfg_new); if (inst) kfree(inst_name); @@ -1442,7 +1442,7 @@ int class_manual_cleanup(struct obd_device *obd) if (rc) CERROR("detach failed %d: %s\n", rc, obd->obd_name); out: - lustre_cfg_free(lcfg); + kfree(lcfg); return rc; } EXPORT_SYMBOL(class_manual_cleanup); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 555e67e..74de1fa 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -90,7 +90,7 @@ int lustre_process_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set(bufs, 3, &sb, sizeof(sb)); lcfg = lustre_cfg_new(LCFG_LOG_START, bufs); rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); kfree(bufs); @@ -128,7 +128,7 @@ int lustre_end_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set(&bufs, 2, cfg, sizeof(*cfg)); lcfg = lustre_cfg_new(LCFG_LOG_END, &bufs); rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); return rc; } EXPORT_SYMBOL(lustre_end_log); @@ -161,7 +161,7 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, lcfg = lustre_cfg_new(cmd, &bufs); lcfg->lcfg_nid = nid; rc = class_process_config(lcfg); - lustre_cfg_free(lcfg); + kfree(lcfg); return rc; } -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:29 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:29 -0400 Subject: [lustre-devel] [PATCH 35/64 v2] staging: lustre: lnet: delete lnet.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-36-git-send-email-jsimmons@infradead.org> The header lnet.h is just a bunch of headers included in a header. Just delete it and include the appropriate headers where needed. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 4 +- drivers/staging/lustre/include/linux/lnet/lnet.h | 44 ---------------------- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 1 - .../staging/lustre/lnet/klnds/socklnd/socklnd.h | 1 - drivers/staging/lustre/lnet/libcfs/module.c | 1 - drivers/staging/lustre/lnet/lnet/nidstrings.c | 2 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 1 - drivers/staging/lustre/lnet/selftest/console.h | 1 - drivers/staging/lustre/lnet/selftest/selftest.h | 1 - 9 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 drivers/staging/lustre/include/linux/lnet/lnet.h diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index f534115..9b923ec 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -37,9 +37,11 @@ #include "../libcfs/libcfs.h" #include "api.h" -#include "lnet.h" #include "lib-types.h" #include "lib-dlc.h" +#include "types.h" +#include "lnetctl.h" +#include "nidstr.h" extern struct lnet the_lnet; /* THE network */ diff --git a/drivers/staging/lustre/include/linux/lnet/lnet.h b/drivers/staging/lustre/include/linux/lnet/lnet.h deleted file mode 100644 index 5d1559a..0000000 --- a/drivers/staging/lustre/include/linux/lnet/lnet.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.gnu.org/licenses/gpl-2.0.html - * - * GPL HEADER END - */ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012 - 2015, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Seagate, Inc. - */ - -#ifndef __LNET_H__ -#define __LNET_H__ - -/* - * lnet.h - * - * User application interface file - */ -#include "types.h" -#include "nidstr.h" - -#endif diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 16e437b..8e59506 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -64,7 +64,6 @@ #define DEBUG_SUBSYSTEM S_LND #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lnet.h" #include "../../../include/linux/lnet/lib-lnet.h" #define IBLND_PEER_HASH_SIZE 101 /* # peer lists */ diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 9eb169d..88afe09 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -47,7 +47,6 @@ #include #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lnet.h" #include "../../../include/linux/lnet/lib-lnet.h" #include "../../../include/linux/lnet/socklnd.h" diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index c388550..9ece869 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -56,7 +56,6 @@ #include "../../include/linux/libcfs/libcfs_crypto.h" #include "../../include/linux/lnet/lib-lnet.h" #include "../../include/linux/lnet/lib-dlc.h" -#include "../../include/linux/lnet/lnet.h" #include "tracefile.h" static struct dentry *lnet_debugfs_root; diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index 298533d..cbbd11f 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" +#include "../../include/linux/lnet/nidstr.h" /* max value for numeric network address */ #define MAX_NUMERIC_VALUE 0xffffffff diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h index 7141d2c..e2a78b6 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.h +++ b/drivers/staging/lustre/lnet/selftest/conrpc.h @@ -40,7 +40,6 @@ #define __LST_CONRPC_H__ #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" #include "../../include/linux/lnet/lib-types.h" #include "../../include/linux/lnet/lnetst.h" #include "rpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index e3e11aa..0a9ba06 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -40,7 +40,6 @@ #define __LST_CONSOLE_H__ #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" #include "../../include/linux/lnet/lib-types.h" #include "../../include/linux/lnet/lnetst.h" #include "selftest.h" diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index b614e6f..bfa4971 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -39,7 +39,6 @@ #define LNET_ONLY #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lnet.h" #include "../../include/linux/lnet/lib-lnet.h" #include "../../include/linux/lnet/lib-types.h" #include "../../include/linux/lnet/lnetst.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:18 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:18 -0400 Subject: [lustre-devel] [PATCH 24/64 v2] staging: lustre: obdclass: no need to check for kfree In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-25-git-send-email-jsimmons@infradead.org> In class_config_llog_handler() a flag, inst, was used to determine if it was safe to call kfree. Its not needed so remove the flag. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/obd_config.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index dc7b27e..32ffa25 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1142,7 +1142,7 @@ int class_config_llog_handler(const struct lu_env *env, char *inst_name = NULL; int inst_len = 0; size_t lcfg_len; - int inst = 0, swab = 0; + int swab = 0; lcfg = (struct lustre_cfg *)cfg_buf; if (lcfg->lcfg_version == __swab32(LUSTRE_CFG_VERSION)) { @@ -1233,7 +1233,6 @@ int class_config_llog_handler(const struct lu_env *env, if (clli && clli->cfg_instance && LUSTRE_CFG_BUFLEN(lcfg, 0) > 0) { - inst = 1; inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) + sizeof(clli->cfg_instance) * 2 + 4; inst_name = kasprintf(GFP_NOFS, "%s-%p", @@ -1304,9 +1303,7 @@ int class_config_llog_handler(const struct lu_env *env, rc = class_process_config(lcfg_new); kfree(lcfg_new); - - if (inst) - kfree(inst_name); + kfree(inst_name); break; } default: -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:04 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:04 -0400 Subject: [lustre-devel] [PATCH 10/64 v2] staging: lustre: uapi: move obd_ioctl_getdata() declaration In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-11-git-send-email-jsimmons@infradead.org> Move obd_ioctl_getdata() from lustre_ioctl.h to obd_class.h since this function is only used by kernel space. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h | 2 -- drivers/staging/lustre/lustre/include/obd_class.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index da9a071..914cea1 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -208,8 +208,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) return 0; } -int obd_ioctl_getdata(char **buf, int *len, void __user *arg); - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index a6a4b2f..d4a632a 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -1559,4 +1559,7 @@ struct root_squash_info { struct rw_semaphore rsi_sem; }; +/* linux-module.c */ +int obd_ioctl_getdata(char **buf, int *len, void __user *arg); + #endif /* __LINUX_OBD_CLASS_H */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:17 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:17 -0400 Subject: [lustre-devel] [PATCH 23/64 v2] staging: lustre: uapi: move lustre_cfg_string() to obd_config.c In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-24-git-send-email-jsimmons@infradead.org> To perserve the truncate warning move lustre_cfg_string() to obd_config.c. A identical function was created for userland. This function was a bit big for a inline function. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_cfg.h | 29 ------------------ drivers/staging/lustre/lustre/include/obd_class.h | 1 + .../staging/lustre/lustre/obdclass/obd_config.c | 34 ++++++++++++++++++++++ drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 1 + 4 files changed, 36 insertions(+), 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h index 9d6934b..21a48b1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h @@ -179,35 +179,6 @@ static inline void lustre_cfg_bufs_init(struct lustre_cfg_bufs *bufs, } } -static inline char *lustre_cfg_string(struct lustre_cfg *lcfg, __u32 index) -{ - char *s; - - if (lcfg->lcfg_buflens[index] == 0) - return NULL; - - s = lustre_cfg_buf(lcfg, index); - if (!s) - return NULL; - - /* - * make sure it's NULL terminated, even if this kills a char - * of data. Try to use the padding first though. - */ - if (s[lcfg->lcfg_buflens[index] - 1] != '\0') { - size_t last = min((size_t)lcfg->lcfg_buflens[index], - cfs_size_round(lcfg->lcfg_buflens[index]) - 1); - char lost = s[last]; - - s[last] = '\0'; - if (lost != '\0') { - CWARN("Truncated buf %d to '%s' (lost '%c'...)\n", - index, s, lost); - } - } - return s; -} - static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) { __u32 i; diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 8cc13ea..7d98485 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -107,6 +107,7 @@ typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *, struct llog_rec_hdr *, void *); /* obd_config.c */ +char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index); int class_process_config(struct lustre_cfg *lcfg); int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, struct lustre_cfg *lcfg, void *data); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 4c7c4f3..dc7b27e 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -170,6 +170,40 @@ int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh) } EXPORT_SYMBOL(class_parse_nid_quiet); +char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index) +{ + char *s; + + if (!lcfg->lcfg_buflens[index]) + return NULL; + + s = lustre_cfg_buf(lcfg, index); + if (!s) + return NULL; + + /* + * make sure it's NULL terminated, even if this kills a char + * of data. Try to use the padding first though. + */ + if (s[lcfg->lcfg_buflens[index] - 1] != '\0') { + size_t last = ALIGN(lcfg->lcfg_buflens[index], 8) - 1; + char lost; + + /* Use the smaller value */ + if (last > lcfg->lcfg_buflens[index]) + last = lcfg->lcfg_buflens[index]; + + lost = s[last]; + s[last] = '\0'; + if (lost != '\0') { + CWARN("Truncated buf %d to '%s' (lost '%c'...)\n", + index, s, lost); + } + } + return s; +} +EXPORT_SYMBOL(lustre_cfg_string); + /********************** class fns **********************/ /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index bb953d4..9143441 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -37,6 +37,7 @@ #include #include "../include/obd.h" +#include "../include/obd_class.h" #include "../include/obd_support.h" #include "../include/lustre_import.h" #include "../../include/uapi/linux/lustre/lustre_param.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:24 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:24 -0400 Subject: [lustre-devel] [PATCH 30/64 v2] staging: lustre: uapi: label lustre_cfg.h as an uapi header In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-31-git-send-email-jsimmons@infradead.org> Change LUSTRE_CFG_H to _UAPI_LUSTRE_CFG_H_ now that it is a proper UAPI header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 2d37d1b..1533dcb 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -30,8 +30,8 @@ * Lustre is a trademark of Sun Microsystems, Inc. */ -#ifndef _LUSTRE_CFG_H -#define _LUSTRE_CFG_H +#ifndef _UAPI_LUSTRE_CFG_H_ +#define _UAPI_LUSTRE_CFG_H_ #include #include @@ -258,4 +258,4 @@ static inline int lustre_cfg_sanity_check(void *buf, size_t len) /** @} cfg */ -#endif /* _LUSTRE_CFG_H */ +#endif /* _UAPI_LUSTRE_CFG_H_ */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:28 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:28 -0400 Subject: [lustre-devel] [PATCH 34/64 v2] staging: lustre: socklnd: create socklnd.h UAPI header In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-35-git-send-email-jsimmons@infradead.org> Break out the parts from libcfs_debug.h that is used by both user land and kernel space into a new UAPI header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/socklnd.h | 10 +---- .../lustre/include/uapi/linux/lnet/socklnd.h | 44 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h index a1ae66e..27ce6ce 100644 --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h @@ -35,15 +35,7 @@ #define __LNET_LNET_SOCKLND_H__ #include "types.h" - -#define SOCKLND_CONN_NONE (-1) -#define SOCKLND_CONN_ANY 0 -#define SOCKLND_CONN_CONTROL 1 -#define SOCKLND_CONN_BULK_IN 2 -#define SOCKLND_CONN_BULK_OUT 3 -#define SOCKLND_CONN_NTYPES 4 - -#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN +#include "../../uapi/linux/lnet/socklnd.h" struct ksock_hello_msg { __u32 kshm_magic; /* magic number of socklnd message */ diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h b/drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h new file mode 100644 index 0000000..6453e05 --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lnet/socklnd.h @@ -0,0 +1,44 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * #defines shared between socknal implementation and utilities + */ +#ifndef __UAPI_LNET_SOCKLND_H__ +#define __UAPI_LNET_SOCKLND_H__ + +#define SOCKLND_CONN_NONE (-1) +#define SOCKLND_CONN_ANY 0 +#define SOCKLND_CONN_CONTROL 1 +#define SOCKLND_CONN_BULK_IN 2 +#define SOCKLND_CONN_BULK_OUT 3 +#define SOCKLND_CONN_NTYPES 4 + +#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN + +#endif -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:35 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:35 -0400 Subject: [lustre-devel] [PATCH 41/64 v2] staging: lustre: uapi: migrate remaining uapi headers to uapi directory In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-42-git-send-email-jsimmons@infradead.org> Move all the remaining lustre headers shared between user land and kernel space to the uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25246 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h | 2 +- .../ll_fiemap.h => include/uapi/linux/lustre/lustre_fiemap.h} | 6 +----- .../{lustre/include => include/uapi/linux}/lustre/lustre_idl.h | 6 ++---- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 2 +- .../uapi/linux/lustre/lustre_kernelcomm.h} | 6 +++--- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h | 1 - .../{lustre/include => include/uapi/linux}/lustre/lustre_user.h | 2 +- .../{lustre/include => include/uapi/linux/lustre}/lustre_ver.h | 0 drivers/staging/lustre/lustre/fid/fid_internal.h | 2 +- drivers/staging/lustre/lustre/fid/fid_lib.c | 1 - drivers/staging/lustre/lustre/fld/fld_cache.c | 2 +- drivers/staging/lustre/lustre/fld/fld_internal.h | 2 +- drivers/staging/lustre/lustre/fld/fld_request.c | 2 +- drivers/staging/lustre/lustre/include/llog_swab.h | 3 ++- drivers/staging/lustre/lustre/include/lprocfs_status.h | 2 +- drivers/staging/lustre/lustre/include/lu_object.h | 2 +- drivers/staging/lustre/lustre/include/{lustre => }/lustre_errno.h | 0 drivers/staging/lustre/lustre/include/lustre_export.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fld.h | 2 +- drivers/staging/lustre/lustre/include/lustre_import.h | 2 +- drivers/staging/lustre/lustre/include/lustre_kernelcomm.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 4 ++-- drivers/staging/lustre/lustre/include/lustre_lmv.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 2 +- drivers/staging/lustre/lustre/include/lustre_mdc.h | 1 - drivers/staging/lustre/lustre/include/lustre_mds.h | 1 - drivers/staging/lustre/lustre/include/lustre_net.h | 5 +++-- drivers/staging/lustre/lustre/include/lustre_obdo.h | 2 +- drivers/staging/lustre/lustre/include/lustre_swab.h | 2 +- drivers/staging/lustre/lustre/include/obd.h | 2 +- drivers/staging/lustre/lustre/include/obd_cksum.h | 2 +- drivers/staging/lustre/lustre/include/obd_class.h | 1 - drivers/staging/lustre/lustre/include/seq_range.h | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 3 +-- drivers/staging/lustre/lustre/llite/dcache.c | 2 +- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/lcommon_cl.c | 1 - drivers/staging/lustre/lustre/llite/llite_internal.h | 2 +- drivers/staging/lustre/lustre/llite/namei.c | 1 - drivers/staging/lustre/lustre/llite/range_lock.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_internal.h | 2 +- drivers/staging/lustre/lustre/llite/xattr.c | 1 - drivers/staging/lustre/lustre/llite/xattr_cache.c | 1 - drivers/staging/lustre/lustre/lmv/lmv_fld.c | 1 - drivers/staging/lustre/lustre/lmv/lmv_intent.c | 1 - drivers/staging/lustre/lustre/lmv/lmv_internal.h | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 1 - drivers/staging/lustre/lustre/lov/lov_ea.c | 2 +- drivers/staging/lustre/lustre/lov/lov_internal.h | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 3 --- drivers/staging/lustre/lustre/lov/lov_request.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 3 +-- drivers/staging/lustre/lustre/mgc/mgc_internal.h | 1 - drivers/staging/lustre/lustre/obdclass/linkea.c | 2 +- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +- drivers/staging/lustre/lustre/obdclass/obdo.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/errno.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 2 +- 67 files changed, 59 insertions(+), 81 deletions(-) rename drivers/staging/lustre/{lustre/include/lustre/ll_fiemap.h => include/uapi/linux/lustre/lustre_fiemap.h} (96%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_idl.h (99%) rename drivers/staging/lustre/{lustre/include/uapi_kernelcomm.h => include/uapi/linux/lustre/lustre_kernelcomm.h} (95%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux}/lustre/lustre_user.h (99%) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_ver.h (100%) rename drivers/staging/lustre/lustre/include/{lustre => }/lustre_errno.h (100%) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 1533dcb..2b7deaa 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -35,7 +35,7 @@ #include #include -#include "../../../../lustre/include/lustre/lustre_user.h" +#include "../../../uapi/linux/lustre/lustre_user.h" /** \defgroup cfg cfg * diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h index 9adc106..dd3785a 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h @@ -37,7 +37,7 @@ #ifndef _UAPI_LUSTRE_FID_H_ #define _UAPI_LUSTRE_FID_H_ -#include "../../../../lustre/include/lustre/lustre_idl.h" +#include "../../../uapi/linux/lustre/lustre_idl.h" /** returns fid object sequence */ static inline __u64 fid_seq(const struct lu_fid *fid) diff --git a/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fiemap.h similarity index 96% rename from drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_fiemap.h index b8ad555..f5214dc3 100644 --- a/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fiemap.h @@ -29,8 +29,6 @@ * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * lustre/include/lustre/ll_fiemap.h - * * FIEMAP data structures and flags. This header file will be used until * fiemap.h is available in the upstream kernel. * @@ -41,10 +39,8 @@ #ifndef _LUSTRE_FIEMAP_H #define _LUSTRE_FIEMAP_H -#ifndef __KERNEL__ #include -#include -#endif +#include /* XXX: We use fiemap_extent::fe_reserved[0] */ #define fe_device fe_reserved[0] diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h similarity index 99% rename from drivers/staging/lustre/lustre/include/lustre/lustre_idl.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index fe443f8..b7c1a1e 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -29,8 +29,6 @@ * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * lustre/include/lustre/lustre_idl.h - * * Lustre wire protocol definitions. */ @@ -71,10 +69,10 @@ #include -#include "../../../include/uapi/linux/lnet/lnet-types.h" +#include "../lnet/lnet-types.h" /* Defn's shared with user-space. */ #include "lustre_user.h" -#include "../lustre_ver.h" +#include "lustre_ver.h" /* * GENERAL STUFF diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index c2c0b27..3060e4d 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -31,7 +31,7 @@ #include #include #include -#include "../../../../lustre/include/lustre/lustre_idl.h" +#include "../../../uapi/linux/lustre/lustre_idl.h" #if !defined(__KERNEL__) && !defined(LUSTRE_UTILS) # error This file is for Lustre internal use only. diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_kernelcomm.h similarity index 95% rename from drivers/staging/lustre/lustre/include/uapi_kernelcomm.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_kernelcomm.h index 5e99836..94dadbe 100644 --- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_kernelcomm.h @@ -34,8 +34,8 @@ * The definitions below are used in the kernel and userspace. */ -#ifndef __UAPI_KERNELCOMM_H__ -#define __UAPI_KERNELCOMM_H__ +#ifndef __UAPI_LUSTRE_KERNELCOMM_H__ +#define __UAPI_LUSTRE_KERNELCOMM_H__ #include @@ -91,4 +91,4 @@ struct lustre_kernelcomm { __u32 lk_flags; } __packed; -#endif /* __UAPI_KERNELCOMM_H__ */ +#endif /* __UAPI_LUSTRE_KERNELCOMM_H__ */ diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h index fe7c59f..9110229 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h @@ -36,7 +36,6 @@ #include #include "lustre_fid.h" -#include "../../../../lustre/include/lustre/lustre_idl.h" static inline __u64 lmm_oi_id(const struct ost_id *oi) { diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h similarity index 99% rename from drivers/staging/lustre/lustre/include/lustre/lustre_user.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h index bee93d0..ca720f1 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h @@ -55,7 +55,7 @@ # include # include #endif /* __KERNEL__ */ -#include "ll_fiemap.h" +#include "lustre_fiemap.h" /* * We need to always use 64bit version because the structure diff --git a/drivers/staging/lustre/lustre/include/lustre_ver.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ver.h similarity index 100% rename from drivers/staging/lustre/lustre/include/lustre_ver.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_ver.h diff --git a/drivers/staging/lustre/lustre/fid/fid_internal.h b/drivers/staging/lustre/lustre/fid/fid_internal.h index 5c53773..5f8d15b 100644 --- a/drivers/staging/lustre/lustre/fid/fid_internal.h +++ b/drivers/staging/lustre/lustre/fid/fid_internal.h @@ -36,7 +36,7 @@ #ifndef __FID_INTERNAL_H #define __FID_INTERNAL_H -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" /* Functions used internally in module. */ diff --git a/drivers/staging/lustre/lustre/fid/fid_lib.c b/drivers/staging/lustre/lustre/fid/fid_lib.c index 9eb4059..6ab06ef 100644 --- a/drivers/staging/lustre/lustre/fid/fid_lib.c +++ b/drivers/staging/lustre/lustre/fid/fid_lib.c @@ -41,7 +41,6 @@ #include "../../include/linux/libcfs/libcfs.h" #include -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_fid.h" /** diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c index adaa094..68d009b 100644 --- a/drivers/staging/lustre/lustre/fld/fld_cache.c +++ b/drivers/staging/lustre/lustre/fld/fld_cache.c @@ -45,7 +45,7 @@ #include "../include/obd.h" #include "../include/obd_class.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/obd_support.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h b/drivers/staging/lustre/lustre/fld/fld_internal.h index 4a7f0b7..3412c90 100644 --- a/drivers/staging/lustre/lustre/fld/fld_internal.h +++ b/drivers/staging/lustre/lustre/fld/fld_internal.h @@ -56,7 +56,7 @@ #ifndef __FLD_INTERNAL_H #define __FLD_INTERNAL_H -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" #include "../include/lustre_req_layout.h" diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c index 4cade7a..1282992 100644 --- a/drivers/staging/lustre/lustre/fld/fld_request.c +++ b/drivers/staging/lustre/lustre/fld/fld_request.c @@ -44,7 +44,7 @@ #include "../include/obd.h" #include "../include/obd_class.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/obd_support.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/include/llog_swab.h b/drivers/staging/lustre/lustre/include/llog_swab.h index fd7ffb1..25516d3 100644 --- a/drivers/staging/lustre/lustre/include/llog_swab.h +++ b/drivers/staging/lustre/lustre/include/llog_swab.h @@ -48,7 +48,8 @@ #ifndef _LLOG_SWAB_H_ #define _LLOG_SWAB_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" + struct lustre_cfg; void lustre_swab_lu_fid(struct lu_fid *fid); diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 694062a..f5abca8 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -45,7 +45,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/uapi/linux/lustre/lustre_cfg.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" struct lprocfs_vars { const char *name; diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index 2e70602..ea77d9c 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -36,7 +36,7 @@ #include #include #include "../../include/linux/libcfs/libcfs.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lu_ref.h" struct seq_file; diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_errno.h b/drivers/staging/lustre/lustre/include/lustre_errno.h similarity index 100% rename from drivers/staging/lustre/lustre/include/lustre/lustre_errno.h rename to drivers/staging/lustre/lustre/include/lustre_errno.h diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 6e7cc46..3502d15 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -43,7 +43,7 @@ */ #include "lprocfs_status.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lustre_dlm.h" enum obd_option { diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 7c51642..8998a34 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -150,7 +150,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/uapi/linux/lustre/lustre_fid.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/uapi/linux/lustre/lustre_ostid.h" struct lu_env; diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index f3c61d1..e335d88 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -38,7 +38,7 @@ * @{ */ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/linux/libcfs/libcfs.h" #include "seq_range.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index f0c931c..0b54e28 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -44,7 +44,7 @@ */ #include "lustre_handles.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * Adaptive Timeout stuff diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h index 970610b..c06648f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h @@ -38,7 +38,7 @@ #define __LUSTRE_KERNELCOMM_H__ /* For declarations shared with userspace */ -#include "uapi_kernelcomm.h" +#include "../../include/uapi/linux/lustre/lustre_kernelcomm.h" /* prototype for callback function on kuc groups */ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index c68dd5d..a7a184f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -46,8 +46,8 @@ #include #include #include "../../include/linux/libcfs/libcfs.h" -#include "lustre/lustre_idl.h" -#include "lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../../include/uapi/linux/lustre/lustre_cfg.h" /* target.c */ diff --git a/drivers/staging/lustre/lustre/include/lustre_lmv.h b/drivers/staging/lustre/lustre/include/lustre_lmv.h index 5aa3645..f2b8574 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lmv.h +++ b/drivers/staging/lustre/lustre/include/lustre_lmv.h @@ -32,7 +32,7 @@ #ifndef _LUSTRE_LMV_H #define _LUSTRE_LMV_H -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" struct lmv_oinfo { struct lu_fid lmo_fid; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 35e37eb..70fdc0b 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -53,7 +53,7 @@ */ #include "obd_class.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #define LOG_NAME_LIMIT(logname, name) \ snprintf(logname, sizeof(logname), "LOGS/%s", name) diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h index 198ceb0..99abbde 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mdc.h +++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h @@ -50,7 +50,6 @@ #include "lustre_handles.h" #include "../../include/linux/libcfs/libcfs.h" #include "obd_class.h" -#include "lustre/lustre_idl.h" #include "lustre_lib.h" #include "lustre_dlm.h" #include "lustre_export.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_mds.h b/drivers/staging/lustre/lustre/include/lustre_mds.h index 23a7e4f..2a552ee 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mds.h +++ b/drivers/staging/lustre/lustre/include/lustre_mds.h @@ -45,7 +45,6 @@ #include "lustre_handles.h" #include "../../include/linux/libcfs/libcfs.h" -#include "lustre/lustre_idl.h" #include "lustre_lib.h" #include "lustre_dlm.h" #include "lustre_export.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index c0b5927..bc18131 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -54,7 +54,8 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/uapi/linux/lnet/nidstr.h" #include "../../include/linux/lnet/api.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include "lustre_errno.h" #include "lustre_ha.h" #include "lustre_sec.h" #include "lustre_import.h" @@ -63,7 +64,7 @@ #include "lustre_req_layout.h" #include "obd_support.h" -#include "lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" /* MD flags we _always_ use */ #define PTLRPC_MD_OPTIONS 0 diff --git a/drivers/staging/lustre/lustre/include/lustre_obdo.h b/drivers/staging/lustre/lustre/include/lustre_obdo.h index 1e12f8c..252191d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_obdo.h +++ b/drivers/staging/lustre/lustre/include/lustre_obdo.h @@ -35,7 +35,7 @@ #ifndef _LUSTRE_OBDO_H_ #define _LUSTRE_OBDO_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * Create an obdo to send over the wire diff --git a/drivers/staging/lustre/lustre/include/lustre_swab.h b/drivers/staging/lustre/lustre/include/lustre_swab.h index 5c1bdc0..9e13afd 100644 --- a/drivers/staging/lustre/lustre/include/lustre_swab.h +++ b/drivers/staging/lustre/lustre/include/lustre_swab.h @@ -48,7 +48,7 @@ #ifndef _LUSTRE_SWAB_H_ #define _LUSTRE_SWAB_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); void lustre_swab_connect(struct obd_connect_data *ocd); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index 4dfc31e..aedc550 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -35,7 +35,7 @@ #include -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lustre_lib.h" #include "lu_ref.h" #include "lustre_export.h" diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h b/drivers/staging/lustre/lustre/include/obd_cksum.h index a8a81e6..54bde73 100644 --- a/drivers/staging/lustre/lustre/include/obd_cksum.h +++ b/drivers/staging/lustre/lustre/include/obd_cksum.h @@ -32,7 +32,7 @@ #define __OBD_CKSUM #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/libcfs/libcfs_crypto.h" -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type) { diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 7d98485..6ae6479 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -37,7 +37,6 @@ #include "lustre_net.h" #include "obd.h" #include "lustre_lib.h" -#include "lustre/lustre_idl.h" #include "lprocfs_status.h" #define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay diff --git a/drivers/staging/lustre/lustre/include/seq_range.h b/drivers/staging/lustre/lustre/include/seq_range.h index 30c4dd6..74a9c63 100644 --- a/drivers/staging/lustre/lustre/include/seq_range.h +++ b/drivers/staging/lustre/lustre/include/seq_range.h @@ -34,7 +34,7 @@ #ifndef _SEQ_RANGE_H_ #define _SEQ_RANGE_H_ -#include "lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * computes the sequence range type \a range diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index b8002e9..5e04f05 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -57,8 +57,7 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre/lustre_errno.h" - +#include "../include/lustre_errno.h" #include "../include/lustre_dlm.h" #include "../include/obd_class.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index d20425f..d38cb33 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include "../include/obd_support.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_dlm.h" #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 71d1878..adffc29 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -42,7 +42,7 @@ #include #include #include -#include "../include/lustre/ll_fiemap.h" +#include "../../include/uapi/linux/lustre/lustre_fiemap.h" #include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/lustre_swab.h" diff --git a/drivers/staging/lustre/lustre/llite/lcommon_cl.c b/drivers/staging/lustre/lustre/llite/lcommon_cl.c index 96515b8..75e4b35 100644 --- a/drivers/staging/lustre/lustre/llite/lcommon_cl.c +++ b/drivers/staging/lustre/lustre/llite/lcommon_cl.c @@ -50,7 +50,6 @@ #include "../include/obd_support.h" #include "../include/lustre_fid.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "../include/lustre_mdc.h" #include "../include/cl_object.h" diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index cd3311a..a7f0d51 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -33,7 +33,7 @@ #ifndef LLITE_INTERNAL_H #define LLITE_INTERNAL_H #include "../include/lustre_debug.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/lustre_disk.h" /* for s2sbi */ #include "../include/lustre_linkea.h" diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 293a318..4a5b965 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -43,7 +43,6 @@ #include "../include/obd_support.h" #include "../include/lustre_fid.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "llite_internal.h" static int ll_create_it(struct inode *dir, struct dentry *dentry, diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c b/drivers/staging/lustre/lustre/llite/range_lock.c index 161391b..3f232cd 100644 --- a/drivers/staging/lustre/lustre/llite/range_lock.c +++ b/drivers/staging/lustre/lustre/llite/range_lock.c @@ -34,7 +34,7 @@ * Author: Bobi Jam */ #include "range_lock.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /** * Initialize a range lock tree diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h index f40fd7f..53ff46c 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_internal.h +++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h @@ -37,7 +37,7 @@ #ifndef VVP_INTERNAL_H #define VVP_INTERNAL_H -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/cl_object.h" enum obd_notify_event; diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index d0cad7e..48bad7d 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -40,7 +40,6 @@ #include "../include/obd_support.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c index 82cf421..fa11dd5 100644 --- a/drivers/staging/lustre/lustre/llite/xattr_cache.c +++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c @@ -14,7 +14,6 @@ #include #include "../include/obd_support.h" #include "../include/lustre_dlm.h" -#include "../include/lustre_ver.h" #include "llite_internal.h" /* If we ever have hundreds of extended attributes, we might want to consider diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c b/drivers/staging/lustre/lustre/lmv/lmv_fld.c index 6f8070f..1a7dd15 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c @@ -38,7 +38,6 @@ #include #include "../include/obd_support.h" -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_fid.h" #include "../include/lustre_lib.h" #include "../include/lustre_net.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index 5f01a0c..6b10bdd 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -39,7 +39,6 @@ #include #include "../include/lustre_intent.h" #include "../include/obd_support.h" -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_lib.h" #include "../include/lustre_net.h" #include "../include/lustre_dlm.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h index e839b83..ad109c0 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h +++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h @@ -33,7 +33,7 @@ #ifndef _LMV_INTERNAL_H_ #define _LMV_INTERNAL_H_ -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/obd.h" #include "../include/lustre_lmv.h" diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index ab77dbe..f17221f 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -41,7 +41,6 @@ #include #include -#include "../include/lustre/lustre_idl.h" #include "../include/obd_support.h" #include "../include/lustre_net.h" #include "../include/obd_class.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index 2a8fee8..530a4e9 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -40,7 +40,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index 9905df2..4d9437e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -34,7 +34,7 @@ #define LOV_INTERNAL_H #include "../include/obd_class.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" /* * If we are unable to get the maximum object size from the OST in diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 475bf7e..953ed71 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -40,7 +40,7 @@ #define DEBUG_SUBSYSTEM S_LOV #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../include/cl_object.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 638b764..fd346c5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -38,9 +38,6 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../include/lustre/lustre_idl.h" -#include "../include/lustre/lustre_user.h" - #include "../include/lustre_net.h" #include "../include/lustre_swab.h" #include "../include/obd.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index 70636e5..74aeb94 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -35,7 +35,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "lov_internal.h" static void lov_init_set(struct lov_request_set *set) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index aabdcec..bfd8fbe 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -32,7 +32,7 @@ #define DEBUG_SUBSYSTEM S_MDC #include "../include/lustre_net.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "mdc_internal.h" static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 4dcf3902..3556307 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -38,8 +38,7 @@ # include # include -#include "../include/lustre/lustre_errno.h" - +#include "../include/lustre_errno.h" #include "../include/cl_object.h" #include "../include/llog_swab.h" #include "../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/mgc/mgc_internal.h b/drivers/staging/lustre/lustre/mgc/mgc_internal.h index f146f75..8cb6758 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_internal.h +++ b/drivers/staging/lustre/lustre/mgc/mgc_internal.h @@ -34,7 +34,6 @@ #define _MGC_INTERNAL_H #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/lustre_idl.h" #include "../include/lustre_lib.h" #include "../include/lustre_dlm.h" #include "../include/lustre_log.h" diff --git a/drivers/staging/lustre/lustre/obdclass/linkea.c b/drivers/staging/lustre/lustre/obdclass/linkea.c index cf3ad04..d3e754a 100644 --- a/drivers/staging/lustre/lustre/obdclass/linkea.c +++ b/drivers/staging/lustre/lustre/obdclass/linkea.c @@ -26,7 +26,7 @@ * Author: Di Wang */ -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/obd.h" #include "../include/lustre_linkea.h" diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 1b5beea..b2f5597 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -66,7 +66,7 @@ #include "../../include/obd_class.h" #include "../../include/lprocfs_status.h" #include "../../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../../include/lustre_ver.h" +#include "../../../include/uapi/linux/lustre/lustre_ver.h" static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) { diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index ba41983..b56a343 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -38,7 +38,7 @@ #include "../include/obd_class.h" #include "../include/lprocfs_status.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include #include diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 5094829..4e609b5 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -43,7 +43,7 @@ #include "../include/obd.h" #include "../include/lustre_compat.h" #include "../include/obd_class.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_log.h" #include "../include/lustre_disk.h" #include "../../include/uapi/linux/lustre/lustre_param.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c index b1dfa16..be61460 100644 --- a/drivers/staging/lustre/lustre/obdclass/obdo.c +++ b/drivers/staging/lustre/lustre/obdclass/obdo.c @@ -39,7 +39,7 @@ #define DEBUG_SUBSYSTEM S_CLASS #include "../include/obd_class.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_obdo.h" void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent) diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 453a59a..af96ac5 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -36,7 +36,7 @@ #include "../include/lustre_dlm.h" #include "../include/lustre_net.h" -#include "../include/lustre/lustre_user.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/obd_cksum.h" #include "../include/lustre_ha.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/errno.c b/drivers/staging/lustre/lustre/ptlrpc/errno.c index 73f8374..faad8d8 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/errno.c +++ b/drivers/staging/lustre/lustre/ptlrpc/errno.c @@ -26,7 +26,7 @@ */ #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/lustre_errno.h" +#include "../include/lustre_errno.h" /* * The two translation tables below must define a one-to-one mapping between diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 5810bba..6624c02 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -46,12 +46,12 @@ #include -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/llog_swab.h" #include "../include/lustre_debug.h" #include "../include/lustre_swab.h" -#include "../include/lustre_ver.h" +#include "../../include/uapi/linux/lustre/lustre_ver.h" #include "../include/obd.h" #include "../include/obd_support.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index c429613..ad2703b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -34,7 +34,7 @@ #include "../include/obd_support.h" #include "../include/obd.h" #include "../include/lprocfs_status.h" -#include "../include/lustre/lustre_idl.h" +#include "../../include/uapi/linux/lustre/lustre_idl.h" #include "../include/lustre_net.h" #include "../include/obd_class.h" #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index f116995..5d68fa9 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -42,7 +42,7 @@ #include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre/ll_fiemap.h" +#include "../../include/uapi/linux/lustre/lustre_fiemap.h" #include "../include/llog_swab.h" #include "../include/lustre_net.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:25:56 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:25:56 -0400 Subject: [lustre-devel] [PATCH 02/64 v2] staging: lustre: uapi: remove unused functions for lustre_fid.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-3-git-send-email-jsimmons@infradead.org> The inline function fid_is_namespace_visible and ost_fid_from_resid are only used for server code so we can remove it. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_fid.h | 29 ---------------------- 1 file changed, 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 6dc24a7..681f698 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -288,18 +288,6 @@ static inline int fid_is_quota(const struct lu_fid *fid) fid_seq(fid) == FID_SEQ_QUOTA_GLB; } -static inline int fid_is_namespace_visible(const struct lu_fid *fid) -{ - const __u64 seq = fid_seq(fid); - - /* Here, we cannot distinguish whether the normal FID is for OST - * object or not. It is caller's duty to check more if needed. - */ - return (!fid_is_last_id(fid) && - (fid_seq_is_norm(seq) || fid_seq_is_igif(seq))) || - fid_is_root(fid) || fid_is_dot_lustre(fid); -} - static inline int fid_seq_in_fldb(__u64 seq) { return fid_seq_is_igif(seq) || fid_seq_is_norm(seq) || @@ -522,23 +510,6 @@ static inline void ost_fid_build_resid(const struct lu_fid *fid, } } -static inline void ost_fid_from_resid(struct lu_fid *fid, - const struct ldlm_res_id *name, - int ost_idx) -{ - if (fid_seq_is_mdt0(name->name[LUSTRE_RES_ID_VER_OID_OFF])) { - /* old resid */ - struct ost_id oi; - - ostid_set_seq(&oi, name->name[LUSTRE_RES_ID_VER_OID_OFF]); - ostid_set_id(&oi, name->name[LUSTRE_RES_ID_SEQ_OFF]); - ostid_to_fid(fid, &oi, ost_idx); - } else { - /* new resid */ - fid_extract_from_res_name(fid, name); - } -} - /** * Flatten 128-bit FID values into a 64-bit value for use as an inode number. * For non-IGIF FIDs this starts just over 2^32, and continues without -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:33 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:33 -0400 Subject: [lustre-devel] [PATCH 39/64 v2] staging: lustre: lnet: remove BIT macro from lnetctl.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-40-git-send-email-jsimmons@infradead.org> Now that lnetctl.h is a UAPI header the BIT macro has to be removed. Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index 65b2bf8..f7ffc53 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -32,10 +32,10 @@ enum { LNET_CTL_DELAY_LIST, }; -#define LNET_ACK_BIT BIT(0) -#define LNET_PUT_BIT BIT(1) -#define LNET_GET_BIT BIT(2) -#define LNET_REPLY_BIT BIT(3) +#define LNET_ACK_BIT (1 << 0) +#define LNET_PUT_BIT (1 << 1) +#define LNET_GET_BIT (1 << 2) +#define LNET_REPLY_BIT (1 << 3) /** ioctl parameter for LNet fault simulation */ struct lnet_fault_attr { -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:19 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:19 -0400 Subject: [lustre-devel] [PATCH 25/64 v2] staging: lustre: uapi: move lustre_cfg.h to uapi directory In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-26-git-send-email-jsimmons@infradead.org> Move lustre_cfg.h to its proper place. Adjust additonal headers included in lustre_cfg.h. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../{lustre/include => include/uapi/linux/lustre}/lustre_cfg.h | 6 ++---- drivers/staging/lustre/lustre/include/lprocfs_status.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) rename drivers/staging/lustre/{lustre/include => include/uapi/linux/lustre}/lustre_cfg.h (99%) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h similarity index 99% rename from drivers/staging/lustre/lustre/include/lustre_cfg.h rename to drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 21a48b1..a762aab 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -33,6 +33,8 @@ #ifndef _LUSTRE_CFG_H #define _LUSTRE_CFG_H +#include "../../../../lustre/include/lustre/lustre_user.h" + /** \defgroup cfg cfg * * @{ @@ -191,8 +193,6 @@ static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) return cfs_size_round(len); } -#include "obd_support.h" - static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, struct lustre_cfg_bufs *bufs) { @@ -238,8 +238,6 @@ static inline int lustre_cfg_sanity_check(void *buf, size_t len) return 0; } -#include "lustre/lustre_user.h" - /** @} cfg */ #endif /* _LUSTRE_CFG_H */ diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 9054d37..694062a 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -44,7 +44,7 @@ #include #include "../../include/linux/libcfs/libcfs.h" -#include "lustre_cfg.h" +#include "../../include/uapi/linux/lustre/lustre_cfg.h" #include "lustre/lustre_idl.h" struct lprocfs_vars { diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index f24970d..c68dd5d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -48,7 +48,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "lustre/lustre_idl.h" #include "lustre_ver.h" -#include "lustre_cfg.h" +#include "../../include/uapi/linux/lustre/lustre_cfg.h" /* target.c */ struct ptlrpc_request; -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:20 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:20 -0400 Subject: [lustre-devel] [PATCH 26/64 v2] staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-27-git-send-email-jsimmons@infradead.org> Several libcfs.h macros are present in lustre_cfg.h, but libcfs.h is not available so lets replace those macros with real code. The header libcfs.h also provides errno.h so with libcfs.h gone include errno.h directly. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index a762aab..a45d167 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -33,6 +33,8 @@ #ifndef _LUSTRE_CFG_H #define _LUSTRE_CFG_H +#include +#include #include "../../../../lustre/include/lustre/lustre_user.h" /** \defgroup cfg cfg @@ -48,7 +50,7 @@ #define LUSTRE_CFG_MAX_BUFCOUNT 8 #define LCFG_HDR_SIZE(count) \ - cfs_size_round(offsetof(struct lustre_cfg, lcfg_buflens[(count)])) + __ALIGN_KERNEL(offsetof(struct lustre_cfg, lcfg_buflens[(count)]), 8) /** If the LCFG_REQUIRED bit is set in a configuration command, * then the client is required to understand this parameter @@ -165,7 +167,7 @@ static inline void *lustre_cfg_buf(struct lustre_cfg *lcfg, __u32 index) offset = LCFG_HDR_SIZE(lcfg->lcfg_bufcount); for (i = 0; i < index; i++) - offset += cfs_size_round(lcfg->lcfg_buflens[i]); + offset += __ALIGN_KERNEL(lcfg->lcfg_buflens[i], 8); return (char *)lcfg + offset; } @@ -188,9 +190,9 @@ static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) len = LCFG_HDR_SIZE(bufcount); for (i = 0; i < bufcount; i++) - len += cfs_size_round(buflens[i]); + len += __ALIGN_KERNEL(buflens[i], 8); - return cfs_size_round(len); + return __ALIGN_KERNEL(len, 8); } static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, @@ -206,7 +208,10 @@ static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, ptr = (char *)lcfg + LCFG_HDR_SIZE(lcfg->lcfg_bufcount); for (i = 0; i < lcfg->lcfg_bufcount; i++) { lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i]; - LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr); + if (bufs->lcfg_buf[i]) { + memcpy(ptr, bufs->lcfg_buf[i], bufs->lcfg_buflen[i]); + ptr += __ALIGN_KERNEL(bufs->lcfg_buflen[i], 8); + } } } -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:21 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:21 -0400 Subject: [lustre-devel] [PATCH 27/64 v2] staging: lustre: uapi: change variable type to match In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-28-git-send-email-jsimmons@infradead.org> Change i from int to __u32 to match lcfg_bufcount field. Also this matches what the other functions also do. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index a45d167..4d23938 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -199,7 +199,7 @@ static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, struct lustre_cfg_bufs *bufs) { char *ptr; - int i; + __u32 i; lcfg->lcfg_version = LUSTRE_CFG_VERSION; lcfg->lcfg_command = cmd; -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:32 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:32 -0400 Subject: [lustre-devel] [PATCH 38/64 v2] staging: lustre: lnet: remove userland function prototype in lnetctl.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-39-git-send-email-jsimmons@infradead.org> Several function prototypes of the form jt_ptl_* are only needed by userland so they can be removed. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: http://review.whamcloud.com/17643 Reviewed-by: Bob Glossman Reviewed-by: John L. Hammond Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lnet/lnetctl.h | 41 ---------------------- 1 file changed, 41 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index 2ce1c50..65b2bf8 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -131,45 +131,4 @@ struct lnet_fault_stat { #define SMFS_DEV_MAJOR 10 #define SMFS_DEV_MINOR 242 -int ptl_initialize(int argc, char **argv); -int jt_ptl_network(int argc, char **argv); -int jt_ptl_list_nids(int argc, char **argv); -int jt_ptl_which_nid(int argc, char **argv); -int jt_ptl_print_interfaces(int argc, char **argv); -int jt_ptl_add_interface(int argc, char **argv); -int jt_ptl_del_interface(int argc, char **argv); -int jt_ptl_print_peers(int argc, char **argv); -int jt_ptl_add_peer(int argc, char **argv); -int jt_ptl_del_peer(int argc, char **argv); -int jt_ptl_print_connections(int argc, char **argv); -int jt_ptl_disconnect(int argc, char **argv); -int jt_ptl_push_connection(int argc, char **argv); -int jt_ptl_print_active_txs(int argc, char **argv); -int jt_ptl_ping(int argc, char **argv); -int jt_ptl_mynid(int argc, char **argv); -int jt_ptl_add_uuid(int argc, char **argv); -int jt_ptl_add_uuid_old(int argc, char **argv); /* backwards compatibility */ -int jt_ptl_close_uuid(int argc, char **argv); -int jt_ptl_del_uuid(int argc, char **argv); -int jt_ptl_add_route(int argc, char **argv); -int jt_ptl_del_route(int argc, char **argv); -int jt_ptl_notify_router(int argc, char **argv); -int jt_ptl_print_routes(int argc, char **argv); -int jt_ptl_fail_nid(int argc, char **argv); -int jt_ptl_lwt(int argc, char **argv); -int jt_ptl_testprotocompat(int argc, char **argv); -int jt_ptl_memhog(int argc, char **argv); - -int dbg_initialize(int argc, char **argv); -int jt_dbg_filter(int argc, char **argv); -int jt_dbg_show(int argc, char **argv); -int jt_dbg_list(int argc, char **argv); -int jt_dbg_debug_kernel(int argc, char **argv); -int jt_dbg_debug_daemon(int argc, char **argv); -int jt_dbg_debug_file(int argc, char **argv); -int jt_dbg_clear_debug_buf(int argc, char **argv); -int jt_dbg_mark_debug_buf(int argc, char **argv); -int jt_dbg_modules(int argc, char **argv); -int jt_dbg_panic(int argc, char **argv); - #endif -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:40 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:40 -0400 Subject: [lustre-devel] [PATCH 46/64 v2] staging: lustre: fld: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-47-git-send-email-jsimmons@infradead.org> Rationalize include paths in the fld source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/fld/Makefile | 3 +++ drivers/staging/lustre/lustre/fld/fld_cache.c | 16 ++++++++-------- drivers/staging/lustre/lustre/fld/fld_internal.h | 8 ++++---- drivers/staging/lustre/lustre/fld/fld_request.c | 18 +++++++++--------- drivers/staging/lustre/lustre/fld/lproc_fld.c | 14 +++++++------- 5 files changed, 31 insertions(+), 28 deletions(-) diff --git a/drivers/staging/lustre/lustre/fld/Makefile b/drivers/staging/lustre/lustre/fld/Makefile index 646e315..426deba 100644 --- a/drivers/staging/lustre/lustre/fld/Makefile +++ b/drivers/staging/lustre/lustre/fld/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/ + obj-$(CONFIG_LUSTRE_FS) += fld.o fld-y := fld_request.o fld_cache.o lproc_fld.o diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c index 68d009b..b723ece 100644 --- a/drivers/staging/lustre/lustre/fld/fld_cache.c +++ b/drivers/staging/lustre/lustre/fld/fld_cache.c @@ -39,18 +39,18 @@ #define DEBUG_SUBSYSTEM S_FLD -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/obd_support.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" +#include +#include #include "fld_internal.h" /** diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h b/drivers/staging/lustre/lustre/fld/fld_internal.h index 3412c90..fe6f278 100644 --- a/drivers/staging/lustre/lustre/fld/fld_internal.h +++ b/drivers/staging/lustre/lustre/fld/fld_internal.h @@ -56,11 +56,11 @@ #ifndef __FLD_INTERNAL_H #define __FLD_INTERNAL_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" +#include +#include +#include struct fld_stats { __u64 fst_count; diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c index 1282992..5b18083 100644 --- a/drivers/staging/lustre/lustre/fld/fld_request.c +++ b/drivers/staging/lustre/lustre/fld/fld_request.c @@ -38,19 +38,19 @@ #define DEBUG_SUBSYSTEM S_FLD -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/obd_support.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" -#include "../include/lustre_mdc.h" +#include +#include +#include #include "fld_internal.h" static int fld_rrb_hash(struct lu_client_fld *fld, u64 seq) diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c b/drivers/staging/lustre/lustre/fld/lproc_fld.c index b83d7eb..6cae803 100644 --- a/drivers/staging/lustre/lustre/fld/lproc_fld.c +++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c @@ -39,15 +39,15 @@ #define DEBUG_SUBSYSTEM S_FLD -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fld.h" -#include "../include/lustre_fid.h" +#include +#include +#include +#include +#include +#include #include "fld_internal.h" static int -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:47 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:47 -0400 Subject: [lustre-devel] [PATCH 53/64 v2] staging: lustre: obdclass: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-54-git-send-email-jsimmons@infradead.org> Rationalize include paths in the obdclass source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdclass/Makefile | 3 +++ drivers/staging/lustre/lustre/obdclass/cl_io.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/cl_object.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/cl_page.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/class_obd.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/debug.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/genops.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/kernelcomm.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/linkea.c | 6 +++--- .../lustre/lustre/obdclass/linux/linux-module.c | 14 +++++++------- .../lustre/lustre/obdclass/linux/linux-sysctl.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/llog.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 2 +- .../staging/lustre/lustre/obdclass/llog_internal.h | 2 +- drivers/staging/lustre/lustre/obdclass/llog_obd.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/llog_swab.c | 4 ++-- .../lustre/lustre/obdclass/lprocfs_counters.c | 4 ++-- .../staging/lustre/lustre/obdclass/lprocfs_status.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/lu_object.c | 20 ++++++++++---------- drivers/staging/lustre/lustre/obdclass/lu_ref.c | 10 +++++----- .../staging/lustre/lustre/obdclass/lustre_handles.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/lustre_peer.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/obd_config.c | 12 ++++++------ drivers/staging/lustre/lustre/obdclass/obd_mount.c | 14 +++++++------- drivers/staging/lustre/lustre/obdclass/obdo.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/statfs_pack.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/uuid.c | 6 +++--- 28 files changed, 112 insertions(+), 109 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile b/drivers/staging/lustre/lustre/obdclass/Makefile index af570c0..fa0ad654 100644 --- a/drivers/staging/lustre/lustre/obdclass/Makefile +++ b/drivers/staging/lustre/lustre/obdclass/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += obdclass.o obdclass-y := linux/linux-module.o linux/linux-sysctl.o \ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c index ee7d677..2a70e21 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c @@ -37,12 +37,12 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include #include #include -#include "../include/cl_object.h" +#include #include "cl_internal.h" /***************************************************************************** diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c index a343e3a..20e6405 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c @@ -37,11 +37,11 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include #include -#include "../include/cl_object.h" +#include #include "cl_internal.h" static void cl_lock_trace0(int level, const struct lu_env *env, diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c index 08e55d4..95c7fa3 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c @@ -46,15 +46,15 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include /* class_put_type() */ -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include #include -#include "../../include/linux/libcfs/libcfs_hash.h" /* for cfs_hash stuff */ -#include "../include/cl_object.h" -#include "../include/lu_object.h" +#include /* for cfs_hash stuff */ +#include +#include #include "cl_internal.h" static struct kmem_cache *cl_env_kmem; diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c index 6b8c41b..3dc084c 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c @@ -37,12 +37,12 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include +#include +#include #include -#include "../include/cl_object.h" +#include #include "cl_internal.h" static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg); diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index dedad65..57c84e8 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -33,14 +33,14 @@ #define DEBUG_SUBSYSTEM S_CLASS # include -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lnet/lnetctl.h" -#include "../include/lustre_debug.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include #include -#include "../include/cl_object.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" +#include +#include #include "llog_internal.h" struct obd_device *obd_devs[MAX_OBD_DEVICES]; diff --git a/drivers/staging/lustre/lustre/obdclass/debug.c b/drivers/staging/lustre/lustre/obdclass/debug.c index 0bd4ad2..7964cad 100644 --- a/drivers/staging/lustre/lustre/obdclass/debug.c +++ b/drivers/staging/lustre/lustre/obdclass/debug.c @@ -38,9 +38,9 @@ #include -#include "../include/obd_support.h" -#include "../include/lustre_debug.h" -#include "../include/lustre_net.h" +#include +#include +#include #define LPDS sizeof(__u64) int block_debug_setup(void *addr, int len, __u64 off, __u64 id) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index fa0d38d..739bfb9 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -36,9 +36,9 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_kernelcomm.h" +#include +#include +#include spinlock_t obd_types_lock; diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index a0f65c4..8f0707a 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #define D_KUC D_OTHER -#include "../include/obd_support.h" -#include "../include/lustre_kernelcomm.h" +#include +#include /** * libcfs_kkuc_msg_put - send an message from kernel to userspace diff --git a/drivers/staging/lustre/lustre/obdclass/linkea.c b/drivers/staging/lustre/lustre/obdclass/linkea.c index d3e754a..9af86d3 100644 --- a/drivers/staging/lustre/lustre/obdclass/linkea.c +++ b/drivers/staging/lustre/lustre/obdclass/linkea.c @@ -26,9 +26,9 @@ * Author: Di Wang */ -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/obd.h" -#include "../include/lustre_linkea.h" +#include +#include +#include int linkea_data_new(struct linkea_data *ldata, struct lu_buf *buf) { diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 94af257..6df9111 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -60,13 +60,13 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/uapi/linux/lnet/lnetctl.h" -#include "../../include/obd_support.h" -#include "../../include/obd_class.h" -#include "../../include/lprocfs_status.h" -#include "../../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../../../include/uapi/linux/lustre/lustre_ver.h" +#include +#include +#include +#include +#include +#include +#include #define OBD_MAX_IOCTL_BUFFER 8192 diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c index 814334b..e92cccc 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c @@ -43,9 +43,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/obd_support.h" -#include "../../include/lprocfs_status.h" -#include "../../include/obd_class.h" +#include +#include +#include struct static_lustre_uintvalue_attr { struct { diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 736ea10..98021a2 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -43,9 +43,9 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/llog_swab.h" -#include "../include/lustre_log.h" -#include "../include/obd_class.h" +#include +#include +#include #include "llog_internal.h" /* diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c index 8f1533c..8fa9691 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c @@ -44,7 +44,7 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/obd_class.h" +#include #include "llog_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/llog_internal.h b/drivers/staging/lustre/lustre/obdclass/llog_internal.h index 21a93c7..8de90bc 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_internal.h +++ b/drivers/staging/lustre/lustre/obdclass/llog_internal.h @@ -33,7 +33,7 @@ #ifndef __LLOG_INTERNAL_H__ #define __LLOG_INTERNAL_H__ -#include "../include/lustre_log.h" +#include struct llog_process_info { struct llog_handle *lpi_loghandle; diff --git a/drivers/staging/lustre/lustre/obdclass/llog_obd.c b/drivers/staging/lustre/lustre/obdclass/llog_obd.c index 8574ad4..3c42de9 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_obd.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/obd_class.h" -#include "../include/lustre_log.h" +#include +#include #include "llog_internal.h" /* helper functions for calling the llog obd methods */ diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c index 016046d..d2d3114 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../include/llog_swab.h" -#include "../include/lustre_log.h" +#include +#include static void print_llogd_body(struct llogd_body *d) { diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c index 13aca5b..e482988 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c @@ -38,8 +38,8 @@ */ #include -#include "../include/lprocfs_status.h" -#include "../include/obd_support.h" +#include +#include void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount) { diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index b56a343..e79485b 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include +#include #include #include diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index bb9d514..304e987 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -40,19 +40,19 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include -# include +#include /* hash_long() */ -#include "../../include/linux/libcfs/libcfs_hash.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_disk.h" -#include "../include/lustre_fid.h" -#include "../include/lu_object.h" -#include "../include/cl_object.h" -#include "../include/lu_ref.h" +#include +#include +#include +#include +#include +#include +#include +#include #include enum { diff --git a/drivers/staging/lustre/lustre/obdclass/lu_ref.c b/drivers/staging/lustre/lustre/obdclass/lu_ref.c index e9f6040..fa690b2 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_ref.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_ref.c @@ -38,9 +38,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lu_ref.h" +#include +#include +#include +#include diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c index c9445e5..e1273c9 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_support.h" -#include "../include/lustre_handles.h" -#include "../include/lustre_lib.h" +#include +#include +#include static __u64 handle_base; #define HANDLE_INCR 7 diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c index ffa740a..2798d35 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c @@ -32,13 +32,13 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_net.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include +#include +#include #define NIDS_MAX 32 diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 32ffa25..94a940f 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -38,12 +38,12 @@ #include -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/llog_swab.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_log.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "llog_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 4e609b5..1256034 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -40,13 +40,13 @@ #define D_MOUNT (D_SUPER | D_CONFIG/*|D_WARNING */) #define PRINT_CMD CDEBUG -#include "../include/obd.h" -#include "../include/lustre_compat.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_log.h" -#include "../include/lustre_disk.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" +#include +#include +#include +#include +#include +#include +#include static int (*client_fill_super)(struct super_block *sb, struct vfsmount *mnt); diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c index be61460..7083f87 100644 --- a/drivers/staging/lustre/lustre/obdclass/obdo.c +++ b/drivers/staging/lustre/lustre/obdclass/obdo.c @@ -38,9 +38,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_obdo.h" +#include +#include +#include void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent) { diff --git a/drivers/staging/lustre/lustre/obdclass/statfs_pack.c b/drivers/staging/lustre/lustre/obdclass/statfs_pack.c index 4bad1fa..89abea2 100644 --- a/drivers/staging/lustre/lustre/obdclass/statfs_pack.c +++ b/drivers/staging/lustre/lustre/obdclass/statfs_pack.c @@ -37,10 +37,10 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/lustre_export.h" -#include "../include/lustre_net.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include +#include +#include void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs) { diff --git a/drivers/staging/lustre/lustre/obdclass/uuid.c b/drivers/staging/lustre/lustre/obdclass/uuid.c index abd9b1a..9b1872b 100644 --- a/drivers/staging/lustre/lustre/obdclass/uuid.c +++ b/drivers/staging/lustre/lustre/obdclass/uuid.c @@ -34,10 +34,10 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out) { -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:22 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:22 -0400 Subject: [lustre-devel] [PATCH 28/64 v2] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-29-git-send-email-jsimmons@infradead.org> Check if lcfg passed in is NULL and if it is just return NULL. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 4d23938..4208d61 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -161,6 +161,9 @@ static inline void *lustre_cfg_buf(struct lustre_cfg *lcfg, __u32 index) size_t offset; __u32 bufcount; + if (!lcfg) + return NULL; + bufcount = lcfg->lcfg_bufcount; if (index >= bufcount) return NULL; -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:30 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:30 -0400 Subject: [lustre-devel] [PATCH 36/64 v2] staging: lustre: lnet: migrate headers to lnet uapi directory In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-37-git-send-email-jsimmons@infradead.org> Migrate the headers used by user land and kernel space to the libcfs/lnet uapi directory. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/linux/libcfs/libcfs.h | 2 +- drivers/staging/lustre/include/linux/lnet/api.h | 2 +- drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 8 ++++---- drivers/staging/lustre/include/linux/lnet/lib-types.h | 4 ++-- drivers/staging/lustre/include/linux/lnet/socklnd.h | 2 +- .../include/{linux/libcfs => uapi/linux/lnet}/libcfs_ioctl.h | 0 .../include/{linux/lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} | 4 ++-- .../include/{linux/lnet/types.h => uapi/linux/lnet/lnet-types.h} | 0 drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetctl.h | 2 +- drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetst.h | 0 drivers/staging/lustre/include/{ => uapi}/linux/lnet/nidstr.h | 2 +- drivers/staging/lustre/lnet/libcfs/module.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +- drivers/staging/lustre/lnet/lnet/module.c | 2 +- drivers/staging/lustre/lnet/lnet/net_fault.c | 2 +- drivers/staging/lustre/lnet/lnet/nidstrings.c | 2 +- drivers/staging/lustre/lnet/lnet/peer.c | 2 +- drivers/staging/lustre/lnet/selftest/conctl.c | 2 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 2 +- drivers/staging/lustre/lnet/selftest/console.h | 2 +- drivers/staging/lustre/lnet/selftest/rpc.h | 2 +- drivers/staging/lustre/lnet/selftest/selftest.h | 2 +- drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 3 +-- drivers/staging/lustre/lustre/include/lustre_disk.h | 1 - drivers/staging/lustre/lustre/include/lustre_net.h | 2 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 2 +- 28 files changed, 29 insertions(+), 31 deletions(-) rename drivers/staging/lustre/include/{linux/libcfs => uapi/linux/lnet}/libcfs_ioctl.h (100%) rename drivers/staging/lustre/include/{linux/lnet/lib-dlc.h => uapi/linux/lnet/lnet-dlc.h} (98%) rename drivers/staging/lustre/include/{linux/lnet/types.h => uapi/linux/lnet/lnet-types.h} (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetctl.h (99%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/lnetst.h (100%) rename drivers/staging/lustre/include/{ => uapi}/linux/lnet/nidstr.h (99%) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index cc2c0e9..71bb55e 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -77,7 +77,7 @@ #include "libcfs_debug.h" #include "libcfs_cpu.h" #include "libcfs_private.h" -#include "libcfs_ioctl.h" +#include "../../uapi/linux/lnet/libcfs_ioctl.h" #include "libcfs_prim.h" #include "libcfs_time.h" #include "libcfs_string.h" diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h index f4b6de2..01ae62e 100644 --- a/drivers/staging/lustre/include/linux/lnet/api.h +++ b/drivers/staging/lustre/include/linux/lnet/api.h @@ -44,7 +44,7 @@ * @{ */ -#include "../lnet/types.h" +#include "../../uapi/linux/lnet/lnet-types.h" /** \defgroup lnet_init_fini Initialization and cleanup * The LNet must be properly initialized before any LNet calls can be made. diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 9b923ec..bc55d57 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -38,10 +38,10 @@ #include "../libcfs/libcfs.h" #include "api.h" #include "lib-types.h" -#include "lib-dlc.h" -#include "types.h" -#include "lnetctl.h" -#include "nidstr.h" +#include "../../uapi/linux/lnet/lnet-dlc.h" +#include "../../uapi/linux/lnet/lnet-types.h" +#include "../../uapi/linux/lnet/lnetctl.h" +#include "../../uapi/linux/lnet/nidstr.h" extern struct lnet the_lnet; /* THE network */ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index ddb808e..94d3a53 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -40,8 +40,8 @@ #include #include -#include "types.h" -#include "lnetctl.h" +#include "../../uapi/linux/lnet/lnet-types.h" +#include "../../uapi/linux/lnet/lnetctl.h" /* Max payload size */ #define LNET_MAX_PAYLOAD CONFIG_LNET_MAX_PAYLOAD diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h index 27ce6ce..c24fe45 100644 --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h @@ -34,7 +34,7 @@ #ifndef __LNET_LNET_SOCKLND_H__ #define __LNET_LNET_SOCKLND_H__ -#include "types.h" +#include "../../uapi/linux/lnet/lnet-types.h" #include "../../uapi/linux/lnet/socklnd.h" struct ksock_hello_msg { diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_ioctl.h similarity index 100% rename from drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h rename to drivers/staging/lustre/include/uapi/linux/lnet/libcfs_ioctl.h diff --git a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h similarity index 98% rename from drivers/staging/lustre/include/linux/lnet/lib-dlc.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h index dfff170..a3821d9 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h @@ -29,8 +29,8 @@ #ifndef LNET_DLC_H #define LNET_DLC_H -#include "../libcfs/libcfs_ioctl.h" -#include "types.h" +#include "libcfs_ioctl.h" +#include "lnet-types.h" #define MAX_NUM_SHOW_ENTRIES 32 #define LNET_MAX_STR_LEN 128 diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h similarity index 100% rename from drivers/staging/lustre/include/linux/lnet/types.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h diff --git a/drivers/staging/lustre/include/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h similarity index 99% rename from drivers/staging/lustre/include/linux/lnet/lnetctl.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index 3957507..2ce1c50 100644 --- a/drivers/staging/lustre/include/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -15,7 +15,7 @@ #ifndef _LNETCTL_H_ #define _LNETCTL_H_ -#include "types.h" +#include "lnet-types.h" /** \addtogroup lnet_fault_simulation * @{ diff --git a/drivers/staging/lustre/include/linux/lnet/lnetst.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetst.h similarity index 100% rename from drivers/staging/lustre/include/linux/lnet/lnetst.h rename to drivers/staging/lustre/include/uapi/linux/lnet/lnetst.h diff --git a/drivers/staging/lustre/include/linux/lnet/nidstr.h b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h similarity index 99% rename from drivers/staging/lustre/include/linux/lnet/nidstr.h rename to drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h index ecdd0db..d153c97 100644 --- a/drivers/staging/lustre/include/linux/lnet/nidstr.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h @@ -28,7 +28,7 @@ #ifndef _LNET_NIDSTRINGS_H #define _LNET_NIDSTRINGS_H -#include "types.h" +#include "lnet-types.h" /** * Lustre Network Driver types. diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index 9ece869..657c495 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -55,7 +55,7 @@ #include "../../include/linux/libcfs/libcfs_crypto.h" #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" #include "tracefile.h" static struct dentry *lnet_debugfs_root; diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 0b91d18..30c7ff6 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -35,7 +35,7 @@ #include #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" #define D_LNI D_CONSOLE diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 4ffbd3e..06fcfd2 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -32,7 +32,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" static int config_on_load; module_param(config_on_load, int, 0444); diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c index 18183cb..166a311 100644 --- a/drivers/staging/lustre/lnet/lnet/net_fault.c +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lnetctl.h" +#include "../../include/uapi/linux/lnet/lnetctl.h" #define LNET_MSG_MASK (LNET_PUT_BIT | LNET_ACK_BIT | \ LNET_GET_BIT | LNET_REPLY_BIT) diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index cbbd11f..a91bbc4 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/nidstr.h" +#include "../../include/uapi/linux/lnet/nidstr.h" /* max value for numeric network address */ #define MAX_NUMERIC_VALUE 0xffffffff diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c index e62b21f..301b275 100644 --- a/drivers/staging/lustre/lnet/lnet/peer.c +++ b/drivers/staging/lustre/lnet/lnet/peer.c @@ -35,7 +35,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-dlc.h" +#include "../../include/uapi/linux/lnet/lnet-dlc.h" int lnet_peer_tables_create(void) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 043eafb..106304e 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -38,7 +38,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "console.h" static int diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h index e2a78b6..501e1ec 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.h +++ b/drivers/staging/lustre/lnet/selftest/conrpc.h @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-types.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "rpc.h" #include "selftest.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index 0a9ba06..d806214 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-types.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "selftest.h" #include "conrpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h index a765537..217ca21 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.h +++ b/drivers/staging/lustre/lnet/selftest/rpc.h @@ -33,7 +33,7 @@ #ifndef __SELFTEST_RPC_H__ #define __SELFTEST_RPC_H__ -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" /* * LST wired structures diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index bfa4971..3777023 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -41,7 +41,7 @@ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-lnet.h" #include "../../include/linux/lnet/lib-types.h" -#include "../../include/linux/lnet/lnetst.h" +#include "../../include/uapi/linux/lnet/lnetst.h" #include "rpc.h" #include "timer.h" diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index fab624e..d26c599 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -70,8 +70,7 @@ #define _LUSTRE_IDL_H_ #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/types.h" - +#include "../../../include/uapi/linux/lnet/lnet-types.h" /* Defn's shared with user-space. */ #include "lustre_user.h" #include "../lustre_ver.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index 1a532ad..05cdc66 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -45,7 +45,6 @@ */ #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/types.h" #include /****************** persistent mount data *********************/ diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 05f02b1..c0b5927 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -52,7 +52,7 @@ #include #include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/nidstr.h" +#include "../../include/uapi/linux/lnet/nidstr.h" #include "../../include/linux/lnet/api.h" #include "lustre/lustre_idl.h" #include "lustre_ha.h" diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index ed30333..dedad65 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -35,7 +35,7 @@ #include "../include/obd_support.h" #include "../include/obd_class.h" -#include "../../include/linux/lnet/lnetctl.h" +#include "../../include/uapi/linux/lnet/lnetctl.h" #include "../include/lustre_debug.h" #include "../include/lprocfs_status.h" #include diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 9f83345..1b5beea 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -61,7 +61,7 @@ #include #include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lnetctl.h" +#include "../../../include/uapi/linux/lnet/lnetctl.h" #include "../../include/obd_support.h" #include "../../include/obd_class.h" #include "../../include/lprocfs_status.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index bcf5faf..ca3d69e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -35,7 +35,7 @@ #include "../include/obd_class.h" #include "../include/lustre_net.h" #include "../include/lu_object.h" -#include "../../include/linux/lnet/types.h" +#include "../../include/uapi/linux/lnet/lnet-types.h" #include "ptlrpc_internal.h" /* The following are visible and mutable through /sys/module/ptlrpc */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:31 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:31 -0400 Subject: [lustre-devel] [PATCH 37/64 v2] staging: lustre: libcfs: sort headers in libcfs.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-38-git-send-email-jsimmons@infradead.org> Move all the included headers in libcfs.h to the top of the file. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs.h | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 71bb55e..3a5ebc2 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -33,9 +33,20 @@ #ifndef __LIBCFS_LIBCFS_H__ #define __LIBCFS_LIBCFS_H__ -#include "linux/libcfs.h" #include +#include +#include "../../uapi/linux/lnet/libcfs_ioctl.h" +#include "linux/libcfs.h" +#include "libcfs_debug.h" +#include "libcfs_private.h" +#include "libcfs_cpu.h" +#include "libcfs_prim.h" +#include "libcfs_time.h" +#include "libcfs_string.h" +#include "libcfs_workitem.h" +#include "libcfs_hash.h" +#include "libcfs_fail.h" #include "curproc.h" #define LIBCFS_VERSION "0.7.0" @@ -49,8 +60,6 @@ #define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \ ((hexnum) >> 8 & 0xf)) -#include - /* need both kernel and user-land acceptor */ #define LNET_ACCEPTOR_MIN_RESERVED_PORT 512 #define LNET_ACCEPTOR_MAX_RESERVED_PORT 1023 @@ -74,17 +83,6 @@ void cfs_srand(unsigned int seed1, unsigned int seed2); void cfs_get_random_bytes(void *buf, int size); -#include "libcfs_debug.h" -#include "libcfs_cpu.h" -#include "libcfs_private.h" -#include "../../uapi/linux/lnet/libcfs_ioctl.h" -#include "libcfs_prim.h" -#include "libcfs_time.h" -#include "libcfs_string.h" -#include "libcfs_workitem.h" -#include "libcfs_hash.h" -#include "libcfs_fail.h" - struct libcfs_ioctl_handler { struct list_head item; int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_hdr *hdr); -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:23 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:23 -0400 Subject: [lustre-devel] [PATCH 29/64 v2] staging: lustre: uapi: style cleanup of lustre_cfg.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-30-git-send-email-jsimmons@infradead.org> Some style and white space cleanups to make lustre_cfg.h easy to read. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lustre/lustre_cfg.h | 110 +++++++++++---------- 1 file changed, 60 insertions(+), 50 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 4208d61..2d37d1b 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -57,48 +57,61 @@ * in order to mount the filesystem. If it does not understand * a REQUIRED command the client mount will fail. */ -#define LCFG_REQUIRED 0x0001000 +#define LCFG_REQUIRED 0x0001000 enum lcfg_command_type { - LCFG_ATTACH = 0x00cf001, /**< create a new obd instance */ - LCFG_DETACH = 0x00cf002, /**< destroy obd instance */ - LCFG_SETUP = 0x00cf003, /**< call type-specific setup */ - LCFG_CLEANUP = 0x00cf004, /**< call type-specific cleanup */ - LCFG_ADD_UUID = 0x00cf005, /**< add a nid to a niduuid */ - LCFG_DEL_UUID = 0x00cf006, /**< remove a nid from a niduuid */ - LCFG_MOUNTOPT = 0x00cf007, /**< create a profile (mdc, osc) */ - LCFG_DEL_MOUNTOPT = 0x00cf008, /**< destroy a profile */ - LCFG_SET_TIMEOUT = 0x00cf009, /**< set obd_timeout */ - LCFG_SET_UPCALL = 0x00cf00a, /**< deprecated */ - LCFG_ADD_CONN = 0x00cf00b, /**< add a failover niduuid to an obd */ - LCFG_DEL_CONN = 0x00cf00c, /**< remove a failover niduuid */ - LCFG_LOV_ADD_OBD = 0x00cf00d, /**< add an osc to a lov */ - LCFG_LOV_DEL_OBD = 0x00cf00e, /**< remove an osc from a lov */ - LCFG_PARAM = 0x00cf00f, /**< set a proc parameter */ - LCFG_MARKER = 0x00cf010, /**< metadata about next cfg rec */ - LCFG_LOG_START = 0x00ce011, /**< mgc only, process a cfg log */ - LCFG_LOG_END = 0x00ce012, /**< stop processing updates */ - LCFG_LOV_ADD_INA = 0x00ce013, /**< like LOV_ADD_OBD, inactive */ - LCFG_ADD_MDC = 0x00cf014, /**< add an mdc to a lmv */ - LCFG_DEL_MDC = 0x00cf015, /**< remove an mdc from a lmv */ - LCFG_SPTLRPC_CONF = 0x00ce016, /**< security */ - LCFG_POOL_NEW = 0x00ce020, /**< create an ost pool name */ - LCFG_POOL_ADD = 0x00ce021, /**< add an ost to a pool */ - LCFG_POOL_REM = 0x00ce022, /**< remove an ost from a pool */ - LCFG_POOL_DEL = 0x00ce023, /**< destroy an ost pool name */ - LCFG_SET_LDLM_TIMEOUT = 0x00ce030, /**< set ldlm_timeout */ - LCFG_PRE_CLEANUP = 0x00cf031, /**< call type-specific pre - * cleanup cleanup - */ - LCFG_SET_PARAM = 0x00ce032, /**< use set_param syntax to set - * a proc parameters - */ + LCFG_ATTACH = 0x00cf001, /**< create a new obd instance */ + LCFG_DETACH = 0x00cf002, /**< destroy obd instance */ + LCFG_SETUP = 0x00cf003, /**< call type-specific setup */ + LCFG_CLEANUP = 0x00cf004, /**< call type-specific cleanup + */ + LCFG_ADD_UUID = 0x00cf005, /**< add a nid to a niduuid */ + LCFG_DEL_UUID = 0x00cf006, /**< remove a nid from + * a niduuid + */ + LCFG_MOUNTOPT = 0x00cf007, /**< create a profile + * (mdc, osc) + */ + LCFG_DEL_MOUNTOPT = 0x00cf008, /**< destroy a profile */ + LCFG_SET_TIMEOUT = 0x00cf009, /**< set obd_timeout */ + LCFG_SET_UPCALL = 0x00cf00a, /**< deprecated */ + LCFG_ADD_CONN = 0x00cf00b, /**< add a failover niduuid to + * an obd + */ + LCFG_DEL_CONN = 0x00cf00c, /**< remove a failover niduuid */ + LCFG_LOV_ADD_OBD = 0x00cf00d, /**< add an osc to a lov */ + LCFG_LOV_DEL_OBD = 0x00cf00e, /**< remove an osc from a lov */ + LCFG_PARAM = 0x00cf00f, /**< set a proc parameter */ + LCFG_MARKER = 0x00cf010, /**< metadata about next + * cfg rec + */ + LCFG_LOG_START = 0x00ce011, /**< mgc only, process a + * cfg log + */ + LCFG_LOG_END = 0x00ce012, /**< stop processing updates */ + LCFG_LOV_ADD_INA = 0x00ce013, /**< like LOV_ADD_OBD, + * inactive + */ + LCFG_ADD_MDC = 0x00cf014, /**< add an mdc to a lmv */ + LCFG_DEL_MDC = 0x00cf015, /**< remove an mdc from a lmv */ + LCFG_SPTLRPC_CONF = 0x00ce016, /**< security */ + LCFG_POOL_NEW = 0x00ce020, /**< create an ost pool name */ + LCFG_POOL_ADD = 0x00ce021, /**< add an ost to a pool */ + LCFG_POOL_REM = 0x00ce022, /**< remove an ost from a pool */ + LCFG_POOL_DEL = 0x00ce023, /**< destroy an ost pool name */ + LCFG_SET_LDLM_TIMEOUT = 0x00ce030, /**< set ldlm_timeout */ + LCFG_PRE_CLEANUP = 0x00cf031, /**< call type-specific pre + * cleanup cleanup + */ + LCFG_SET_PARAM = 0x00ce032, /**< use set_param syntax to set + * a proc parameters + */ }; struct lustre_cfg_bufs { - void *lcfg_buf[LUSTRE_CFG_MAX_BUFCOUNT]; - __u32 lcfg_buflen[LUSTRE_CFG_MAX_BUFCOUNT]; - __u32 lcfg_bufcount; + void *lcfg_buf[LUSTRE_CFG_MAX_BUFCOUNT]; + __u32 lcfg_buflen[LUSTRE_CFG_MAX_BUFCOUNT]; + __u32 lcfg_bufcount; }; struct lustre_cfg { @@ -115,40 +128,37 @@ struct lustre_cfg { }; enum cfg_record_type { - PORTALS_CFG_TYPE = 1, - LUSTRE_CFG_TYPE = 123, + PORTALS_CFG_TYPE = 1, + LUSTRE_CFG_TYPE = 123, }; -#define LUSTRE_CFG_BUFLEN(lcfg, idx) \ - ((lcfg)->lcfg_bufcount <= (idx) \ - ? 0 \ - : (lcfg)->lcfg_buflens[(idx)]) +#define LUSTRE_CFG_BUFLEN(lcfg, idx) \ + ((lcfg)->lcfg_bufcount <= (idx) ? 0 : (lcfg)->lcfg_buflens[(idx)]) static inline void lustre_cfg_bufs_set(struct lustre_cfg_bufs *bufs, - __u32 index, - void *buf, - __u32 buflen) + __u32 index, void *buf, __u32 buflen) { if (index >= LUSTRE_CFG_MAX_BUFCOUNT) return; + if (!bufs) return; if (bufs->lcfg_bufcount <= index) bufs->lcfg_bufcount = index + 1; - bufs->lcfg_buf[index] = buf; + bufs->lcfg_buf[index] = buf; bufs->lcfg_buflen[index] = buflen; } static inline void lustre_cfg_bufs_set_string(struct lustre_cfg_bufs *bufs, - __u32 index, - char *str) + __u32 index, char *str) { lustre_cfg_bufs_set(bufs, index, str, str ? strlen(str) + 1 : 0); } -static inline void lustre_cfg_bufs_reset(struct lustre_cfg_bufs *bufs, char *name) +static inline void lustre_cfg_bufs_reset(struct lustre_cfg_bufs *bufs, + char *name) { memset((bufs), 0, sizeof(*bufs)); if (name) -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:27 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:27 -0400 Subject: [lustre-devel] [PATCH 33/64 v2] staging: lustre: libcfs: create libcfs_debug.h UAPI header In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-34-git-send-email-jsimmons@infradead.org> Break out the parts from libcfs_debug.h that is used by both user land and kernel space into a new UAPI header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/28089 Reviewed-by: Dmitry Eremin Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_debug.h | 104 +------------- .../lustre/include/uapi/linux/lnet/libcfs_debug.h | 149 +++++++++++++++++++++ 2 files changed, 151 insertions(+), 102 deletions(-) create mode 100644 drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index b7bd6e8..91d141d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -38,6 +38,8 @@ #ifndef __LIBCFS_DEBUG_H__ #define __LIBCFS_DEBUG_H__ +#include "../../uapi/linux/lnet/libcfs_debug.h" + /* * Debugging */ @@ -59,108 +61,6 @@ extern unsigned int libcfs_catastrophe; extern unsigned int libcfs_panic_on_lbug; -/** - * Format for debug message headers - */ -struct ptldebug_header { - __u32 ph_len; - __u32 ph_flags; - __u32 ph_subsys; - __u32 ph_mask; - __u16 ph_cpu_id; - __u16 ph_type; - /* time_t overflow in 2106 */ - __u32 ph_sec; - __u64 ph_usec; - __u32 ph_stack; - __u32 ph_pid; - __u32 ph_extern_pid; - __u32 ph_line_num; -} __packed; - -#define PH_FLAG_FIRST_RECORD 1 - -/* Debugging subsystems (32 bits, non-overlapping) */ -#define S_UNDEFINED 0x00000001 -#define S_MDC 0x00000002 -#define S_MDS 0x00000004 -#define S_OSC 0x00000008 -#define S_OST 0x00000010 -#define S_CLASS 0x00000020 -#define S_LOG 0x00000040 -#define S_LLITE 0x00000080 -#define S_RPC 0x00000100 -#define S_MGMT 0x00000200 -#define S_LNET 0x00000400 -#define S_LND 0x00000800 /* ALL LNDs */ -#define S_PINGER 0x00001000 -#define S_FILTER 0x00002000 -/* unused */ -#define S_ECHO 0x00008000 -#define S_LDLM 0x00010000 -#define S_LOV 0x00020000 -#define S_LQUOTA 0x00040000 -#define S_OSD 0x00080000 -#define S_LFSCK 0x00100000 -/* unused */ -/* unused */ -#define S_LMV 0x00800000 /* b_new_cmd */ -/* unused */ -#define S_SEC 0x02000000 /* upcall cache */ -#define S_GSS 0x04000000 /* b_new_cmd */ -/* unused */ -#define S_MGC 0x10000000 -#define S_MGS 0x20000000 -#define S_FID 0x40000000 /* b_new_cmd */ -#define S_FLD 0x80000000 /* b_new_cmd */ - -#define LIBCFS_DEBUG_SUBSYS_NAMES { \ - "undefined", "mdc", "mds", "osc", "ost", "class", "log", \ - "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", "", \ - "echo", "ldlm", "lov", "lquota", "osd", "lfsck", "", "", "lmv", \ - "", "sec", "gss", "", "mgc", "mgs", "fid", "fld", NULL } - -/* Debugging masks (32 bits, non-overlapping) */ -#define D_TRACE 0x00000001 /* ENTRY/EXIT markers */ -#define D_INODE 0x00000002 -#define D_SUPER 0x00000004 -#define D_EXT2 0x00000008 /* anything from ext2_debug */ -#define D_MALLOC 0x00000010 /* print malloc, free information */ -#define D_CACHE 0x00000020 /* cache-related items */ -#define D_INFO 0x00000040 /* general information */ -#define D_IOCTL 0x00000080 /* ioctl related information */ -#define D_NETERROR 0x00000100 /* network errors */ -#define D_NET 0x00000200 /* network communications */ -#define D_WARNING 0x00000400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */ -#define D_BUFFS 0x00000800 -#define D_OTHER 0x00001000 -#define D_DENTRY 0x00002000 -#define D_NETTRACE 0x00004000 -#define D_PAGE 0x00008000 /* bulk page handling */ -#define D_DLMTRACE 0x00010000 -#define D_ERROR 0x00020000 /* CERROR(...) == CDEBUG (D_ERROR, ...) */ -#define D_EMERG 0x00040000 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */ -#define D_HA 0x00080000 /* recovery and failover */ -#define D_RPCTRACE 0x00100000 /* for distributed debugging */ -#define D_VFSTRACE 0x00200000 -#define D_READA 0x00400000 /* read-ahead */ -#define D_MMAP 0x00800000 -#define D_CONFIG 0x01000000 -#define D_CONSOLE 0x02000000 -#define D_QUOTA 0x04000000 -#define D_SEC 0x08000000 -#define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */ -#define D_HSM 0x20000000 - -#define LIBCFS_DEBUG_MASKS_NAMES { \ - "trace", "inode", "super", "ext2", "malloc", "cache", "info", \ - "ioctl", "neterror", "net", "warning", "buffs", "other", \ - "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \ - "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \ - "console", "quota", "sec", "lfsck", "hsm", NULL } - -#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) - #ifndef DEBUG_SUBSYSTEM # define DEBUG_SUBSYSTEM S_UNDEFINED #endif diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h b/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h new file mode 100644 index 0000000..c4d9472 --- /dev/null +++ b/drivers/staging/lustre/include/uapi/linux/lnet/libcfs_debug.h @@ -0,0 +1,149 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2012, 2014, Intel Corporation. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + * + * libcfs/include/libcfs/libcfs_debug.h + * + * Debug messages and assertions + * + */ + +#ifndef __UAPI_LIBCFS_DEBUG_H__ +#define __UAPI_LIBCFS_DEBUG_H__ + +/** + * Format for debug message headers + */ +struct ptldebug_header { + __u32 ph_len; + __u32 ph_flags; + __u32 ph_subsys; + __u32 ph_mask; + __u16 ph_cpu_id; + __u16 ph_type; + /* time_t overflow in 2106 */ + __u32 ph_sec; + __u64 ph_usec; + __u32 ph_stack; + __u32 ph_pid; + __u32 ph_extern_pid; + __u32 ph_line_num; +} __attribute__((packed)); + +#define PH_FLAG_FIRST_RECORD 1 + +/* Debugging subsystems (32 bits, non-overlapping) */ +#define S_UNDEFINED 0x00000001 +#define S_MDC 0x00000002 +#define S_MDS 0x00000004 +#define S_OSC 0x00000008 +#define S_OST 0x00000010 +#define S_CLASS 0x00000020 +#define S_LOG 0x00000040 +#define S_LLITE 0x00000080 +#define S_RPC 0x00000100 +#define S_MGMT 0x00000200 +#define S_LNET 0x00000400 +#define S_LND 0x00000800 /* ALL LNDs */ +#define S_PINGER 0x00001000 +#define S_FILTER 0x00002000 +#define S_LIBCFS 0x00004000 +#define S_ECHO 0x00008000 +#define S_LDLM 0x00010000 +#define S_LOV 0x00020000 +#define S_LQUOTA 0x00040000 +#define S_OSD 0x00080000 +#define S_LFSCK 0x00100000 +#define S_SNAPSHOT 0x00200000 +/* unused */ +#define S_LMV 0x00800000 /* b_new_cmd */ +/* unused */ +#define S_SEC 0x02000000 /* upcall cache */ +#define S_GSS 0x04000000 /* b_new_cmd */ +/* unused */ +#define S_MGC 0x10000000 +#define S_MGS 0x20000000 +#define S_FID 0x40000000 /* b_new_cmd */ +#define S_FLD 0x80000000 /* b_new_cmd */ + +#define LIBCFS_DEBUG_SUBSYS_NAMES { \ + "undefined", "mdc", "mds", "osc", "ost", "class", "log", \ + "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", \ + "libcfs", "echo", "ldlm", "lov", "lquota", "osd", "lfsck", \ + "snapshot", "", "lmv", "", "sec", "gss", "", "mgc", "mgs", \ + "fid", "fld", NULL } + +/* Debugging masks (32 bits, non-overlapping) */ +#define D_TRACE 0x00000001 /* ENTRY/EXIT markers */ +#define D_INODE 0x00000002 +#define D_SUPER 0x00000004 +#define D_EXT2 0x00000008 /* anything from ext2_debug */ +#define D_MALLOC 0x00000010 /* print malloc, free information */ +#define D_CACHE 0x00000020 /* cache-related items */ +#define D_INFO 0x00000040 /* general information */ +#define D_IOCTL 0x00000080 /* ioctl related information */ +#define D_NETERROR 0x00000100 /* network errors */ +#define D_NET 0x00000200 /* network communications */ +#define D_WARNING 0x00000400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */ +#define D_BUFFS 0x00000800 +#define D_OTHER 0x00001000 +#define D_DENTRY 0x00002000 +#define D_NETTRACE 0x00004000 +#define D_PAGE 0x00008000 /* bulk page handling */ +#define D_DLMTRACE 0x00010000 +#define D_ERROR 0x00020000 /* CERROR(...) == CDEBUG (D_ERROR, ...) */ +#define D_EMERG 0x00040000 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */ +#define D_HA 0x00080000 /* recovery and failover */ +#define D_RPCTRACE 0x00100000 /* for distributed debugging */ +#define D_VFSTRACE 0x00200000 +#define D_READA 0x00400000 /* read-ahead */ +#define D_MMAP 0x00800000 +#define D_CONFIG 0x01000000 +#define D_CONSOLE 0x02000000 +#define D_QUOTA 0x04000000 +#define D_SEC 0x08000000 +#define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */ +#define D_HSM 0x20000000 +#define D_SNAPSHOT 0x40000000 /* snapshot */ +#define D_LAYOUT 0x80000000 + +#define LIBCFS_DEBUG_MASKS_NAMES { \ + "trace", "inode", "super", "ext2", "malloc", "cache", "info", \ + "ioctl", "neterror", "net", "warning", "buffs", "other", \ + "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \ + "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \ + "console", "quota", "sec", "lfsck", "hsm", "snapshot", "layout",\ + NULL } + +#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE) + +#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log" + +#endif /* __UAPI_LIBCFS_DEBUG_H__ */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:34 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:34 -0400 Subject: [lustre-devel] [PATCH 40/64 v2] staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-41-git-send-email-jsimmons@infradead.org> These are the last UAPI headers that contain libcfs.h which is internal kernel header. Since it is not available to user land remove libcfs.h and add the need headers that libcfs.h provided. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 3 ++- drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index d26c599..fe443f8 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -69,7 +69,8 @@ #ifndef _LUSTRE_IDL_H_ #define _LUSTRE_IDL_H_ -#include "../../../include/linux/libcfs/libcfs.h" +#include + #include "../../../include/uapi/linux/lnet/lnet-types.h" /* Defn's shared with user-space. */ #include "lustre_user.h" diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index edff8dc..bee93d0 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -43,6 +43,7 @@ */ #ifdef __KERNEL__ +# include # include # include # include /* snprintf() */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:07 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:07 -0400 Subject: [lustre-devel] [PATCH 13/64 v2] staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-14-git-send-email-jsimmons@infradead.org> Replace cfs_size_round() standard __ALIGN_KERNEL macro. This removes the dependency of libcfs.h which is a kernel only header. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 880dd92..a7e2fc4 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -28,8 +28,8 @@ #ifndef LUSTRE_IOCTL_H_ #define LUSTRE_IOCTL_H_ +#include #include -#include "../../../linux/libcfs/libcfs.h" #include "../../../../lustre/include/lustre/lustre_idl.h" #ifdef __KERNEL__ @@ -121,12 +121,12 @@ struct obd_ioctl_hdr { static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data) { - __u32 len = cfs_size_round(sizeof(*data)); + __u32 len = __ALIGN_KERNEL(sizeof(*data), 8); - len += cfs_size_round(data->ioc_inllen1); - len += cfs_size_round(data->ioc_inllen2); - len += cfs_size_round(data->ioc_inllen3); - len += cfs_size_round(data->ioc_inllen4); + len += __ALIGN_KERNEL(data->ioc_inllen1, 8); + len += __ALIGN_KERNEL(data->ioc_inllen2, 8); + len += __ALIGN_KERNEL(data->ioc_inllen3, 8); + len += __ALIGN_KERNEL(data->ioc_inllen4, 8); return len; } -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:14 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:14 -0400 Subject: [lustre-devel] [PATCH 20/64 v2] staging: lustre: uapi: style cleanups for lustre_param.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-21-git-send-email-jsimmons@infradead.org> Remove the white space in the lustre_param.h header and align the code so its easier to read. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../include/uapi/linux/lustre/lustre_param.h | 67 +++++++++++----------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h index cab0056..1eab2ce 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_param.h @@ -44,49 +44,50 @@ /****************** User-settable parameter keys *********************/ /* e.g. - tunefs.lustre --param="failover.node=192.168.0.13 at tcp0" /dev/sda - lctl conf_param testfs-OST0000 failover.node=3 at elan,192.168.0.3 at tcp0 - ... testfs-MDT0000.lov.stripesize=4M - ... testfs-OST0000.ost.client_cache_seconds=15 - ... testfs.sys.timeout= - ... testfs.llite.max_read_ahead_mb=16 -*/ + * tunefs.lustre --param="failover.node=192.168.0.13 at tcp0" /dev/sda + * lctl conf_param testfs-OST0000 failover.node=3 at elan,192.168.0.3 at tcp0 + * ... testfs-MDT0000.lov.stripesize=4M + * ... testfs-OST0000.ost.client_cache_seconds=15 + * ... testfs.sys.timeout= + * ... testfs.llite.max_read_ahead_mb=16 + */ /* System global or special params not handled in obd's proc * See mgs_write_log_sys() */ -#define PARAM_TIMEOUT "timeout=" /* global */ -#define PARAM_LDLM_TIMEOUT "ldlm_timeout=" /* global */ -#define PARAM_AT_MIN "at_min=" /* global */ -#define PARAM_AT_MAX "at_max=" /* global */ -#define PARAM_AT_EXTRA "at_extra=" /* global */ -#define PARAM_AT_EARLY_MARGIN "at_early_margin=" /* global */ -#define PARAM_AT_HISTORY "at_history=" /* global */ -#define PARAM_JOBID_VAR "jobid_var=" /* global */ -#define PARAM_MGSNODE "mgsnode=" /* only at mounttime */ -#define PARAM_FAILNODE "failover.node=" /* add failover nid */ -#define PARAM_FAILMODE "failover.mode=" /* initial mount only */ -#define PARAM_ACTIVE "active=" /* activate/deactivate */ -#define PARAM_NETWORK "network=" /* bind on nid */ -#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */ +#define PARAM_TIMEOUT "timeout=" /* global */ +#define PARAM_LDLM_TIMEOUT "ldlm_timeout=" /* global */ +#define PARAM_AT_MIN "at_min=" /* global */ +#define PARAM_AT_MAX "at_max=" /* global */ +#define PARAM_AT_EXTRA "at_extra=" /* global */ +#define PARAM_AT_EARLY_MARGIN "at_early_margin=" /* global */ +#define PARAM_AT_HISTORY "at_history=" /* global */ +#define PARAM_JOBID_VAR "jobid_var=" /* global */ +#define PARAM_MGSNODE "mgsnode=" /* only at mounttime */ +#define PARAM_FAILNODE "failover.node=" /* add failover nid */ +#define PARAM_FAILMODE "failover.mode=" /* initial mount only */ +#define PARAM_ACTIVE "active=" /* activate/deactivate */ +#define PARAM_NETWORK "network=" /* bind on nid */ +#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */ /* Prefixes for parameters handled by obd's proc methods (XXX_process_config) */ -#define PARAM_OST "ost." +#define PARAM_OST "ost." #define PARAM_OSD "osd." -#define PARAM_OSC "osc." -#define PARAM_MDT "mdt." -#define PARAM_MDD "mdd." -#define PARAM_MDC "mdc." +#define PARAM_OSC "osc." +#define PARAM_MDT "mdt." +#define PARAM_HSM "mdt.hsm." +#define PARAM_MDD "mdd." +#define PARAM_MDC "mdc." #define PARAM_LLITE "llite." -#define PARAM_LOV "lov." +#define PARAM_LOV "lov." #define PARAM_LOD "lod." #define PARAM_OSP "osp." -#define PARAM_SYS "sys." /* global */ -#define PARAM_SRPC "srpc." -#define PARAM_SRPC_FLVR "srpc.flavor." -#define PARAM_SRPC_UDESC "srpc.udesc.cli2mdt" -#define PARAM_SEC "security." -#define PARAM_QUOTA "quota." /* global */ +#define PARAM_SYS "sys." /* global */ +#define PARAM_SRPC "srpc." +#define PARAM_SRPC_FLVR "srpc.flavor." +#define PARAM_SRPC_UDESC "srpc.udesc.cli2mdt" +#define PARAM_SEC "security." +#define PARAM_QUOTA "quota." /* global */ /** @} param */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:55 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:55 -0400 Subject: [lustre-devel] [PATCH 61/64 v2] staging: lustre: ksocklnd: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-62-git-send-email-jsimmons@infradead.org> Rationalize include paths in the ksocklnd source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/klnds/socklnd/Makefile | 3 +++ drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/Makefile b/drivers/staging/lustre/lnet/klnds/socklnd/Makefile index c011581..a7da1ab 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/Makefile +++ b/drivers/staging/lustre/lnet/klnds/socklnd/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET) += ksocklnd.o ksocklnd-y := socklnd.o socklnd_cb.o socklnd_proto.o socklnd_modparams.o socklnd_lib.o diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 88afe09..e6428c4 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -46,9 +46,9 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lib-lnet.h" -#include "../../../include/linux/lnet/socklnd.h" +#include +#include +#include /* assume one thread for each connection type */ #define SOCKNAL_NSCHEDS 3 -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:57 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:57 -0400 Subject: [lustre-devel] [PATCH 63/64 v2] staging: lustre: libcfs: cleanup paths for libcfs headers In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-64-git-send-email-jsimmons@infradead.org> Rationalize include paths in all the libcfs header files. Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs.h | 24 +++++++++++----------- .../lustre/include/linux/libcfs/libcfs_debug.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 3a5ebc2..b48e2f0 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -36,18 +36,18 @@ #include #include -#include "../../uapi/linux/lnet/libcfs_ioctl.h" -#include "linux/libcfs.h" -#include "libcfs_debug.h" -#include "libcfs_private.h" -#include "libcfs_cpu.h" -#include "libcfs_prim.h" -#include "libcfs_time.h" -#include "libcfs_string.h" -#include "libcfs_workitem.h" -#include "libcfs_hash.h" -#include "libcfs_fail.h" -#include "curproc.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define LIBCFS_VERSION "0.7.0" diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 91d141d..e7c3741 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -38,7 +38,7 @@ #ifndef __LIBCFS_DEBUG_H__ #define __LIBCFS_DEBUG_H__ -#include "../../uapi/linux/lnet/libcfs_debug.h" +#include /* * Debugging -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:25 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:25 -0400 Subject: [lustre-devel] [PATCH 31/64 v2] staging: lustre: libcfs: remove htonl hack in libcfs.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-32-git-send-email-jsimmons@infradead.org> This is really old hack for earlier gcc version that had a hard time compiling byteorder.h. Lets remove it. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index e774c75..005713b 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -154,18 +154,6 @@ /******************************************************************************/ -/* htonl hack - either this, or compile with -O2. Stupid byteorder/generic.h */ -#if defined(__GNUC__) && (__GNUC__ >= 2) && !defined(__OPTIMIZE__) -#define ___htonl(x) __cpu_to_be32(x) -#define ___htons(x) __cpu_to_be16(x) -#define ___ntohl(x) __be32_to_cpu(x) -#define ___ntohs(x) __be16_to_cpu(x) -#define htonl(x) ___htonl(x) -#define ntohl(x) ___ntohl(x) -#define htons(x) ___htons(x) -#define ntohs(x) ___ntohs(x) -#endif - void libcfs_debug_dumplog(void); int libcfs_debug_init(unsigned long bufsize); int libcfs_debug_cleanup(void); -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:25:57 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:25:57 -0400 Subject: [lustre-devel] [PATCH 03/64 v2] staging: lustre: uapi: return error code for ostid_set_id In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-4-git-send-email-jsimmons@infradead.org> From: Ben Evans Currently the function ostid_set_id() just logs an error and just keeps going. This function is also used by user land tools so having special lustre kernel debugging code is not desired. So instead just return an error code and have the calling kernel code print the error instead. Signed-off-by: Ben Evans Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/22712 Reviewed-on: https://review.whamcloud.com/24569 Reviewed-by: James Simmons Reviewed-by: Frank Zago Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_idl.h | 23 ++++++++-------------- .../staging/lustre/lustre/obdecho/echo_client.c | 7 +++++-- drivers/staging/lustre/lustre/osc/osc_object.c | 9 ++++++++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 1e8ecdf..d70495d 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -515,32 +515,25 @@ static inline void ostid_set_seq_llog(struct ost_id *oi) * Note: we need check oi_seq to decide where to set oi_id, * so oi_seq should always be set ahead of oi_id. */ -static inline void ostid_set_id(struct ost_id *oi, __u64 oid) +static inline int ostid_set_id(struct ost_id *oi, __u64 oid) { if (fid_seq_is_mdt0(oi->oi.oi_seq)) { - if (oid >= IDIF_MAX_OID) { - CERROR("Too large OID %#llx to set MDT0 " DOSTID "\n", - oid, POSTID(oi)); - return; - } + if (oid >= IDIF_MAX_OID) + return -E2BIG; oi->oi.oi_id = oid; } else if (fid_is_idif(&oi->oi_fid)) { - if (oid >= IDIF_MAX_OID) { - CERROR("Too large OID %#llx to set IDIF " DOSTID "\n", - oid, POSTID(oi)); - return; - } + if (oid >= IDIF_MAX_OID) + return -E2BIG; oi->oi_fid.f_seq = fid_idif_seq(oid, fid_idif_ost_idx(&oi->oi_fid)); oi->oi_fid.f_oid = oid; oi->oi_fid.f_ver = oid >> 48; } else { - if (oid >= OBIF_MAX_OID) { - CERROR("Bad %llu to set " DOSTID "\n", oid, POSTID(oi)); - return; - } + if (oid >= OBIF_MAX_OID) + return -E2BIG; oi->oi_fid.f_oid = oid; } + return 0; } static inline int fid_set_id(struct lu_fid *fid, __u64 oid) diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index b3fbc3c..363d205 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -1102,8 +1102,11 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed, return -EINVAL; } - if (!ostid_id(&oa->o_oi)) - ostid_set_id(&oa->o_oi, ++last_object_id); + if (!ostid_id(&oa->o_oi)) { + rc = ostid_set_id(&oa->o_oi, ++last_object_id); + if (rc) + goto failed; + } rc = obd_create(env, ec->ec_exp, oa); if (rc != 0) { diff --git a/drivers/staging/lustre/lustre/osc/osc_object.c b/drivers/staging/lustre/lustre/osc/osc_object.c index fa621bd..945ae6e 100644 --- a/drivers/staging/lustre/lustre/osc/osc_object.c +++ b/drivers/staging/lustre/lustre/osc/osc_object.c @@ -369,7 +369,14 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj, oa->o_valid |= OBD_MD_FLGROUP; } if (flags & OBD_MD_FLID) { - ostid_set_id(&oa->o_oi, ostid_id(&oinfo->loi_oi)); + int rc; + + rc = ostid_set_id(&oa->o_oi, ostid_id(&oinfo->loi_oi)); + if (rc) { + CERROR("Bad %llu to set " DOSTID " : rc %d\n", + (unsigned long long)ostid_id(&oinfo->loi_oi), + POSTID(&oa->o_oi), rc); + } oa->o_valid |= OBD_MD_FLID; } if (flags & OBD_MD_FLHANDLE) { -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:05 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:05 -0400 Subject: [lustre-devel] [PATCH 11/64 v2] staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-12-git-send-email-jsimmons@infradead.org> The inline function obd_ioctl_is_invalid() is no longer needed by userland and also the function was pretty bug for a inline function. Since this is the case we can move this kernel only code to the linux-module.c which is the only place it is used. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre/lustre_ioctl.h | 76 ---------------------- .../lustre/lustre/obdclass/linux/linux-module.c | 76 ++++++++++++++++++++++ 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index 914cea1..8585302 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -132,82 +132,6 @@ static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data) return len; } -static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) -{ - if (data->ioc_len > (1 << 30)) { - CERROR("OBD ioctl: ioc_len larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen1 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen1 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen2 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen2 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen3 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen3 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inllen4 > (1 << 30)) { - CERROR("OBD ioctl: ioc_inllen4 larger than 1<<30\n"); - return 1; - } - - if (data->ioc_inlbuf1 && !data->ioc_inllen1) { - CERROR("OBD ioctl: inlbuf1 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_inlbuf2 && !data->ioc_inllen2) { - CERROR("OBD ioctl: inlbuf2 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_inlbuf3 && !data->ioc_inllen3) { - CERROR("OBD ioctl: inlbuf3 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_inlbuf4 && !data->ioc_inllen4) { - CERROR("OBD ioctl: inlbuf4 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_pbuf1 && !data->ioc_plen1) { - CERROR("OBD ioctl: pbuf1 pointer but 0 length\n"); - return 1; - } - - if (data->ioc_pbuf2 && !data->ioc_plen2) { - CERROR("OBD ioctl: pbuf2 pointer but 0 length\n"); - return 1; - } - - if (!data->ioc_pbuf1 && data->ioc_plen1) { - CERROR("OBD ioctl: plen1 set but NULL pointer\n"); - return 1; - } - - if (!data->ioc_pbuf2 && data->ioc_plen2) { - CERROR("OBD ioctl: plen2 set but NULL pointer\n"); - return 1; - } - - if (obd_ioctl_packlen(data) > data->ioc_len) { - CERROR("OBD ioctl: packlen exceeds ioc_len (%d > %d)\n", - obd_ioctl_packlen(data), data->ioc_len); - return 1; - } - - return 0; -} - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 3a394d2..092e68a 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -68,6 +68,82 @@ #include "../../include/lustre/lustre_ioctl.h" #include "../../include/lustre_ver.h" +static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) +{ + if (data->ioc_len > BIT(30)) { + CERROR("OBD ioctl: ioc_len larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen1 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen1 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen2 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen2 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen3 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen3 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inllen4 > BIT(30)) { + CERROR("OBD ioctl: ioc_inllen4 larger than 1<<30\n"); + return 1; + } + + if (data->ioc_inlbuf1 && data->ioc_inllen1 == 0) { + CERROR("OBD ioctl: inlbuf1 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_inlbuf2 && data->ioc_inllen2 == 0) { + CERROR("OBD ioctl: inlbuf2 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_inlbuf3 && data->ioc_inllen3 == 0) { + CERROR("OBD ioctl: inlbuf3 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_inlbuf4 && data->ioc_inllen4 == 0) { + CERROR("OBD ioctl: inlbuf4 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_pbuf1 && data->ioc_plen1 == 0) { + CERROR("OBD ioctl: pbuf1 pointer but 0 length\n"); + return 1; + } + + if (data->ioc_pbuf2 && data->ioc_plen2 == 0) { + CERROR("OBD ioctl: pbuf2 pointer but 0 length\n"); + return 1; + } + + if (!data->ioc_pbuf1 && data->ioc_plen1 != 0) { + CERROR("OBD ioctl: plen1 set but NULL pointer\n"); + return 1; + } + + if (!data->ioc_pbuf2 && data->ioc_plen2 != 0) { + CERROR("OBD ioctl: plen2 set but NULL pointer\n"); + return 1; + } + + if (obd_ioctl_packlen(data) > data->ioc_len) { + CERROR("OBD ioctl: packlen exceeds ioc_len (%d > %d)\n", + obd_ioctl_packlen(data), data->ioc_len); + return 1; + } + + return 0; +} + /* buffer MUST be at least the size of obd_ioctl_hdr */ int obd_ioctl_getdata(char **buf, int *len, void __user *arg) { -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:11 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:11 -0400 Subject: [lustre-devel] [PATCH 17/64 v2] staging: lustre: uapi: remove included headers out of lustre_param.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-18-git-send-email-jsimmons@infradead.org> All the included headers in lustre_param.h are lustre kernel internal headers and they are not even needed. Just remove them. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24325 Reviewed-by: Ben Evans Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_param.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/lustre/include/lustre_param.h index 2620e02..f6f4752 100644 --- a/drivers/staging/lustre/lustre/include/lustre_param.h +++ b/drivers/staging/lustre/lustre/include/lustre_param.h @@ -39,9 +39,6 @@ #ifndef _LUSTRE_PARAM_H #define _LUSTRE_PARAM_H -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/types.h" - /** \defgroup param param * * @{ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:49 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:49 -0400 Subject: [lustre-devel] [PATCH 55/64 v2] staging: lustre: osc: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-56-git-send-email-jsimmons@infradead.org> Rationalize include paths in the osc source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/osc/Makefile | 3 ++ drivers/staging/lustre/lustre/osc/lproc_osc.c | 6 ++-- .../staging/lustre/lustre/osc/osc_cl_internal.h | 6 ++-- drivers/staging/lustre/lustre/osc/osc_dev.c | 2 +- drivers/staging/lustre/lustre/osc/osc_internal.h | 2 +- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- drivers/staging/lustre/lustre/osc/osc_lock.c | 4 +-- drivers/staging/lustre/lustre/osc/osc_quota.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 32 +++++++++++----------- 9 files changed, 31 insertions(+), 28 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/Makefile b/drivers/staging/lustre/lustre/osc/Makefile index 37cdeea..30dec90 100644 --- a/drivers/staging/lustre/lustre/osc/Makefile +++ b/drivers/staging/lustre/lustre/osc/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += osc.o osc-y := osc_request.o osc_dev.o osc_object.o \ osc_page.o osc_lock.o osc_io.o osc_quota.o osc_cache.o lproc_osc.o diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index 6e0fd15..ae13eb055 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -32,9 +32,9 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include +#include #include #include "osc_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h index 270212f..35bdbfb 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h @@ -42,11 +42,11 @@ #ifndef OSC_CL_INTERNAL_H #define OSC_CL_INTERNAL_H -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" +#include /* osc_build_res_name() */ -#include "../include/cl_object.h" +#include #include "osc_internal.h" /** \defgroup osc osc diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c b/drivers/staging/lustre/lustre/osc/osc_dev.c index c5d62ae..cf7b887 100644 --- a/drivers/staging/lustre/lustre/osc/osc_dev.c +++ b/drivers/staging/lustre/lustre/osc/osc_dev.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_OSC /* class_name2obd() */ -#include "../include/obd_class.h" +#include #include "osc_cl_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_internal.h b/drivers/staging/lustre/lustre/osc/osc_internal.h index 13a40f6..a536908 100644 --- a/drivers/staging/lustre/lustre/osc/osc_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_internal.h @@ -99,7 +99,7 @@ struct osc_cache_waiter { /* * cl integration. */ -#include "../include/cl_object.h" +#include extern struct ptlrpc_request_set *PTLRPCD_SET; diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c index cbab800..f7969e3 100644 --- a/drivers/staging/lustre/lustre/osc/osc_io.c +++ b/drivers/staging/lustre/lustre/osc/osc_io.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_OSC -#include "../include/lustre_obdo.h" +#include #include "osc_cl_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c index 940c10c..b4f1f74 100644 --- a/drivers/staging/lustre/lustre/osc/osc_lock.c +++ b/drivers/staging/lustre/lustre/osc/osc_lock.c @@ -37,9 +37,9 @@ #define DEBUG_SUBSYSTEM S_OSC -#include "../../include/linux/libcfs/libcfs.h" +#include /* fid_build_reg_res_name() */ -#include "../include/lustre_fid.h" +#include #include "osc_cl_internal.h" diff --git a/drivers/staging/lustre/lustre/osc/osc_quota.c b/drivers/staging/lustre/lustre/osc/osc_quota.c index fed4da6..a6118f8 100644 --- a/drivers/staging/lustre/lustre/osc/osc_quota.c +++ b/drivers/staging/lustre/lustre/osc/osc_quota.c @@ -23,7 +23,7 @@ * Code originally extracted from quota directory */ -#include "../include/obd_class.h" +#include #include "osc_internal.h" static inline struct osc_quota_info *osc_oqi_alloc(u32 id) diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index af96ac5..4c68c42 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -32,22 +32,22 @@ #define DEBUG_SUBSYSTEM S_OSC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/lustre_dlm.h" -#include "../include/lustre_net.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/obd_cksum.h" - -#include "../include/lustre_ha.h" -#include "../include/lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_debug.h" -#include "../include/lustre_obdo.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_fid.h" -#include "../include/obd_class.h" -#include "../include/obd.h" +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "osc_internal.h" #include "osc_cl_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:02 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:02 -0400 Subject: [lustre-devel] [PATCH 08/64 v2] staging: lustre: uapi: remove obd_ioctl_freedata() wrapper In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-9-git-send-email-jsimmons@infradead.org> Replace obd_ioctl_freedata() with direct kvfree() call. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h | 5 ----- drivers/staging/lustre/lustre/llite/dir.c | 6 +++--- drivers/staging/lustre/lustre/llite/llite_lib.c | 3 +-- drivers/staging/lustre/lustre/lov/lov_obd.c | 8 ++++---- drivers/staging/lustre/lustre/obdclass/class_obd.c | 3 +-- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h index 84654af..7a61a00 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h @@ -211,11 +211,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data) int obd_ioctl_getdata(char **buf, int *len, void __user *arg); int obd_ioctl_popdata(void __user *arg, void *data, int len); -static inline void obd_ioctl_freedata(char *buf, size_t len) -{ - kvfree(buf); -} - /* * OBD_IOC_DATA_TYPE is only for compatibility reasons with older * Linux Lustre user tools. New ioctls should NOT use this macro as diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 03a72c0..dd592d9 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1097,7 +1097,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) goto out_free; } out_free: - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } case LL_IOC_LMV_SETSTRIPE: { @@ -1147,7 +1147,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) #endif rc = ll_dir_setdirstripe(inode, lum, filename, mode); lmv_out_free: - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } case LL_IOC_LMV_SET_DEFAULT_STRIPE: { @@ -1626,7 +1626,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) rc = ll_migrate(inode, file, mdtidx, filename, namelen - 1); migrate_free: - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 5c8405c..451e4fa 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -2231,8 +2231,7 @@ int ll_obd_statfs(struct inode *inode, void __user *arg) if (rc) goto out_statfs; out_statfs: - if (buf) - obd_ioctl_freedata(buf, len); + kvfree(buf); return rc; } diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index f27b11f..8871624 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -1087,17 +1087,17 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, data = (struct obd_ioctl_data *)buf; if (sizeof(*desc) > data->ioc_inllen1) { - obd_ioctl_freedata(buf, len); + kvfree(buf); return -EINVAL; } if (sizeof(uuidp->uuid) * count > data->ioc_inllen2) { - obd_ioctl_freedata(buf, len); + kvfree(buf); return -EINVAL; } if (sizeof(__u32) * count > data->ioc_inllen3) { - obd_ioctl_freedata(buf, len); + kvfree(buf); return -EINVAL; } @@ -1116,7 +1116,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, if (copy_to_user(uarg, buf, len)) rc = -EFAULT; - obd_ioctl_freedata(buf, len); + kvfree(buf); break; } case OBD_IOC_QUOTACTL: { diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 76e1ee8..8cc1fdc 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -369,8 +369,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) } out: - if (buf) - obd_ioctl_freedata(buf, len); + kvfree(buf); return err; } /* class_handle_ioctl */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:36 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:36 -0400 Subject: [lustre-devel] [PATCH 42/64 v2] staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-43-git-send-email-jsimmons@infradead.org> Now that lustre_ioctl.h is a UAPI header the kernel configuration option CONFIG_LUSTRE_OBD_MAX_IOCTL needs to be remove. The user land utilites will no longer be able to see this option and actually they never used this option before. Since this is the case setting the kernel configuration to something other than 8K could actually break things. The best option is just hard code it to 8K. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/25246 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 1 - drivers/staging/lustre/lustre/Kconfig | 10 ---------- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 ++ 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 3060e4d..1f52477 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -56,7 +56,6 @@ enum md_echo_cmd { #define OBD_IOCTL_VERSION 0x00010004 #define OBD_DEV_BY_DEVNAME 0xffffd0de -#define OBD_MAX_IOCTL_BUFFER CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER struct obd_ioctl_data { __u32 ioc_len; diff --git a/drivers/staging/lustre/lustre/Kconfig b/drivers/staging/lustre/lustre/Kconfig index 9f5d75f..90d8269 100644 --- a/drivers/staging/lustre/lustre/Kconfig +++ b/drivers/staging/lustre/lustre/Kconfig @@ -31,16 +31,6 @@ config LUSTRE_FS See also http://wiki.lustre.org/ -config LUSTRE_OBD_MAX_IOCTL_BUFFER - int "Lustre obd max ioctl buffer bytes (default 8KB)" - depends on LUSTRE_FS - default 8192 - help - This option defines the maximum size of buffer in bytes that user space - applications can pass to Lustre kernel module through ioctl interface. - - If unsure, use default. - config LUSTRE_DEBUG_EXPENSIVE_CHECK bool "Enable Lustre DEBUG checks" depends on LUSTRE_FS diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index b2f5597..94af257 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -68,6 +68,8 @@ #include "../../../include/uapi/linux/lustre/lustre_ioctl.h" #include "../../../include/uapi/linux/lustre/lustre_ver.h" +#define OBD_MAX_IOCTL_BUFFER 8192 + static int obd_ioctl_is_invalid(struct obd_ioctl_data *data) { if (data->ioc_len > BIT(30)) { -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:45 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:45 -0400 Subject: [lustre-devel] [PATCH 51/64 v2] staging: lustre: mdc: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-52-git-send-email-jsimmons@infradead.org> Rationalize include paths in the mdc source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/mdc/Makefile | 3 +++ drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 22 ++++++++++---------- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_request.c | 26 ++++++++++++------------ 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/drivers/staging/lustre/lustre/mdc/Makefile b/drivers/staging/lustre/lustre/mdc/Makefile index 99ba9ff..c7bc335 100644 --- a/drivers/staging/lustre/lustre/mdc/Makefile +++ b/drivers/staging/lustre/lustre/mdc/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += mdc.o mdc-y := mdc_request.o mdc_reint.o mdc_lib.o mdc_locks.o lproc_mdc.o diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c index 51a7047..f685137 100644 --- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c +++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include #include "mdc_internal.h" static ssize_t active_show(struct kobject *kobj, struct attribute *attr, diff --git a/drivers/staging/lustre/lustre/mdc/mdc_internal.h b/drivers/staging/lustre/lustre/mdc/mdc_internal.h index fecedc88..cbf0115 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_internal.h +++ b/drivers/staging/lustre/lustre/mdc/mdc_internal.h @@ -33,7 +33,7 @@ #ifndef _MDC_INTERNAL_H #define _MDC_INTERNAL_H -#include "../include/lustre_mdc.h" +#include void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index bfd8fbe..ba13f089 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -31,8 +31,8 @@ */ #define DEBUG_SUBSYSTEM S_MDC -#include "../include/lustre_net.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #include "mdc_internal.h" static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index ae97c6f..cbfea3d 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -32,17 +32,17 @@ #define DEBUG_SUBSYSTEM S_MDC -# include - -#include "../include/lustre_intent.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_mdc.h" -#include "../include/lustre_net.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_swab.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "mdc_internal.h" diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c index 2287bd4..f45c91d 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c @@ -35,9 +35,9 @@ # include # include -#include "../include/obd_class.h" +#include #include "mdc_internal.h" -#include "../include/lustre_fid.h" +#include /* mdc_setattr does its own semaphore handling */ static int mdc_reint(struct ptlrpc_request *request, int level) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 3556307..6ef8dde 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -38,19 +38,19 @@ # include # include -#include "../include/lustre_errno.h" -#include "../include/cl_object.h" -#include "../include/llog_swab.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_acl.h" -#include "../include/lustre_fid.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_kernelcomm.h" -#include "../include/lustre_lmv.h" -#include "../include/lustre_log.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_swab.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "mdc_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:48 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:48 -0400 Subject: [lustre-devel] [PATCH 54/64 v2] staging: lustre: obdecho: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-55-git-send-email-jsimmons@infradead.org> Rationalize include paths in the obdecho source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/obdecho/Makefile | 3 +++ .../staging/lustre/lustre/obdecho/echo_client.c | 24 +++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdecho/Makefile b/drivers/staging/lustre/lustre/obdecho/Makefile index a659a37..6be66fb 100644 --- a/drivers/staging/lustre/lustre/obdecho/Makefile +++ b/drivers/staging/lustre/lustre/obdecho/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += obdecho.o obdecho-y := echo_client.o diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 3f28db3..f9808d1 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -31,18 +31,18 @@ */ #define DEBUG_SUBSYSTEM S_ECHO -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/obd.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_debug.h" -#include "../include/lprocfs_status.h" -#include "../include/cl_object.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_acl.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_net.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "echo_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:50 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:50 -0400 Subject: [lustre-devel] [PATCH 56/64 v2] staging: lustre: lustre: cleanup paths for lustre internal headers In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-57-git-send-email-jsimmons@infradead.org> Rationalize include paths for the lustre internal headers Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/cl_object.h | 4 +-- drivers/staging/lustre/lustre/include/llog_swab.h | 2 +- .../staging/lustre/lustre/include/lprocfs_status.h | 6 ++--- drivers/staging/lustre/lustre/include/lu_object.h | 6 ++--- .../staging/lustre/lustre/include/lustre_compat.h | 2 +- .../staging/lustre/lustre/include/lustre_debug.h | 4 +-- .../staging/lustre/lustre/include/lustre_disk.h | 4 ++- drivers/staging/lustre/lustre/include/lustre_dlm.h | 12 ++++----- .../staging/lustre/lustre/include/lustre_export.h | 6 ++--- drivers/staging/lustre/lustre/include/lustre_fid.h | 8 +++--- drivers/staging/lustre/lustre/include/lustre_fld.h | 6 ++--- .../staging/lustre/lustre/include/lustre_handles.h | 2 +- .../staging/lustre/lustre/include/lustre_import.h | 4 +-- .../lustre/lustre/include/lustre_kernelcomm.h | 2 +- drivers/staging/lustre/lustre/include/lustre_lib.h | 12 ++++----- drivers/staging/lustre/lustre/include/lustre_lmv.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 4 +-- drivers/staging/lustre/lustre/include/lustre_mdc.h | 14 +++++----- drivers/staging/lustre/lustre/include/lustre_mds.h | 10 ++++---- drivers/staging/lustre/lustre/include/lustre_net.h | 30 +++++++++++----------- drivers/staging/lustre/lustre/include/lustre_nrs.h | 2 +- .../staging/lustre/lustre/include/lustre_obdo.h | 2 +- .../staging/lustre/lustre/include/lustre_swab.h | 2 +- drivers/staging/lustre/lustre/include/obd.h | 18 ++++++------- drivers/staging/lustre/lustre/include/obd_cksum.h | 6 ++--- drivers/staging/lustre/lustre/include/obd_class.h | 12 ++++----- .../staging/lustre/lustre/include/obd_support.h | 6 ++--- drivers/staging/lustre/lustre/include/seq_range.h | 2 +- 28 files changed, 96 insertions(+), 94 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 6887b81..9ba184b 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -88,8 +88,8 @@ /* * super-class definitions. */ -#include "lu_object.h" -#include "lustre_compat.h" +#include +#include #include #include #include diff --git a/drivers/staging/lustre/lustre/include/llog_swab.h b/drivers/staging/lustre/lustre/include/llog_swab.h index 25516d3..925271d 100644 --- a/drivers/staging/lustre/lustre/include/llog_swab.h +++ b/drivers/staging/lustre/lustre/include/llog_swab.h @@ -48,7 +48,7 @@ #ifndef _LLOG_SWAB_H_ #define _LLOG_SWAB_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include struct lustre_cfg; diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index f5abca8..98d6b13 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -43,9 +43,9 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_cfg.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include +#include struct lprocfs_vars { const char *name; diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index ea77d9c..4f213c4 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -35,9 +35,9 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lu_ref.h" +#include +#include +#include struct seq_file; struct lustre_cfg; diff --git a/drivers/staging/lustre/lustre/include/lustre_compat.h b/drivers/staging/lustre/lustre/include/lustre_compat.h index da9ce19..69bfd6a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_compat.h +++ b/drivers/staging/lustre/lustre/include/lustre_compat.h @@ -37,7 +37,7 @@ #include #include -#include "lustre_patchless_compat.h" +#include /* * set ATTR_BLOCKS to a high value to avoid any risk of collision with other diff --git a/drivers/staging/lustre/lustre/include/lustre_debug.h b/drivers/staging/lustre/lustre/include/lustre_debug.h index 93c1bda..0be6a53 100644 --- a/drivers/staging/lustre/lustre/include/lustre_debug.h +++ b/drivers/staging/lustre/lustre/include/lustre_debug.h @@ -38,8 +38,8 @@ * @{ */ -#include "lustre_net.h" -#include "obd.h" +#include +#include /* lib/debug.c */ int dump_req(struct ptlrpc_request *req); diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index 05cdc66..2d862b3 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -44,8 +44,10 @@ * @{ */ -#include "../../include/linux/libcfs/libcfs.h" +#include +#include #include +#include /****************** persistent mount data *********************/ diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index eb2de13..13c3d2f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -44,12 +44,12 @@ #ifndef _LUSTRE_DLM_H__ #define _LUSTRE_DLM_H__ -#include "lustre_lib.h" -#include "lustre_net.h" -#include "lustre_import.h" -#include "lustre_handles.h" -#include "interval_tree.h" /* for interval_node{}, ldlm_extent */ -#include "lu_ref.h" +#include +#include +#include +#include +#include /* for interval_node{}, ldlm_extent */ +#include #include "lustre_dlm_flags.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 3502d15..3631a69 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -42,9 +42,9 @@ * @{ */ -#include "lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lustre_dlm.h" +#include +#include +#include enum obd_option { OBD_OPT_FORCE = 0x0001, diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 8998a34..e0f2b82 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -148,10 +148,10 @@ * Even so, the MDT and OST resources are also in different LDLM namespaces. */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_fid.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/uapi/linux/lustre/lustre_ostid.h" +#include +#include +#include +#include struct lu_env; struct lu_site; diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index e335d88..6125eb0 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -38,9 +38,9 @@ * @{ */ -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/linux/libcfs/libcfs.h" -#include "seq_range.h" +#include +#include +#include struct lu_client_fld; struct lu_server_fld; diff --git a/drivers/staging/lustre/lustre/include/lustre_handles.h b/drivers/staging/lustre/lustre/include/lustre_handles.h index e071bac..d499326 100644 --- a/drivers/staging/lustre/lustre/include/lustre_handles.h +++ b/drivers/staging/lustre/lustre/include/lustre_handles.h @@ -44,7 +44,7 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" +#include struct portals_handle_ops { void (*hop_addref)(void *object); diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index 0b54e28..d71d047 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -43,8 +43,8 @@ * @{ */ -#include "lustre_handles.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include /** * Adaptive Timeout stuff diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h index c06648f..f1899a3d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h @@ -38,7 +38,7 @@ #define __LUSTRE_KERNELCOMM_H__ /* For declarations shared with userspace */ -#include "../../include/uapi/linux/lustre/lustre_kernelcomm.h" +#include /* prototype for callback function on kuc groups */ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index a7a184f..81b9cbf 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -45,18 +45,18 @@ #include #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../../include/uapi/linux/lustre/lustre_cfg.h" +#include +#include +#include +#include /* target.c */ struct ptlrpc_request; struct obd_export; struct lu_target; struct l_wait_info; -#include "lustre_ha.h" -#include "lustre_net.h" +#include +#include #define LI_POISON 0x5a5a5a5a #if BITS_PER_LONG > 32 diff --git a/drivers/staging/lustre/lustre/include/lustre_lmv.h b/drivers/staging/lustre/lustre/include/lustre_lmv.h index f2b8574..98a82be2 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lmv.h +++ b/drivers/staging/lustre/lustre/include/lustre_lmv.h @@ -32,7 +32,7 @@ #ifndef _LUSTRE_LMV_H #define _LUSTRE_LMV_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include struct lmv_oinfo { struct lu_fid lmo_fid; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 70fdc0b..24a7777 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -52,8 +52,8 @@ * @{ */ -#include "obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #define LOG_NAME_LIMIT(logname, name) \ snprintf(logname, sizeof(logname), "LOGS/%s", name) diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h index 99abbde..c0c4497 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mdc.h +++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h @@ -46,13 +46,13 @@ #include #include -#include "lustre_intent.h" -#include "lustre_handles.h" -#include "../../include/linux/libcfs/libcfs.h" -#include "obd_class.h" -#include "lustre_lib.h" -#include "lustre_dlm.h" -#include "lustre_export.h" +#include +#include +#include +#include +#include +#include +#include struct ptlrpc_client; struct obd_export; diff --git a/drivers/staging/lustre/lustre/include/lustre_mds.h b/drivers/staging/lustre/lustre/include/lustre_mds.h index 2a552ee..c424e12 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mds.h +++ b/drivers/staging/lustre/lustre/include/lustre_mds.h @@ -43,11 +43,11 @@ * @{ */ -#include "lustre_handles.h" -#include "../../include/linux/libcfs/libcfs.h" -#include "lustre_lib.h" -#include "lustre_dlm.h" -#include "lustre_export.h" +#include +#include +#include +#include +#include struct mds_group_info { struct obd_uuid *uuid; diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index bc18131..c6d1646 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -51,20 +51,20 @@ */ #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lnet/nidstr.h" -#include "../../include/linux/lnet/api.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lustre_errno.h" -#include "lustre_ha.h" -#include "lustre_sec.h" -#include "lustre_import.h" -#include "lprocfs_status.h" -#include "lu_object.h" -#include "lustre_req_layout.h" - -#include "obd_support.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include /* MD flags we _always_ use */ #define PTLRPC_MD_OPTIONS 0 @@ -522,7 +522,7 @@ struct ptlrpc_request_pool { struct ldlm_lock; -#include "lustre_nrs.h" +#include /** * Basic request prioritization operations structure. diff --git a/drivers/staging/lustre/lustre/include/lustre_nrs.h b/drivers/staging/lustre/lustre/include/lustre_nrs.h index a5028aa..51f45f7 100644 --- a/drivers/staging/lustre/lustre/include/lustre_nrs.h +++ b/drivers/staging/lustre/lustre/include/lustre_nrs.h @@ -669,7 +669,7 @@ enum { NRS_RES_MAX }; -#include "lustre_nrs_fifo.h" +#include /** * NRS request diff --git a/drivers/staging/lustre/lustre/include/lustre_obdo.h b/drivers/staging/lustre/lustre/include/lustre_obdo.h index 252191d..53379f8 100644 --- a/drivers/staging/lustre/lustre/include/lustre_obdo.h +++ b/drivers/staging/lustre/lustre/include/lustre_obdo.h @@ -35,7 +35,7 @@ #ifndef _LUSTRE_OBDO_H_ #define _LUSTRE_OBDO_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include /** * Create an obdo to send over the wire diff --git a/drivers/staging/lustre/lustre/include/lustre_swab.h b/drivers/staging/lustre/lustre/include/lustre_swab.h index 9e13afd..765e923 100644 --- a/drivers/staging/lustre/lustre/include/lustre_swab.h +++ b/drivers/staging/lustre/lustre/include/lustre_swab.h @@ -48,7 +48,7 @@ #ifndef _LUSTRE_SWAB_H_ #define _LUSTRE_SWAB_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); void lustre_swab_connect(struct obd_connect_data *ocd); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index aedc550..a986737 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -35,15 +35,15 @@ #include -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "lustre_lib.h" -#include "lu_ref.h" -#include "lustre_export.h" -#include "lustre_fid.h" -#include "lustre_fld.h" -#include "lustre_handles.h" -#include "lustre_intent.h" -#include "cl_object.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #define MAX_OBD_DEVICES 8192 diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h b/drivers/staging/lustre/lustre/include/obd_cksum.h index 54bde73..cda3d28 100644 --- a/drivers/staging/lustre/lustre/include/obd_cksum.h +++ b/drivers/staging/lustre/lustre/include/obd_cksum.h @@ -30,9 +30,9 @@ #ifndef __OBD_CKSUM #define __OBD_CKSUM -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/libcfs/libcfs_crypto.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include +#include static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type) { diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 6ae6479..976005a 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -32,12 +32,12 @@ #ifndef __CLASS_OBD_H #define __CLASS_OBD_H -#include "obd_support.h" -#include "lustre_import.h" -#include "lustre_net.h" -#include "obd.h" -#include "lustre_lib.h" -#include "lprocfs_status.h" +#include +#include +#include +#include +#include +#include #define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay * and resends for avoid deadlocks diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index 3330404..aea193a 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -36,9 +36,9 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "lustre_compat.h" -#include "lprocfs_status.h" +#include +#include +#include /* global variables */ extern unsigned int obd_debug_peer_on_timeout; diff --git a/drivers/staging/lustre/lustre/include/seq_range.h b/drivers/staging/lustre/lustre/include/seq_range.h index 74a9c63..d717548 100644 --- a/drivers/staging/lustre/lustre/include/seq_range.h +++ b/drivers/staging/lustre/lustre/include/seq_range.h @@ -34,7 +34,7 @@ #ifndef _SEQ_RANGE_H_ #define _SEQ_RANGE_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include /** * computes the sequence range type \a range -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:52 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:52 -0400 Subject: [lustre-devel] [PATCH 58/64 v2] staging: lustre: lnet: selftest: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-59-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lnet selftest source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/selftest/Makefile | 3 +++ drivers/staging/lustre/lnet/selftest/conctl.c | 6 +++--- drivers/staging/lustre/lnet/selftest/conrpc.c | 4 ++-- drivers/staging/lustre/lnet/selftest/conrpc.h | 6 +++--- drivers/staging/lustre/lnet/selftest/console.c | 4 ++-- drivers/staging/lustre/lnet/selftest/console.h | 6 +++--- drivers/staging/lustre/lnet/selftest/rpc.h | 2 +- drivers/staging/lustre/lnet/selftest/selftest.h | 8 ++++---- 8 files changed, 21 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/Makefile b/drivers/staging/lustre/lnet/selftest/Makefile index c0de6e2..3ccc896 100644 --- a/drivers/staging/lustre/lnet/selftest/Makefile +++ b/drivers/staging/lustre/lnet/selftest/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET_SELFTEST) := lnet_selftest.o lnet_selftest-y := console.o conrpc.o conctl.o framework.o timer.o rpc.o \ diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 106304e..9619ecb 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -36,9 +36,9 @@ * Author: Liang Zhen */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include #include "console.h" static int diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index ae7c277..196d23c 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -36,8 +36,8 @@ * Author: Liang Zhen */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" +#include +#include #include "timer.h" #include "conrpc.h" #include "console.h" diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h index 501e1ec..2393236 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.h +++ b/drivers/staging/lustre/lnet/selftest/conrpc.h @@ -39,9 +39,9 @@ #ifndef __LST_CONRPC_H__ #define __LST_CONRPC_H__ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-types.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include #include "rpc.h" #include "selftest.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index d62c448..289b202 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -36,8 +36,8 @@ * Author: Liang Zhen */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" +#include +#include #include "console.h" #include "conrpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index d806214..143eae9 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -39,9 +39,9 @@ #ifndef __LST_CONSOLE_H__ #define __LST_CONSOLE_H__ -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-types.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include #include "selftest.h" #include "conrpc.h" diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h index 217ca21..7bb442a 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.h +++ b/drivers/staging/lustre/lnet/selftest/rpc.h @@ -33,7 +33,7 @@ #ifndef __SELFTEST_RPC_H__ #define __SELFTEST_RPC_H__ -#include "../../include/uapi/linux/lnet/lnetst.h" +#include /* * LST wired structures diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index 3777023..7adad43 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -38,10 +38,10 @@ #define LNET_ONLY -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/linux/lnet/lib-types.h" -#include "../../include/uapi/linux/lnet/lnetst.h" +#include +#include +#include +#include #include "rpc.h" #include "timer.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:56 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:56 -0400 Subject: [lustre-devel] [PATCH 62/64 v2] staging: lustre: libcfs: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-63-git-send-email-jsimmons@infradead.org> Rationalize include paths in the libcfs source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/Makefile | 3 +++ drivers/staging/lustre/lnet/libcfs/debug.c | 2 +- drivers/staging/lustre/lnet/libcfs/fail.c | 2 +- drivers/staging/lustre/lnet/libcfs/hash.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_mem.c | 2 +- drivers/staging/lustre/lnet/libcfs/libcfs_string.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c | 4 ++-- drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-module.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/module.c | 8 ++++---- drivers/staging/lustre/lnet/libcfs/prng.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 2 +- drivers/staging/lustre/lnet/libcfs/tracefile.h | 2 +- drivers/staging/lustre/lnet/libcfs/workitem.c | 2 +- 21 files changed, 27 insertions(+), 24 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/Makefile b/drivers/staging/lustre/lnet/libcfs/Makefile index 8c89455..215fa23 100644 --- a/drivers/staging/lustre/lnet/libcfs/Makefile +++ b/drivers/staging/lustre/lnet/libcfs/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET) += libcfs.o libcfs-linux-objs := linux-tracefile.o linux-debug.o diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 49deb44..1ab394c 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -37,7 +37,7 @@ # define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include #include "tracefile.h" static char debug_file_name[1024]; diff --git a/drivers/staging/lustre/lnet/libcfs/fail.c b/drivers/staging/lustre/lnet/libcfs/fail.c index 12dd50a..24f4701 100644 --- a/drivers/staging/lustre/lnet/libcfs/fail.c +++ b/drivers/staging/lustre/lnet/libcfs/fail.c @@ -29,7 +29,7 @@ * Lustre is a trademark of Oracle Corporation, Inc. */ -#include "../../include/linux/libcfs/libcfs.h" +#include unsigned long cfs_fail_loc; EXPORT_SYMBOL(cfs_fail_loc); diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index ff54eaf..49a04a2 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -105,7 +105,7 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" +#include #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1 static unsigned int warn_on_depth = 8; diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c index 55caa19..2ddd09a 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c @@ -30,7 +30,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include /** Global CPU partition table */ struct cfs_cpt_table *cfs_cpt_table __read_mostly; diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c index 1967b97..77fd3d06 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c @@ -27,7 +27,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include /** destroy cpu-partition lock, see libcfs_private.h for more detail */ void diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c b/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c index ef085ba..1a0c7ca 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c @@ -28,7 +28,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include struct cfs_var_array { unsigned int va_count; /* # of buffers */ diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_string.c b/drivers/staging/lustre/lnet/libcfs/libcfs_string.c index 02de1ee..333e47f 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_string.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_string.c @@ -36,7 +36,7 @@ * Author: Nathan Rutman */ -#include "../../include/linux/libcfs/libcfs.h" +#include /* Convert a text string to a bitmask */ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c index 4d35a37..2da051c 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -31,7 +31,7 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" +#include #ifdef CONFIG_SMP diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c index 68e34b4..5566339 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c @@ -29,8 +29,8 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/libcfs/libcfs_crypto.h" +#include +#include #include "linux-crypto.h" /** diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c index 3e22cad..528d497 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c @@ -44,7 +44,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../../include/linux/libcfs/libcfs.h" +#include /* * Implementation of cfs_curproc API (see portals/include/libcfs/curproc.h) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c index 7035356..972677b 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c @@ -51,7 +51,7 @@ # define DEBUG_SUBSYSTEM S_LNET -#include "../../../include/linux/libcfs/libcfs.h" +#include #include "../tracefile.h" diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c index 8f63826..3f5dec1 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c @@ -29,7 +29,7 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" +#include void *libcfs_kvzalloc(size_t size, gfp_t flags) { diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c index c6837bc..4357221 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c @@ -32,7 +32,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../../include/linux/libcfs/libcfs.h" +#include #define LNET_MINOR 240 diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c index bcf9f3d..4e331e7 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c @@ -36,7 +36,7 @@ #include #include -#include "../../../include/linux/libcfs/libcfs.h" +#include #if defined(CONFIG_KGDB) #include diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c index a5a9478..16a3ae7 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c @@ -33,7 +33,7 @@ #define DEBUG_SUBSYSTEM S_LNET #define LUSTRE_TRACEFILE_PRIVATE -#include "../../../include/linux/libcfs/libcfs.h" +#include #include "../tracefile.h" /* percents to share the total debug memory for each type */ diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c index 657c495..6aed98f 100644 --- a/drivers/staging/lustre/lnet/libcfs/module.c +++ b/drivers/staging/lustre/lnet/libcfs/module.c @@ -50,12 +50,12 @@ # define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../../include/linux/libcfs/libcfs_crypto.h" -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" +#include +#include +#include #include "tracefile.h" static struct dentry *lnet_debugfs_root; diff --git a/drivers/staging/lustre/lnet/libcfs/prng.c b/drivers/staging/lustre/lnet/libcfs/prng.c index 21d5a39..963ef4a 100644 --- a/drivers/staging/lustre/lnet/libcfs/prng.c +++ b/drivers/staging/lustre/lnet/libcfs/prng.c @@ -35,7 +35,7 @@ * algorithm recommended by Marsaglia */ -#include "../../include/linux/libcfs/libcfs.h" +#include /* * From: George Marsaglia diff --git a/drivers/staging/lustre/lnet/libcfs/tracefile.c b/drivers/staging/lustre/lnet/libcfs/tracefile.c index d1aa79b..68f283a 100644 --- a/drivers/staging/lustre/lnet/libcfs/tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/tracefile.c @@ -40,7 +40,7 @@ #define pr_fmt(fmt) "Lustre: " fmt #include "tracefile.h" -#include "../../include/linux/libcfs/libcfs.h" +#include /* XXX move things up to the top, comment */ union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline_aligned; diff --git a/drivers/staging/lustre/lnet/libcfs/tracefile.h b/drivers/staging/lustre/lnet/libcfs/tracefile.h index f644cbc..c3547cd 100644 --- a/drivers/staging/lustre/lnet/libcfs/tracefile.h +++ b/drivers/staging/lustre/lnet/libcfs/tracefile.h @@ -33,7 +33,7 @@ #ifndef __LIBCFS_TRACEFILE_H__ #define __LIBCFS_TRACEFILE_H__ -#include "../../include/linux/libcfs/libcfs.h" +#include enum cfs_trace_buf_type { CFS_TCD_TYPE_PROC = 0, diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index dbc2a9b..038ed8c 100644 --- a/drivers/staging/lustre/lnet/libcfs/workitem.c +++ b/drivers/staging/lustre/lnet/libcfs/workitem.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" +#include #define CFS_WS_NAME_LEN 16 -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:38 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:38 -0400 Subject: [lustre-devel] [PATCH 44/64 v2] staging: lustre: uapi: remove BIT macro from UAPI headers In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-45-git-send-email-jsimmons@infradead.org> The BIT macro is not available for UAPI headers so remove it from the lustre UAPI headers. Signed-off-by: James Simmons --- .../lustre/include/uapi/linux/lustre/lustre_idl.h | 38 +++++++++++----------- .../lustre/include/uapi/linux/lustre/lustre_user.h | 12 +++---- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index 9613f7c..cc59c1a 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -1554,8 +1554,8 @@ enum mds_op_bias { MDS_CREATE_VOLATILE = 1 << 10, MDS_OWNEROVERRIDE = 1 << 11, MDS_HSM_RELEASE = 1 << 12, - MDS_RENAME_MIGRATE = BIT(13), - MDS_CLOSE_LAYOUT_SWAP = BIT(14), + MDS_RENAME_MIGRATE = 1 << 13, + MDS_CLOSE_LAYOUT_SWAP = 1 << 14, }; /* instance of mdt_reint_rec */ @@ -1993,21 +1993,21 @@ struct ldlm_flock_wire { }; enum ldlm_intent_flags { - IT_OPEN = BIT(0), - IT_CREAT = BIT(1), - IT_OPEN_CREAT = BIT(1) | BIT(0), - IT_READDIR = BIT(2), - IT_GETATTR = BIT(3), - IT_LOOKUP = BIT(4), - IT_UNLINK = BIT(5), - IT_TRUNC = BIT(6), - IT_GETXATTR = BIT(7), - IT_EXEC = BIT(8), - IT_PIN = BIT(9), - IT_LAYOUT = BIT(10), - IT_QUOTA_DQACQ = BIT(11), - IT_QUOTA_CONN = BIT(12), - IT_SETXATTR = BIT(13), + IT_OPEN = 0x00000001, + IT_CREAT = 0x00000002, + IT_OPEN_CREAT = 0x00000003, + IT_READDIR = 0x00000004, + IT_GETATTR = 0x00000008, + IT_LOOKUP = 0x00000010, + IT_UNLINK = 0x00000020, + IT_TRUNC = 0x00000040, + IT_GETXATTR = 0x00000080, + IT_EXEC = 0x00000100, + IT_PIN = 0x00000200, + IT_LAYOUT = 0x00000400, + IT_QUOTA_DQACQ = 0x00000800, + IT_QUOTA_CONN = 0x00001000, + IT_SETXATTR = 0x00002000, }; struct ldlm_intent { @@ -2375,8 +2375,8 @@ enum llog_flag { LLOG_F_ZAP_WHEN_EMPTY = 0x1, LLOG_F_IS_CAT = 0x2, LLOG_F_IS_PLAIN = 0x4, - LLOG_F_EXT_JOBID = BIT(3), - LLOG_F_IS_FIXSIZE = BIT(4), + LLOG_F_EXT_JOBID = 0x8, + LLOG_F_IS_FIXSIZE = 0x10, /* * Note: Flags covered by LLOG_F_EXT_MASK will be inherited from diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h index ca720f1..2fcfe2b 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h @@ -645,7 +645,7 @@ struct if_quotactl { #define SWAP_LAYOUTS_CHECK_DV2 (1 << 1) #define SWAP_LAYOUTS_KEEP_MTIME (1 << 2) #define SWAP_LAYOUTS_KEEP_ATIME (1 << 3) -#define SWAP_LAYOUTS_CLOSE BIT(4) +#define SWAP_LAYOUTS_CLOSE (1 << 4) /* Swap XATTR_NAME_HSM as well, only on the MDT so far */ #define SWAP_LAYOUTS_MDS_HSM (1 << 31) @@ -792,15 +792,15 @@ static inline void hsm_set_cl_error(int *flags, int error) enum changelog_send_flag { /* Not yet implemented */ - CHANGELOG_FLAG_FOLLOW = BIT(0), + CHANGELOG_FLAG_FOLLOW = 0x01, /* * Blocking IO makes sense in case of slow user parsing of the records, * but it also prevents us from cleaning up if the records are not * consumed. */ - CHANGELOG_FLAG_BLOCK = BIT(1), + CHANGELOG_FLAG_BLOCK = 0x02, /* Pack jobid into the changelog records if available. */ - CHANGELOG_FLAG_JOBID = BIT(2), + CHANGELOG_FLAG_JOBID = 0x04, }; #define CR_MAXSIZE cfs_size_round(2 * NAME_MAX + 2 + \ @@ -981,8 +981,8 @@ struct ioc_data_version { __u64 idv_flags; /* See LL_DV_xxx */ }; -#define LL_DV_RD_FLUSH BIT(0) /* Flush dirty pages from clients */ -#define LL_DV_WR_FLUSH BIT(1) /* Flush all caching pages from clients */ +#define LL_DV_RD_FLUSH (1 << 0) /* Flush dirty pages from clients */ +#define LL_DV_WR_FLUSH (1 << 1) /* Flush all caching pages from clients */ #ifndef offsetof # define offsetof(typ, memb) ((unsigned long)((char *)&(((typ *)0)->memb))) -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:39 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:39 -0400 Subject: [lustre-devel] [PATCH 45/64 v2] staging: lustre: fid: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-46-git-send-email-jsimmons@infradead.org> Start to rationalize include paths in the fid source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/fid/Makefile | 3 +++ drivers/staging/lustre/lustre/fid/fid_internal.h | 4 ++-- drivers/staging/lustre/lustre/fid/fid_lib.c | 4 ++-- drivers/staging/lustre/lustre/fid/fid_request.c | 12 ++++++------ drivers/staging/lustre/lustre/fid/lproc_fid.c | 12 ++++++------ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lustre/fid/Makefile b/drivers/staging/lustre/lustre/fid/Makefile index b7ef314..77b65b9 100644 --- a/drivers/staging/lustre/lustre/fid/Makefile +++ b/drivers/staging/lustre/lustre/fid/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/ + obj-$(CONFIG_LUSTRE_FS) += fid.o fid-y := fid_request.o fid_lib.o lproc_fid.o diff --git a/drivers/staging/lustre/lustre/fid/fid_internal.h b/drivers/staging/lustre/lustre/fid/fid_internal.h index 5f8d15b..f48ab9d 100644 --- a/drivers/staging/lustre/lustre/fid/fid_internal.h +++ b/drivers/staging/lustre/lustre/fid/fid_internal.h @@ -36,8 +36,8 @@ #ifndef __FID_INTERNAL_H #define __FID_INTERNAL_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/linux/libcfs/libcfs.h" +#include +#include /* Functions used internally in module. */ diff --git a/drivers/staging/lustre/lustre/fid/fid_lib.c b/drivers/staging/lustre/lustre/fid/fid_lib.c index 6ab06ef..c21a5f5 100644 --- a/drivers/staging/lustre/lustre/fid/fid_lib.c +++ b/drivers/staging/lustre/lustre/fid/fid_lib.c @@ -39,9 +39,9 @@ #define DEBUG_SUBSYSTEM S_FID -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/lustre_fid.h" +#include /** * A cluster-wide range from which fid-sequences are granted to servers and diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index 19895fa..ba73623 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -38,15 +38,15 @@ #define DEBUG_SUBSYSTEM S_FID -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" +#include +#include +#include +#include /* mdc RPC locks */ -#include "../include/lustre_mdc.h" +#include #include "fid_internal.h" static struct dentry *seq_debugfs_dir; diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c index 3eed838..1a269fb 100644 --- a/drivers/staging/lustre/lustre/fid/lproc_fid.c +++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c @@ -38,14 +38,14 @@ #define DEBUG_SUBSYSTEM S_FID -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_req_layout.h" -#include "../include/lustre_fid.h" +#include +#include +#include +#include +#include #include "fid_internal.h" /* Format: [0x64BIT_INT - 0x64BIT_INT] + 32 bytes just in case */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:58 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:58 -0400 Subject: [lustre-devel] [PATCH 64/64 v2] staging: lustre: lnet: cleanup paths for all LNet headers In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-65-git-send-email-jsimmons@infradead.org> Rationalize include paths in all the lnet header files. Signed-off-by: James Simmons --- drivers/staging/lustre/include/linux/lnet/api.h | 2 +- drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 14 +++++++------- drivers/staging/lustre/include/linux/lnet/lib-types.h | 4 ++-- drivers/staging/lustre/include/linux/lnet/socklnd.h | 4 ++-- drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h | 4 ++-- drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h | 2 +- drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h index 01ae62e..9c37f3e 100644 --- a/drivers/staging/lustre/include/linux/lnet/api.h +++ b/drivers/staging/lustre/include/linux/lnet/api.h @@ -44,7 +44,7 @@ * @{ */ -#include "../../uapi/linux/lnet/lnet-types.h" +#include /** \defgroup lnet_init_fini Initialization and cleanup * The LNet must be properly initialized before any LNet calls can be made. diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index bc55d57..e0968ab 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -35,13 +35,13 @@ #ifndef __LNET_LIB_LNET_H__ #define __LNET_LIB_LNET_H__ -#include "../libcfs/libcfs.h" -#include "api.h" -#include "lib-types.h" -#include "../../uapi/linux/lnet/lnet-dlc.h" -#include "../../uapi/linux/lnet/lnet-types.h" -#include "../../uapi/linux/lnet/lnetctl.h" -#include "../../uapi/linux/lnet/nidstr.h" +#include +#include +#include +#include +#include +#include +#include extern struct lnet the_lnet; /* THE network */ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 94d3a53..eea3b8e 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -40,8 +40,8 @@ #include #include -#include "../../uapi/linux/lnet/lnet-types.h" -#include "../../uapi/linux/lnet/lnetctl.h" +#include +#include /* Max payload size */ #define LNET_MAX_PAYLOAD CONFIG_LNET_MAX_PAYLOAD diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h index c24fe45..553fb64 100644 --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h @@ -34,8 +34,8 @@ #ifndef __LNET_LNET_SOCKLND_H__ #define __LNET_LNET_SOCKLND_H__ -#include "../../uapi/linux/lnet/lnet-types.h" -#include "../../uapi/linux/lnet/socklnd.h" +#include +#include struct ksock_hello_msg { __u32 kshm_magic; /* magic number of socklnd message */ diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h index a3821d9..e45d828 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h @@ -29,8 +29,8 @@ #ifndef LNET_DLC_H #define LNET_DLC_H -#include "libcfs_ioctl.h" -#include "lnet-types.h" +#include +#include #define MAX_NUM_SHOW_ENTRIES 32 #define LNET_MAX_STR_LEN 128 diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h index f7ffc53..d9da625 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnetctl.h @@ -15,7 +15,7 @@ #ifndef _LNETCTL_H_ #define _LNETCTL_H_ -#include "lnet-types.h" +#include /** \addtogroup lnet_fault_simulation * @{ diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h index d153c97..882074e 100644 --- a/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h +++ b/drivers/staging/lustre/include/uapi/linux/lnet/nidstr.h @@ -28,7 +28,7 @@ #ifndef _LNET_NIDSTRINGS_H #define _LNET_NIDSTRINGS_H -#include "lnet-types.h" +#include /** * Lustre Network Driver types. -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:25:58 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:25:58 -0400 Subject: [lustre-devel] [PATCH 04/64 v2] staging: lustre: uapi: update URL doc link in lustre_fid.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-5-git-send-email-jsimmons@infradead.org> From: Ben Evans The wiki has been revived so update the URL about the FID design in lustre_fid.h. Signed-off-by: Ben Evans Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/22712 Reviewed-on: https://review.whamcloud.com/24569 Reviewed-by: James Simmons Reviewed-by: Frank Zago Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 681f698..0446bec 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -41,7 +41,7 @@ * * @{ * - * http://wiki.old.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs + * http://wiki.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs * describes the FID namespace and interoperability requirements for FIDs. * The important parts of that document are included here for reference. * -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:16 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:16 -0400 Subject: [lustre-devel] [PATCH 22/64 v2] staging: lustre: uapi: don't memory allocate in UAPI header In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-23-git-send-email-jsimmons@infradead.org> The inline function lustre_cfg_new() calls kzalloc() but this is a UAPI header. Remove kzalloc() and rename the function to lustre_cfg_init(). The lustre kernel code that was calling lustre_cfg_new() can doing the memory allocation and pass the new buffer to lustre_cfg_init() to fill in. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/26966 Reviewed-by: Quentin Bouget Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/lustre_cfg.h | 11 ++-------- drivers/staging/lustre/lustre/mgc/mgc_request.c | 9 +++++--- .../staging/lustre/lustre/obdclass/obd_config.c | 17 +++++++++++---- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 24 ++++++++++++++++++---- 4 files changed, 41 insertions(+), 20 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h index 3f280b5..9d6934b 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h @@ -222,18 +222,12 @@ static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens) #include "obd_support.h" -static inline struct lustre_cfg *lustre_cfg_new(int cmd, - struct lustre_cfg_bufs *bufs) +static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd, + struct lustre_cfg_bufs *bufs) { - struct lustre_cfg *lcfg; char *ptr; int i; - lcfg = kzalloc(lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen), - GFP_NOFS); - if (!lcfg) - return ERR_PTR(-ENOMEM); - lcfg->lcfg_version = LUSTRE_CFG_VERSION; lcfg->lcfg_command = cmd; lcfg->lcfg_bufcount = bufs->lcfg_bufcount; @@ -243,7 +237,6 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd, lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i]; LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr); } - return lcfg; } static inline int lustre_cfg_sanity_check(void *buf, size_t len) diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 192b24d..d344b01 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1155,6 +1155,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, char *cname; char *params; char *uuid; + size_t len; rc = -EINVAL; if (datalen < sizeof(*entry)) @@ -1283,11 +1284,13 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, lustre_cfg_bufs_set_string(&bufs, 1, params); rc = -ENOMEM; - lcfg = lustre_cfg_new(LCFG_PARAM, &bufs); - if (IS_ERR(lcfg)) { - CERROR("mgc: cannot allocate memory\n"); + len = lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen); + lcfg = kzalloc(len, GFP_NOFS); + if (!lcfg) { + rc = -ENOMEM; break; } + lustre_cfg_init(lcfg, LCFG_PARAM, &bufs); CDEBUG(D_INFO, "ir apply logs %lld/%lld for %s -> %s\n", prev_version, max_version, obdname, params); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 4b5cd7d..4c7c4f3 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1107,6 +1107,7 @@ int class_config_llog_handler(const struct lu_env *env, struct lustre_cfg_bufs bufs; char *inst_name = NULL; int inst_len = 0; + size_t lcfg_len; int inst = 0, swab = 0; lcfg = (struct lustre_cfg *)cfg_buf; @@ -1238,8 +1239,14 @@ int class_config_llog_handler(const struct lu_env *env, clli->cfg_obdname); } - lcfg_new = lustre_cfg_new(lcfg->lcfg_command, &bufs); + lcfg_len = lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen); + lcfg_new = kzalloc(lcfg_len, GFP_NOFS); + if (!lcfg_new) { + rc = -ENOMEM; + goto out; + } + lustre_cfg_init(lcfg_new, lcfg->lcfg_command, &bufs); lcfg_new->lcfg_num = lcfg->lcfg_num; lcfg_new->lcfg_flags = lcfg->lcfg_flags; @@ -1426,9 +1433,11 @@ int class_manual_cleanup(struct obd_device *obd) lustre_cfg_bufs_reset(&bufs, obd->obd_name); lustre_cfg_bufs_set_string(&bufs, 1, flags); - lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs); - if (IS_ERR(lcfg)) - return PTR_ERR(lcfg); + lcfg = kzalloc(lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen), + GFP_NOFS); + if (!lcfg) + return -ENOMEM; + lustre_cfg_init(lcfg, LCFG_CLEANUP, &bufs); rc = class_process_config(lcfg); if (rc) { diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 74de1fa..5094829 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -88,10 +88,17 @@ int lustre_process_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set_string(bufs, 1, logname); lustre_cfg_bufs_set(bufs, 2, cfg, sizeof(*cfg)); lustre_cfg_bufs_set(bufs, 3, &sb, sizeof(sb)); - lcfg = lustre_cfg_new(LCFG_LOG_START, bufs); + lcfg = kzalloc(lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen), + GFP_NOFS); + if (!lcfg) { + rc = -ENOMEM; + goto out; + } + lustre_cfg_init(lcfg, LCFG_LOG_START, bufs); + rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); kfree(lcfg); - +out: kfree(bufs); if (rc == -EINVAL) @@ -126,7 +133,12 @@ int lustre_end_log(struct super_block *sb, char *logname, lustre_cfg_bufs_set_string(&bufs, 1, logname); if (cfg) lustre_cfg_bufs_set(&bufs, 2, cfg, sizeof(*cfg)); - lcfg = lustre_cfg_new(LCFG_LOG_END, &bufs); + lcfg = kzalloc(lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen), + GFP_NOFS); + if (!lcfg) + return -ENOMEM; + lustre_cfg_init(lcfg, LCFG_LOG_END, &bufs); + rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); kfree(lcfg); return rc; @@ -158,7 +170,11 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, if (s4) lustre_cfg_bufs_set_string(&bufs, 4, s4); - lcfg = lustre_cfg_new(cmd, &bufs); + lcfg = kzalloc(lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen), + GFP_NOFS); + if (!lcfg) + return -ENOMEM; + lustre_cfg_init(lcfg, cmd, &bufs); lcfg->lcfg_nid = nid; rc = class_process_config(lcfg); kfree(lcfg); -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:37 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:37 -0400 Subject: [lustre-devel] [PATCH 43/64 v2] staging: lustre: uapi: use proper byteorder functions in lustre_idl.h In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-44-git-send-email-jsimmons@infradead.org> In order for lustre_idl.h to be usable for both user land and kernel space it has to use the proper byteorder functions. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: http://review.whamcloud.com/16916 Reviewed-by: Frank Zago Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Reviewed-by: John L. Hammond Signed-off-by: James Simmons --- .../staging/lustre/include/uapi/linux/lustre/lustre_idl.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index b7c1a1e..9613f7c 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -67,6 +67,7 @@ #ifndef _LUSTRE_IDL_H_ #define _LUSTRE_IDL_H_ +#include #include #include "../lnet/lnet-types.h" @@ -389,7 +390,7 @@ enum lu_dirpage_flags { static inline struct lu_dirent *lu_dirent_start(struct lu_dirpage *dp) { - if (le32_to_cpu(dp->ldp_flags) & LDF_EMPTY) + if (__le32_to_cpu(dp->ldp_flags) & LDF_EMPTY) return NULL; else return dp->ldp_entries; @@ -399,8 +400,8 @@ static inline struct lu_dirent *lu_dirent_next(struct lu_dirent *ent) { struct lu_dirent *next; - if (le16_to_cpu(ent->lde_reclen) != 0) - next = ((void *)ent) + le16_to_cpu(ent->lde_reclen); + if (__le16_to_cpu(ent->lde_reclen) != 0) + next = ((void *)ent) + __le16_to_cpu(ent->lde_reclen); else next = NULL; @@ -1840,11 +1841,11 @@ static inline ssize_t lmv_mds_md_size(int stripe_count, unsigned int lmm_magic) static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm) { - switch (le32_to_cpu(lmm->lmv_magic)) { + switch (__le32_to_cpu(lmm->lmv_magic)) { case LMV_MAGIC_V1: - return le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count); + return __le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count); case LMV_USER_MAGIC: - return le32_to_cpu(lmm->lmv_user_md.lum_stripe_count); + return __le32_to_cpu(lmm->lmv_user_md.lum_stripe_count); default: return -EINVAL; } -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:41 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:41 -0400 Subject: [lustre-devel] [PATCH 47/64 v2] staging: lustre: ptlrpc: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-48-git-send-email-jsimmons@infradead.org> Rationalize include paths in the ptlrpc/ldlm source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/ldlm/interval_tree.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/l_lock.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 12 ++++++------ drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 12 ++++++------ drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_plain.c | 6 +++--- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 8 ++++---- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/Makefile | 3 +++ drivers/staging/lustre/lustre/ptlrpc/client.c | 12 ++++++------ drivers/staging/lustre/lustre/ptlrpc/connection.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/errno.c | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/events.c | 8 ++++---- drivers/staging/lustre/lustre/ptlrpc/import.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/layout.c | 18 +++++++++--------- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 8 ++++---- drivers/staging/lustre/lustre/ptlrpc/llog_net.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 12 ++++++------ drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/pers.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 4 ++-- drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c | 8 ++++---- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 18 +++++++++--------- drivers/staging/lustre/lustre/ptlrpc/recover.c | 18 +++++++++--------- drivers/staging/lustre/lustre/ptlrpc/sec.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 20 ++++++++++---------- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 14 +++++++------- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 16 ++++++++-------- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 10 +++++----- drivers/staging/lustre/lustre/ptlrpc/service.c | 11 ++++++----- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 8 ++++---- 40 files changed, 202 insertions(+), 198 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/interval_tree.c b/drivers/staging/lustre/lustre/ldlm/interval_tree.c index 5bebd9a..19e285d 100644 --- a/drivers/staging/lustre/lustre/ldlm/interval_tree.c +++ b/drivers/staging/lustre/lustre/ldlm/interval_tree.c @@ -34,9 +34,9 @@ * Author: Huang Wei * Author: Jay Xiong */ -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/interval_tree.h" +#include +#include +#include enum { INTERVAL_RED = 0, diff --git a/drivers/staging/lustre/lustre/ldlm/l_lock.c b/drivers/staging/lustre/lustre/ldlm/l_lock.c index 3845f38..57fd84e 100644 --- a/drivers/staging/lustre/lustre/ldlm/l_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/l_lock.c @@ -31,10 +31,10 @@ */ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/lustre_dlm.h" -#include "../include/lustre_lib.h" +#include +#include /** * Lock a lock and its resource. diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c index 08f97e2..2cc6dc2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c @@ -46,12 +46,12 @@ */ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" +#include +#include +#include +#include +#include +#include #include "ldlm_internal.h" /* When a lock is cancelled by a client, the KMS may undergo change if this diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index b7f28b3..39433ac 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -52,10 +52,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" +#include +#include +#include +#include #include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c b/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c index ae37c36..fcb6e44 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c @@ -49,9 +49,9 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/lustre_lib.h" +#include +#include +#include #include "ldlm_internal.h" void ldlm_ibits_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index 4dc7bae..22600c2 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -39,12 +39,12 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include #include "ldlm_internal.h" /* @priority: If non-zero, move the selected connection to the list head. diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 181025d..b5d84f3 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -37,10 +37,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_intent.h" -#include "../include/lustre_swab.h" -#include "../include/obd_class.h" +#include +#include +#include +#include #include "ldlm_internal.h" /* lock types */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index e0c3e5d..895d07d 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -37,9 +37,9 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_class.h" +#include +#include +#include #include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c b/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c index 862ea0a..1ca605f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_plain.c @@ -48,9 +48,9 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/obd_support.h" -#include "../include/lustre_lib.h" +#include +#include +#include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index cf3fc57..d77bf0b 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -94,10 +94,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/cl_object.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include +#include +#include +#include #include "ldlm_internal.h" /* diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 5e04f05..d96a304 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -57,10 +57,10 @@ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_errno.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_class.h" -#include "../include/obd.h" +#include +#include +#include +#include #include "ldlm_internal.h" diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 4e805e7..c2ddf73 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -36,9 +36,9 @@ */ #define DEBUG_SUBSYSTEM S_LDLM -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/obd_class.h" +#include +#include +#include #include "ldlm_internal.h" struct kmem_cache *ldlm_resource_slab, *ldlm_lock_slab; diff --git a/drivers/staging/lustre/lustre/ptlrpc/Makefile b/drivers/staging/lustre/lustre/ptlrpc/Makefile index 24bbac1..a518001 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/Makefile +++ b/drivers/staging/lustre/lustre/ptlrpc/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += ptlrpc.o LDLM := ../../lustre/ldlm/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 977d7a6..b1d379a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -34,12 +34,12 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_import.h" -#include "../include/lustre_req_layout.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/connection.c b/drivers/staging/lustre/lustre/ptlrpc/connection.c index 73a2dbb..cfdcbcec 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/connection.c +++ b/drivers/staging/lustre/lustre/ptlrpc/connection.c @@ -31,9 +31,9 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/errno.c b/drivers/staging/lustre/lustre/ptlrpc/errno.c index faad8d8..cb78836 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/errno.c +++ b/drivers/staging/lustre/lustre/ptlrpc/errno.c @@ -25,8 +25,8 @@ * Copyright (c) 2013, Intel Corporation. */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_errno.h" +#include +#include /* * The two translation tables below must define a one-to-one mapping between diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c index 978bdac..62951f1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/events.c +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c @@ -32,14 +32,14 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" +#include # ifdef __mips64__ # include # endif -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include #include "ptlrpc_internal.h" struct lnet_handle_eq ptlrpc_eq_h; diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index b19dac1..21f5289 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -36,14 +36,14 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_export.h" -#include "../include/obd.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 6624c02..85854d9 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -46,18 +46,18 @@ #include -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include -#include "../include/llog_swab.h" -#include "../include/lustre_debug.h" -#include "../include/lustre_swab.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/obd.h" -#include "../include/obd_support.h" +#include +#include +#include +#include +#include +#include /* struct ptlrpc_request, lustre_msg* */ -#include "../include/lustre_req_layout.h" -#include "../include/lustre_acl.h" +#include +#include /* * RQFs (see below) refer to two struct req_msg_field arrays describing the diff --git a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c index 110d9f5..480c20a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c @@ -38,11 +38,11 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../include/lustre_log.h" -#include "../include/lustre_net.h" +#include +#include +#include #include #define LLOG_CLIENT_ENTRY(ctxt, imp) do { \ diff --git a/drivers/staging/lustre/lustre/ptlrpc/llog_net.c b/drivers/staging/lustre/lustre/ptlrpc/llog_net.c index bccdace..bc5aa7b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/llog_net.c +++ b/drivers/staging/lustre/lustre/ptlrpc/llog_net.c @@ -42,10 +42,10 @@ #define DEBUG_SUBSYSTEM S_LOG -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../include/lustre_log.h" +#include +#include #include int llog_initiator_connect(struct llog_ctxt *ctxt) diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index ad2703b..1392ae9 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -31,12 +31,12 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#include "../include/obd_support.h" -#include "../include/obd.h" -#include "../include/lprocfs_status.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_net.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" static struct ll_rpc_opcode { diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c index eddc192..12149fb 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c +++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c @@ -31,11 +31,11 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_lib.h" -#include "../include/obd.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c index ef19dbe..2969d8d 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c @@ -36,11 +36,11 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lprocfs_status.h" -#include "../../include/linux/libcfs/libcfs.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c index b123a93..df330e4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c @@ -43,9 +43,9 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../../include/linux/libcfs/libcfs.h" +#include +#include +#include #include "ptlrpc_internal.h" /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 5d68fa9..aad4ff1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -40,16 +40,16 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../../include/uapi/linux/lustre/lustre_fiemap.h" +#include -#include "../include/llog_swab.h" -#include "../include/lustre_net.h" -#include "../include/lustre_swab.h" -#include "../include/obd_cksum.h" -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/pers.c b/drivers/staging/lustre/lustre/ptlrpc/pers.c index df4994f..643388b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pers.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pers.c @@ -32,11 +32,11 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_import.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 5504fc2..e4de50e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -36,8 +36,8 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" +#include +#include #include "ptlrpc_internal.h" struct mutex pinger_mutex; diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c index a70d584..38e488d 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c @@ -32,10 +32,10 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_req_layout.h" +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index 59b5813..0e47682 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -51,15 +51,15 @@ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/lustre_net.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_ha.h" -#include "../include/obd_class.h" /* for obd_zombie */ -#include "../include/obd_support.h" /* for OBD_FAIL_CHECK */ -#include "../include/cl_object.h" /* cl_env_{get,put}() */ -#include "../include/lprocfs_status.h" +#include + +#include +#include +#include +#include /* for obd_zombie */ +#include /* for OBD_FAIL_CHECK */ +#include /* cl_env_{get,put}() */ +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/recover.c b/drivers/staging/lustre/lustre/ptlrpc/recover.c index 7b58545..72a19a3 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/recover.c +++ b/drivers/staging/lustre/lustre/ptlrpc/recover.c @@ -35,15 +35,15 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/obd_support.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_export.h" -#include "../include/obd.h" -#include "../include/obd_class.h" +#include + +#include +#include +#include +#include +#include +#include +#include #include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 366f2ce..cd7a539 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -36,19 +36,19 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index 128838a..059294a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -36,16 +36,16 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" - -#include "../include/obd.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_sec.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index 9143441..0f4af66 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -32,16 +32,16 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include #include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_import.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c index 026bec7..d10a805 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c @@ -36,12 +36,12 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c index 07273f5..7792132 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c @@ -34,16 +34,16 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../../include/linux/libcfs/libcfs.h" +#include #include -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/lustre_import.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index 70a61e1..dc39a54 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -36,11 +36,11 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../include/obd_support.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index c5e7a23..6aa9b65 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -36,11 +36,11 @@ #define DEBUG_SUBSYSTEM S_SEC -#include "../include/obd_support.h" -#include "../include/obd_cksum.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_sec.h" +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" struct plain_sec { diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index ca3d69e..155f6a4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -31,11 +31,12 @@ */ #define DEBUG_SUBSYSTEM S_RPC -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lu_object.h" -#include "../../include/uapi/linux/lnet/lnet-types.h" + +#include +#include +#include +#include +#include #include "ptlrpc_internal.h" /* The following are visible and mutable through /sys/module/ptlrpc */ diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c index 311c526..07b86a1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c +++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c @@ -35,10 +35,10 @@ #include #include -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../include/lustre_net.h" -#include "../include/lustre_disk.h" +#include +#include +#include +#include #include "ptlrpc_internal.h" void lustre_assert_wire_constants(void) -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:42 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:42 -0400 Subject: [lustre-devel] [PATCH 48/64 v2] staging: lustre: llite: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-49-git-send-email-jsimmons@infradead.org> Rationalize include paths in the llite source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/Makefile | 3 ++ drivers/staging/lustre/lustre/llite/dcache.c | 6 ++-- drivers/staging/lustre/lustre/llite/dir.c | 16 +++++----- drivers/staging/lustre/lustre/llite/file.c | 10 +++---- drivers/staging/lustre/lustre/llite/glimpse.c | 16 +++++----- drivers/staging/lustre/lustre/llite/lcommon_cl.c | 34 +++++++++++----------- drivers/staging/lustre/lustre/llite/lcommon_misc.c | 8 ++--- .../staging/lustre/lustre/llite/llite_internal.h | 20 ++++++------- drivers/staging/lustre/lustre/llite/llite_lib.c | 18 ++++++------ drivers/staging/lustre/lustre/llite/lproc_llite.c | 4 +-- drivers/staging/lustre/lustre/llite/namei.c | 6 ++-- drivers/staging/lustre/lustre/llite/range_lock.c | 2 +- drivers/staging/lustre/lustre/llite/range_lock.h | 4 +-- drivers/staging/lustre/lustre/llite/rw.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 4 +-- drivers/staging/lustre/lustre/llite/super25.c | 6 ++-- drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_internal.h | 4 +-- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_lock.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_object.c | 4 +-- drivers/staging/lustre/lustre/llite/xattr.c | 4 +-- drivers/staging/lustre/lustre/llite/xattr_cache.c | 4 +-- 23 files changed, 92 insertions(+), 89 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/Makefile b/drivers/staging/lustre/lustre/llite/Makefile index 322d4fa..ef7adef 100644 --- a/drivers/staging/lustre/lustre/llite/Makefile +++ b/drivers/staging/lustre/lustre/llite/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += lustre.o lustre-y := dcache.o dir.o file.o llite_lib.o llite_nfs.o \ rw.o rw26.o namei.o symlink.o llite_mmap.o range_lock.o \ diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index d38cb33..3670fca 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/lustre_dlm.h" +#include +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 4b46271..1db3e7f 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -44,14 +44,14 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_kernelcomm.h" -#include "../include/lustre_swab.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index adffc29..2c30e42 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -37,16 +37,16 @@ */ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/lustre_dlm.h" +#include #include #include #include #include -#include "../../include/uapi/linux/lustre/lustre_fiemap.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_swab.h" +#include +#include +#include -#include "../include/cl_object.h" +#include #include "llite_internal.h" static int diff --git a/drivers/staging/lustre/lustre/llite/glimpse.c b/drivers/staging/lustre/lustre/llite/glimpse.c index 0143112..34c2cfe 100644 --- a/drivers/staging/lustre/lustre/llite/glimpse.c +++ b/drivers/staging/lustre/lustre/llite/glimpse.c @@ -36,18 +36,18 @@ * Author: Oleg Drokin */ -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/obd.h" +#include +#include +#include +#include -#include "../include/lustre_dlm.h" -#include "../include/lustre_mdc.h" +#include +#include #include #include -#include "../include/cl_object.h" -#include "../llite/llite_internal.h" +#include +#include "llite_internal.h" static const struct cl_lock_descr whole_file = { .cld_start = 0, diff --git a/drivers/staging/lustre/lustre/llite/lcommon_cl.c b/drivers/staging/lustre/lustre/llite/lcommon_cl.c index 75e4b35..d2392e4 100644 --- a/drivers/staging/lustre/lustre/llite/lcommon_cl.c +++ b/drivers/staging/lustre/lustre/llite/lcommon_cl.c @@ -37,23 +37,23 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../../include/linux/libcfs/libcfs.h" -# include -# include -# include -# include -# include -# include -# include - -#include "../include/obd.h" -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_mdc.h" -#include "../include/cl_object.h" - -#include "../llite/llite_internal.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "llite_internal.h" /* * ccc_ prefix stands for "Common Client Code". diff --git a/drivers/staging/lustre/lustre/llite/lcommon_misc.c b/drivers/staging/lustre/lustre/llite/lcommon_misc.c index 7f7f3f1..422f410 100644 --- a/drivers/staging/lustre/lustre/llite/lcommon_misc.c +++ b/drivers/staging/lustre/lustre/llite/lcommon_misc.c @@ -34,10 +34,10 @@ * */ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_class.h" -#include "../include/obd_support.h" -#include "../include/obd.h" -#include "../include/cl_object.h" +#include +#include +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index a7f0d51..0287c75 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -32,18 +32,18 @@ #ifndef LLITE_INTERNAL_H #define LLITE_INTERNAL_H -#include "../include/lustre_debug.h" -#include "../../include/uapi/linux/lustre/lustre_ver.h" -#include "../include/lustre_disk.h" /* for s2sbi */ -#include "../include/lustre_linkea.h" +#include +#include +#include /* for s2sbi */ +#include /* for struct cl_lock_descr and struct cl_io */ -#include "../include/lustre_patchless_compat.h" -#include "../include/lustre_compat.h" -#include "../include/cl_object.h" -#include "../include/lustre_lmv.h" -#include "../include/lustre_mdc.h" -#include "../include/lustre_intent.h" +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 3ab3a63..d855129 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -41,15 +41,15 @@ #include #include -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_ha.h" -#include "../include/lustre_dlm.h" -#include "../include/lprocfs_status.h" -#include "../include/lustre_disk.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_log.h" -#include "../include/cl_object.h" -#include "../include/obd_cksum.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "llite_internal.h" struct kmem_cache *ll_file_data_slab; diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index aeae667..e3bd2d1 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -31,9 +31,9 @@ */ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/lprocfs_status.h" +#include #include -#include "../include/obd_support.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 4a5b965..4897dbd 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -40,9 +40,9 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_dlm.h" +#include +#include +#include #include "llite_internal.h" static int ll_create_it(struct inode *dir, struct dentry *dentry, diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c b/drivers/staging/lustre/lustre/llite/range_lock.c index 3f232cd..a32598b 100644 --- a/drivers/staging/lustre/lustre/llite/range_lock.c +++ b/drivers/staging/lustre/lustre/llite/range_lock.c @@ -34,7 +34,7 @@ * Author: Bobi Jam */ #include "range_lock.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include /** * Initialize a range lock tree diff --git a/drivers/staging/lustre/lustre/llite/range_lock.h b/drivers/staging/lustre/lustre/llite/range_lock.h index 779091c..1e1519b 100644 --- a/drivers/staging/lustre/lustre/llite/range_lock.h +++ b/drivers/staging/lustre/lustre/llite/range_lock.h @@ -36,8 +36,8 @@ #ifndef _RANGE_LOCK_H #define _RANGE_LOCK_H -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/interval_tree.h" +#include +#include struct range_lock { struct interval_node rl_node; diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 166455e..e720905 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -51,7 +51,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_cksum.h" +#include #include "llite_internal.h" static void ll_ra_stats_inc_sbi(struct ll_sb_info *sbi, enum ra_stat which); diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 9bbca01..ea9d59f 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/lustre_dlm.h" +#include +#include #include "llite_internal.h" #define SA_OMITTED_ENTRY_MAX 8ULL diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c index 56f4b10..0da4af8 100644 --- a/drivers/staging/lustre/lustre/llite/super25.c +++ b/drivers/staging/lustre/lustre/llite/super25.c @@ -34,11 +34,11 @@ #include #include -#include "../include/lustre_ha.h" -#include "../include/lustre_dlm.h" +#include +#include #include #include -#include "../include/lprocfs_status.h" +#include #include "llite_internal.h" static struct kmem_cache *ll_inode_cachep; diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c index 2b60699..f9d9a16 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_dev.c +++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h index 53ff46c..adce0ff 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_internal.h +++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h @@ -37,8 +37,8 @@ #ifndef VVP_INTERNAL_H #define VVP_INTERNAL_H -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/cl_object.h" +#include +#include enum obd_notify_event; struct inode; diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index c5ba265..c83853f 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/vvp_lock.c b/drivers/staging/lustre/lustre/llite/vvp_lock.c index 07eb26c..e522f7c 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_lock.c +++ b/drivers/staging/lustre/lustre/llite/vvp_lock.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" +#include #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/vvp_object.c b/drivers/staging/lustre/lustre/llite/vvp_object.c index 9bfd72e..3953750 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_object.c +++ b/drivers/staging/lustre/lustre/llite/vvp_object.c @@ -36,9 +36,9 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" +#include #include "llite_internal.h" #include "vvp_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 48bad7d..0be5562 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -38,8 +38,8 @@ #define DEBUG_SUBSYSTEM S_LLITE -#include "../include/obd_support.h" -#include "../include/lustre_dlm.h" +#include +#include #include "llite_internal.h" diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c index fa11dd5..80ee392 100644 --- a/drivers/staging/lustre/lustre/llite/xattr_cache.c +++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c @@ -12,8 +12,8 @@ #include #include #include -#include "../include/obd_support.h" -#include "../include/lustre_dlm.h" +#include +#include #include "llite_internal.h" /* If we ever have hundreds of extended attributes, we might want to consider -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:44 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:44 -0400 Subject: [lustre-devel] [PATCH 50/64 v2] staging: lustre: lov: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-51-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lov source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lov/Makefile | 3 ++ .../staging/lustre/lustre/lov/lov_cl_internal.h | 6 ++-- drivers/staging/lustre/lustre/lov/lov_dev.c | 2 +- drivers/staging/lustre/lustre/lov/lov_ea.c | 6 ++-- drivers/staging/lustre/lustre/lov/lov_internal.h | 4 +-- drivers/staging/lustre/lustre/lov/lov_merge.c | 4 +-- drivers/staging/lustre/lustre/lov/lov_obd.c | 32 +++++++++++----------- drivers/staging/lustre/lustre/lov/lov_offset.c | 4 +-- drivers/staging/lustre/lustre/lov/lov_pack.c | 10 +++---- drivers/staging/lustre/lustre/lov/lov_pool.c | 4 +-- drivers/staging/lustre/lustre/lov/lov_request.c | 6 ++-- drivers/staging/lustre/lustre/lov/lproc_lov.c | 4 +-- 12 files changed, 44 insertions(+), 41 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/Makefile b/drivers/staging/lustre/lustre/lov/Makefile index ea93add..3abfb4e 100644 --- a/drivers/staging/lustre/lustre/lov/Makefile +++ b/drivers/staging/lustre/lustre/lov/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += lov.o lov-y := lov_obd.o lov_pack.o lov_offset.o lov_merge.o \ lov_request.o lov_ea.o lov_dev.o lov_object.o lov_page.o \ diff --git a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h index 38281b2..89d92b0 100644 --- a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h @@ -42,10 +42,10 @@ #ifndef LOV_CL_INTERNAL_H #define LOV_CL_INTERNAL_H -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" -#include "../include/cl_object.h" +#include +#include #include "lov_internal.h" /** \defgroup lov lov diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c b/drivers/staging/lustre/lustre/lov/lov_dev.c index 531b4fe..cea5f9d 100644 --- a/drivers/staging/lustre/lustre/lov/lov_dev.c +++ b/drivers/staging/lustre/lustre/lov/lov_dev.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LOV /* class_name2obd() */ -#include "../include/obd_class.h" +#include #include "lov_cl_internal.h" #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index 530a4e9..1124fd5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -37,10 +37,10 @@ #define DEBUG_SUBSYSTEM S_LOV #include -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index 4d9437e..a21f074 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -33,8 +33,8 @@ #ifndef LOV_INTERNAL_H #define LOV_INTERNAL_H -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include /* * If we are unable to get the maximum object size from the OST in diff --git a/drivers/staging/lustre/lustre/lov/lov_merge.c b/drivers/staging/lustre/lustre/lov/lov_merge.c index 034b4fc..9163361 100644 --- a/drivers/staging/lustre/lustre/lov/lov_merge.c +++ b/drivers/staging/lustre/lustre/lov/lov_merge.c @@ -32,9 +32,9 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" +#include #include "lov_internal.h" /** Merge the lock value block(&lvb) attributes and KMS from each of the diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 953ed71..fefd3c5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -38,22 +38,22 @@ */ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" - -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" - -#include "../include/cl_object.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_mds.h" -#include "../include/lustre_net.h" -#include "../../include/uapi/linux/lustre/lustre_param.h" -#include "../include/lustre_swab.h" -#include "../include/lprocfs_status.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_offset.c b/drivers/staging/lustre/lustre/lov/lov_offset.c index ecca74f..899d12c 100644 --- a/drivers/staging/lustre/lustre/lov/lov_offset.c +++ b/drivers/staging/lustre/lustre/lov/lov_offset.c @@ -32,9 +32,9 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" +#include #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index fd346c5..24fb2a9 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -38,11 +38,11 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../include/lustre_net.h" -#include "../include/lustre_swab.h" -#include "../include/obd.h" -#include "../include/obd_class.h" -#include "../include/obd_support.h" +#include +#include +#include +#include +#include #include "lov_cl_internal.h" #include "lov_internal.h" diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index 39daa17..d774ee2 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -40,9 +40,9 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd.h" +#include #include "lov_internal.h" #define pool_tgt(_p, _i) \ diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index 74aeb94..9d3b3f3 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -32,10 +32,10 @@ #define DEBUG_SUBSYSTEM S_LOV -#include "../../include/linux/libcfs/libcfs.h" +#include -#include "../include/obd_class.h" -#include "../../include/uapi/linux/lustre/lustre_idl.h" +#include +#include #include "lov_internal.h" static void lov_init_set(struct lov_request_set *set) diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index ce46821..9bb7e9e 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/lprocfs_status.h" -#include "../include/obd_class.h" +#include +#include #include #include "lov_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:51 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:51 -0400 Subject: [lustre-devel] [PATCH 57/64 v2] staging: lustre: lustre: cleanup paths for lustre UAPI headers In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-58-git-send-email-jsimmons@infradead.org> Rationalize include paths for the lustre uapi headers Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h | 6 +++--- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h | 2 +- drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h index 2b7deaa..11b51d9 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -35,7 +35,7 @@ #include #include -#include "../../../uapi/linux/lustre/lustre_user.h" +#include /** \defgroup cfg cfg * diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h index dd3785a..2e7a8d1 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_fid.h @@ -37,7 +37,7 @@ #ifndef _UAPI_LUSTRE_FID_H_ #define _UAPI_LUSTRE_FID_H_ -#include "../../../uapi/linux/lustre/lustre_idl.h" +#include /** returns fid object sequence */ static inline __u64 fid_seq(const struct lu_fid *fid) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h index cc59c1a..aac98db 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -70,10 +70,10 @@ #include #include -#include "../lnet/lnet-types.h" +#include /* Defn's shared with user-space. */ -#include "lustre_user.h" -#include "lustre_ver.h" +#include +#include /* * GENERAL STUFF diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 1f52477..9590864 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -31,7 +31,7 @@ #include #include #include -#include "../../../uapi/linux/lustre/lustre_idl.h" +#include #if !defined(__KERNEL__) && !defined(LUSTRE_UTILS) # error This file is for Lustre internal use only. diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h index 9110229..3343b60 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ostid.h @@ -35,7 +35,7 @@ #define _UAPI_LUSTRE_OSTID_H_ #include -#include "lustre_fid.h" +#include static inline __u64 lmm_oi_id(const struct ost_id *oi) { diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h index 2fcfe2b..5e332e3 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h @@ -55,7 +55,7 @@ # include # include #endif /* __KERNEL__ */ -#include "lustre_fiemap.h" +#include /* * We need to always use 64bit version because the structure -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:53 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:53 -0400 Subject: [lustre-devel] [PATCH 59/64 v2] staging: lustre: lnet: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-60-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lnet core source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/Makefile | 3 +++ drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 4 ++-- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-eq.c | 3 ++- drivers/staging/lustre/lnet/lnet/lib-md.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-me.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-msg.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-socket.c | 4 ++-- drivers/staging/lustre/lnet/lnet/lo.c | 3 ++- drivers/staging/lustre/lnet/lnet/module.c | 5 +++-- drivers/staging/lustre/lnet/lnet/net_fault.c | 4 ++-- drivers/staging/lustre/lnet/lnet/nidstrings.c | 4 ++-- drivers/staging/lustre/lnet/lnet/peer.c | 4 ++-- drivers/staging/lustre/lnet/lnet/router.c | 3 ++- drivers/staging/lustre/lnet/lnet/router_proc.c | 5 +++-- 18 files changed, 32 insertions(+), 24 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/Makefile b/drivers/staging/lustre/lnet/lnet/Makefile index 4c81fa1..fd8585c 100644 --- a/drivers/staging/lustre/lnet/lnet/Makefile +++ b/drivers/staging/lustre/lnet/lnet/Makefile @@ -1,3 +1,6 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET) += lnet.o lnet-y := api-ni.o config.o nidstrings.o net_fault.o \ diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index a6f60c3..be2823f 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -33,7 +33,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include #include -#include "../../include/linux/lnet/lib-lnet.h" +#include static int accept_port = 988; static int accept_backlog = 127; diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 30c7ff6..ad83503 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -34,8 +34,8 @@ #include #include -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" +#include +#include #define D_LNI D_CONSOLE diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 933988d..26841a7 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -33,7 +33,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include #include -#include "../../include/linux/lnet/lib-lnet.h" +#include struct lnet_text_buf { /* tmp struct for parsing routes */ struct list_head ltb_list; /* stash on lists */ diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c index 9ebba4e..6b446a5 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-eq.c +++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c @@ -35,7 +35,8 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" + +#include /** * Create an event queue that has room for \a count number of events. diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c index f08e944..a0aef4b 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-md.c +++ b/drivers/staging/lustre/lnet/lnet/lib-md.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include /* must be called with lnet_res_lock held */ void diff --git a/drivers/staging/lustre/lnet/lnet/lib-me.c b/drivers/staging/lustre/lnet/lnet/lib-me.c index e9b3eed..f52a5e8 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-me.c +++ b/drivers/staging/lustre/lnet/lnet/lib-me.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include /** * Create and attach a match entry to the match list of \a portal. The new diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 20ebe24..d886504 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include #include #include diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c index 008ac50..d04875e 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-msg.c +++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c @@ -36,7 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include void lnet_build_unlink_event(struct lnet_libmd *md, struct lnet_event *ev) diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c index 3333272..5946848 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c @@ -31,7 +31,7 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" +#include /* NB: add /proc interfaces in upcoming patches */ int portal_rotor = LNET_PTL_ROTOR_HASH_RT; diff --git a/drivers/staging/lustre/lnet/lnet/lib-socket.c b/drivers/staging/lustre/lnet/lnet/lib-socket.c index 800f4f6..7d0add0 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-socket.c +++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c @@ -40,8 +40,8 @@ #include #include -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" +#include +#include static int kernel_sock_unlocked_ioctl(struct file *filp, int cmd, unsigned long arg) diff --git a/drivers/staging/lustre/lnet/lnet/lo.c b/drivers/staging/lustre/lnet/lnet/lo.c index a7504b8..80c06f4 100644 --- a/drivers/staging/lustre/lnet/lnet/lo.c +++ b/drivers/staging/lustre/lnet/lnet/lo.c @@ -29,7 +29,8 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" + +#include static int lolnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg) diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 06fcfd2..7d12a7f 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -31,8 +31,9 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" + +#include +#include static int config_on_load; module_param(config_on_load, int, 0444); diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c index 166a311..03f3d18 100644 --- a/drivers/staging/lustre/lnet/lnet/net_fault.c +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c @@ -35,8 +35,8 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnetctl.h" +#include +#include #define LNET_MSG_MASK (LNET_PUT_BIT | LNET_ACK_BIT | \ LNET_GET_BIT | LNET_REPLY_BIT) diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index a91bbc4..7bd1e6f 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -36,8 +36,8 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/uapi/linux/lnet/nidstr.h" +#include +#include /* max value for numeric network address */ #define MAX_NUMERIC_VALUE 0xffffffff diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c index 301b275..4d55df8 100644 --- a/drivers/staging/lustre/lnet/lnet/peer.c +++ b/drivers/staging/lustre/lnet/lnet/peer.c @@ -34,8 +34,8 @@ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/lnet/lib-lnet.h" -#include "../../include/uapi/linux/lnet/lnet-dlc.h" +#include +#include int lnet_peer_tables_create(void) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 12dd104..3df101b 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -18,8 +18,9 @@ */ #define DEBUG_SUBSYSTEM S_LNET + #include -#include "../../include/linux/lnet/lib-lnet.h" +#include #define LNET_NRB_TINY_MIN 512 /* min value for each CPT */ #define LNET_NRB_TINY (LNET_NRB_TINY_MIN * 4) diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index 72b80c5..4a994d1 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -18,8 +18,9 @@ */ #define DEBUG_SUBSYSTEM S_LNET -#include "../../include/linux/libcfs/libcfs.h" -#include "../../include/linux/lnet/lib-lnet.h" + +#include +#include /* * This is really lnet_proc.c. You might need to update sanity test 215 -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:54 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:54 -0400 Subject: [lustre-devel] [PATCH 60/64 v2] staging: lustre: ko2iblnd: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-61-git-send-email-jsimmons@infradead.org> Rationalize include paths in the ko2iblnd source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile | 3 +++ drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile b/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile index e0a7aa7..4affe1d 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LNET_XPRT_IB) += ko2iblnd.o ko2iblnd-y := o2iblnd.o o2iblnd_cb.o o2iblnd_modparams.o diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 8e59506..a1e994a 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -63,8 +63,8 @@ #define DEBUG_SUBSYSTEM S_LND -#include "../../../include/linux/libcfs/libcfs.h" -#include "../../../include/linux/lnet/lib-lnet.h" +#include +#include #define IBLND_PEER_HASH_SIZE 101 /* # peer lists */ /* # scheduler loops before reschedule */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:09 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:09 -0400 Subject: [lustre-devel] [PATCH 15/64 v2] staging: lustre: uapi: label lustre_ioctl.h as a UAPI header In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-16-git-send-email-jsimmons@infradead.org> Change LUSTRE_IOCTL_H_ to _UAPI_LUSTRE_IOCTL_H_ now that is a proper UAPI header Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h index fb87a8b..c2c0b27 100644 --- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -25,8 +25,8 @@ * * Copyright (c) 2011, 2015, Intel Corporation. */ -#ifndef LUSTRE_IOCTL_H_ -#define LUSTRE_IOCTL_H_ +#ifndef _UAPI_LUSTRE_IOCTL_H_ +#define _UAPI_LUSTRE_IOCTL_H_ #include #include @@ -229,4 +229,4 @@ static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data) #define IOC_OSC_SET_ACTIVE _IOWR('h', 21, void *) -#endif /* LUSTRE_IOCTL_H_ */ +#endif /* _UAPI_LUSTRE_IOCTL_H_ */ -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:26 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:26 -0400 Subject: [lustre-devel] [PATCH 32/64 v2] staging: lustre: libcfs: remove LOGL and LOGU macros In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-33-git-send-email-jsimmons@infradead.org> The macro LOGU is not used anymore and LOGL is used in one place. No reason to keep LOGL around anymore. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: https://review.whamcloud.com/22138 Reviewed-by: Dmitry Eremin Reviewed-by: Jinshan Xiong Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs_private.h | 14 -------------- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 4 +++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 005713b..709771d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -296,18 +296,4 @@ static inline size_t cfs_round_strlen(char *fset) return cfs_size_round((int)strlen(fset) + 1); } -#define LOGL(var, len, ptr) \ -do { \ - if (var) \ - memcpy((char *)ptr, (const char *)var, len); \ - ptr += cfs_size_round(len); \ -} while (0) - -#define LOGU(var, len, ptr) \ -do { \ - if (var) \ - memcpy((char *)var, (const char *)ptr, len); \ - ptr += cfs_size_round(len); \ -} while (0) - #endif diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 55e8696e..f116995 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -186,7 +186,9 @@ void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, __u32 *lens, for (i = 0; i < count; i++) { char *tmp = bufs[i]; - LOGL(tmp, lens[i], ptr); + if (tmp) + memcpy(ptr, tmp, lens[i]); + ptr += cfs_size_round(lens[i]); } } EXPORT_SYMBOL(lustre_init_msg_v2); -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:43 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:43 -0400 Subject: [lustre-devel] [PATCH 49/64 v2] staging: lustre: lmv: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-50-git-send-email-jsimmons@infradead.org> Rationalize include paths in the lmv source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lmv/Makefile | 3 +++ drivers/staging/lustre/lustre/lmv/lmv_fld.c | 14 +++++++------- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 16 ++++++++-------- drivers/staging/lustre/lustre/lmv/lmv_internal.h | 6 +++--- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 18 +++++++++--------- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 4 ++-- 6 files changed, 32 insertions(+), 29 deletions(-) diff --git a/drivers/staging/lustre/lustre/lmv/Makefile b/drivers/staging/lustre/lustre/lmv/Makefile index 1a24299..91c9911 100644 --- a/drivers/staging/lustre/lustre/lmv/Makefile +++ b/drivers/staging/lustre/lustre/lmv/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += lmv.o lmv-y := lmv_obd.o lmv_intent.o lmv_fld.o lproc_lmv.o diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c b/drivers/staging/lustre/lustre/lmv/lmv_fld.c index 1a7dd15..5937468 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c @@ -37,13 +37,13 @@ #include #include -#include "../include/obd_support.h" -#include "../include/lustre_fid.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_net.h" -#include "../include/lustre_dlm.h" -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include +#include +#include #include "lmv_internal.h" int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, u32 *mds) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index 6b10bdd..22c247a 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -37,14 +37,14 @@ #include #include #include -#include "../include/lustre_intent.h" -#include "../include/obd_support.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_net.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_mdc.h" -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "lmv_internal.h" static int lmv_intent_remote(struct obd_export *exp, struct lookup_intent *it, diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h index ad109c0..a047523 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h +++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h @@ -33,9 +33,9 @@ #ifndef _LMV_INTERNAL_H_ #define _LMV_INTERNAL_H_ -#include "../../include/uapi/linux/lustre/lustre_idl.h" -#include "../include/obd.h" -#include "../include/lustre_lmv.h" +#include +#include +#include #define LMV_MAX_TGT_COUNT 128 diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index f17221f..98537ca 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -41,15 +41,15 @@ #include #include -#include "../include/obd_support.h" -#include "../include/lustre_net.h" -#include "../include/obd_class.h" -#include "../include/lustre_lmv.h" -#include "../include/lprocfs_status.h" -#include "../include/cl_object.h" -#include "../include/lustre_fid.h" -#include "../../include/uapi/linux/lustre/lustre_ioctl.h" -#include "../include/lustre_kernelcomm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "lmv_internal.h" static int lmv_check_connect(struct obd_device *obd); diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c index 4c13e39..f16cfa4 100644 --- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c +++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c @@ -34,8 +34,8 @@ #include #include -#include "../include/lprocfs_status.h" -#include "../include/obd_class.h" +#include +#include #include "lmv_internal.h" static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr, -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:26:46 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:26:46 -0400 Subject: [lustre-devel] [PATCH 52/64 v2] staging: lustre: mgc: add include path to Makefile In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> References: <1503196018-24500-1-git-send-email-jsimmons@infradead.org> Message-ID: <1503196018-24500-53-git-send-email-jsimmons@infradead.org> Rationalize include paths in the mgc source code files. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/mgc/Makefile | 3 +++ drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 4 ++-- drivers/staging/lustre/lustre/mgc/mgc_internal.h | 10 +++++----- drivers/staging/lustre/lustre/mgc/mgc_request.c | 12 ++++++------ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/lustre/mgc/Makefile b/drivers/staging/lustre/lustre/mgc/Makefile index 8ea29a8..8abf108 100644 --- a/drivers/staging/lustre/lustre/mgc/Makefile +++ b/drivers/staging/lustre/lustre/mgc/Makefile @@ -1,2 +1,5 @@ +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include + obj-$(CONFIG_LUSTRE_FS) += mgc.o mgc-y := mgc_request.o lproc_mgc.o diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c index 0735220..2ec2d7f 100644 --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c @@ -32,8 +32,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include "../include/obd_class.h" -#include "../include/lprocfs_status.h" +#include +#include #include "mgc_internal.h" LPROC_SEQ_FOPS_RO_TYPE(mgc, connect_flags); diff --git a/drivers/staging/lustre/lustre/mgc/mgc_internal.h b/drivers/staging/lustre/lustre/mgc/mgc_internal.h index 8cb6758..7a2f2b7 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_internal.h +++ b/drivers/staging/lustre/lustre/mgc/mgc_internal.h @@ -33,11 +33,11 @@ #ifndef _MGC_INTERNAL_H #define _MGC_INTERNAL_H -#include "../../include/linux/libcfs/libcfs.h" -#include "../include/lustre_lib.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_log.h" -#include "../include/lustre_export.h" +#include +#include +#include +#include +#include void lprocfs_mgc_init_vars(struct lprocfs_static_vars *lvars); int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data); diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index d344b01..3d2b969 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -39,12 +39,12 @@ #include -#include "../include/lprocfs_status.h" -#include "../include/lustre_dlm.h" -#include "../include/lustre_disk.h" -#include "../include/lustre_log.h" -#include "../include/lustre_swab.h" -#include "../include/obd_class.h" +#include +#include +#include +#include +#include +#include #include "mgc_internal.h" -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:48:02 2017 From: jsimmons at infradead.org (James Simmons) Date: Sat, 19 Aug 2017 22:48:02 -0400 Subject: [lustre-devel] [PATCH RFC] staging: lustre: libcfs: tracepoint implementation Message-ID: <1503197282-26392-1-git-send-email-jsimmons@infradead.org> The other eye sore for lustre after the UAPI mess is the loony debugging system. This debugging system was written long before trace point existed. Well it shows and todays trace point has surpassed lustre debugging system. Some of the things implemented are: 1) trace events have a specific naming scheme to allow advance filter. With this layout you can still use the libcfs module parameters debugging options to enable classes of trace events enabled at module startup. This allows debugging for those special cases. 2) trace events are ratelimited. Its very easy to have 20000 lustre clients over whelm the logging servers. The lustre debugging code was ratelimited for each debugging statement which is over kill. For ratelimited trace events its per subsystem. 3) As each subsystem gets moved over to trace events the native lustre debugging no longer prints to the console. Currently I unroll to have trace_event(); pr_info(). Prehaps its could be rolled into the trace_event macro to make it cleaner. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_debug.h | 6 + .../lustre/include/linux/libcfs/libcfs_fail.h | 46 +- drivers/staging/lustre/lnet/libcfs/Makefile | 2 +- drivers/staging/lustre/lnet/libcfs/debug.c | 57 +- drivers/staging/lustre/lnet/libcfs/fail.c | 53 +- drivers/staging/lustre/lnet/libcfs/libcfs_trace.c | 38 + drivers/staging/lustre/lnet/libcfs/libcfs_trace.h | 2610 ++++++++++++++++++++ .../lustre/lnet/libcfs/linux/linux-tracefile.c | 5 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 3 +- drivers/staging/lustre/lnet/libcfs/tracefile.h | 6 - 10 files changed, 2766 insertions(+), 60 deletions(-) create mode 100644 drivers/staging/lustre/lnet/libcfs/libcfs_trace.c create mode 100644 drivers/staging/lustre/lnet/libcfs/libcfs_trace.h diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index e7c3741..1fc945c 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -38,6 +38,7 @@ #ifndef __LIBCFS_DEBUG_H__ #define __LIBCFS_DEBUG_H__ +#include #include /* @@ -102,6 +103,11 @@ struct libcfs_debug_msg_data { .msg_cdls = (cdls) }; \ dataname.msg_mask = (mask) +#define CFS_TRACE_CONSOLE_BUFFER_SIZE 1024 + +int libcfs_debug_trace_init(struct module *module, int sub_system, + struct ratelimit_state *rs); + /** * Filters out logging messages based on mask and subsystem. */ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h index fedb46d..b22160c 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h @@ -76,26 +76,7 @@ static inline bool CFS_FAIL_PRECHECK(u32 id) (cfs_fail_loc & id & CFS_FAULT)); } -static inline int cfs_fail_check_set(u32 id, u32 value, - int set, int quiet) -{ - int ret = 0; - - if (unlikely(CFS_FAIL_PRECHECK(id))) { - ret = __cfs_fail_check_set(id, value, set); - if (ret) { - if (quiet) { - CDEBUG(D_INFO, "*** cfs_fail_loc=%x, val=%u***\n", - id, value); - } else { - LCONSOLE_INFO("*** cfs_fail_loc=%x, val=%u***\n", - id, value); - } - } - } - - return ret; -} +int cfs_fail_check_set(u32 id, u32 value, int set, int quiet); /* If id hit cfs_fail_loc, return 1, otherwise return 0 */ #define CFS_FAIL_CHECK(id) \ @@ -160,30 +141,7 @@ static inline int cfs_fail_timeout_set(u32 id, u32 value, int ms, int set) #define CFS_FAULT_CHECK(id) \ CFS_FAIL_CHECK(CFS_FAULT | (id)) -/* - * The idea here is to synchronise two threads to force a race. The - * first thread that calls this with a matching fail_loc is put to - * sleep. The next thread that calls with the same fail_loc wakes up - * the first and continues. - */ -static inline void cfs_race(u32 id) -{ - if (CFS_FAIL_PRECHECK(id)) { - if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) { - int rc; - - cfs_race_state = 0; - CERROR("cfs_race id %x sleeping\n", id); - rc = wait_event_interruptible(cfs_race_waitq, - !!cfs_race_state); - CERROR("cfs_fail_race id %x awake, rc=%d\n", id, rc); - } else { - CERROR("cfs_fail_race id %x waking\n", id); - cfs_race_state = 1; - wake_up(&cfs_race_waitq); - } - } -} +void cfs_race(u32 id); #define CFS_RACE(id) cfs_race(id) diff --git a/drivers/staging/lustre/lnet/libcfs/Makefile b/drivers/staging/lustre/lnet/libcfs/Makefile index 215fa23..f5776e5 100644 --- a/drivers/staging/lustre/lnet/libcfs/Makefile +++ b/drivers/staging/lustre/lnet/libcfs/Makefile @@ -13,7 +13,7 @@ libcfs-linux-objs += linux-mem.o libcfs-linux-objs := $(addprefix linux/,$(libcfs-linux-objs)) -libcfs-all-objs := debug.o fail.o module.o tracefile.o \ +libcfs-all-objs := debug.o fail.o module.o tracefile.o libcfs_trace.o \ libcfs_string.o hash.o prng.o workitem.o \ libcfs_cpu.o libcfs_mem.o libcfs_lock.o diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 1ab394c..2c179c2 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -35,13 +35,17 @@ * */ -# define DEBUG_SUBSYSTEM S_LNET +#define DEBUG_SUBSYSTEM S_LIBCFS #include +#include +#include "libcfs_trace.h" #include "tracefile.h" static char debug_file_name[1024]; +struct ratelimit_state libcfs_trace_rs; + unsigned int libcfs_subsystem_debug = ~0; EXPORT_SYMBOL(libcfs_subsystem_debug); module_param(libcfs_subsystem_debug, int, 0644); @@ -316,7 +320,7 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) if (t >= 1 && matched == n) { /* don't print warning for lctl set_param debug=0 or -1 */ if (m && m != -1) - CWARN("You are trying to use a numerical value for the mask - this will be deprecated in a future release.\n"); + trace_cwarn_unsupported_mask(); *mask = m; return 0; } @@ -387,6 +391,49 @@ void libcfs_debug_dumplog(void) } EXPORT_SYMBOL(libcfs_debug_dumplog); +int libcfs_debug_trace_init(struct module *module, int sub_system, + struct ratelimit_state *rs) +{ +#ifdef CONFIG_TRACEPOINTS + struct tracepoint * const *events = module->tracepoints_ptrs; + char subsys[64], buf[512], *debug_mask, *masks; + + if (!(libcfs_subsystem_debug & sub_system)) + return -ENODEV; + + libcfs_debug_mask2str(subsys, sizeof(subsys), sub_system, 1); + if (!strlen(subsys)) + return -EINVAL; + + libcfs_debug_mask2str(buf, sizeof(buf), libcfs_debug, 0); + masks = buf; + + while ((debug_mask = strsep(&masks, " ")) && *debug_mask) { + char event[128]; + int i; + + /* + * trace and malloc can be done with standard trace + */ + if (!strcmp(debug_mask, "trace") || + !strcmp(debug_mask, "malloc")) + continue; + + snprintf(event, sizeof(event), "%s_%s", subsys, debug_mask); + + for (i = 0; i < module->num_tracepoints; i++) { + if (!strncmp(events[i]->name, event, strlen(event))) + trace_set_clr_event(subsys, events[i]->name, 1); + } + } +#endif /* CONFIG_TRACEPOINTS */ + + /* TODO map console print limits to ratelimit */ + ratelimit_state_init(rs, libcfs_console_max_delay, 10); + return 0; +} +EXPORT_SYMBOL(libcfs_debug_trace_init); + int libcfs_debug_init(unsigned long bufsize) { unsigned int max = libcfs_debug_mb; @@ -423,6 +470,8 @@ int libcfs_debug_init(unsigned long bufsize) libcfs_debug_mb = cfs_trace_get_debug_mb(); } + rc = libcfs_debug_trace_init(THIS_MODULE, S_LIBCFS, + &libcfs_trace_rs); return rc; } @@ -439,7 +488,7 @@ int libcfs_debug_clear_buffer(void) return 0; } -/* Debug markers, although printed by S_LNET should not be be marked as such. */ +/* Debug markers, although printed by S_LIBCFS should not be be marked as such. */ #undef DEBUG_SUBSYSTEM #define DEBUG_SUBSYSTEM S_UNDEFINED int libcfs_debug_mark_buffer(const char *text) @@ -454,4 +503,4 @@ int libcfs_debug_mark_buffer(const char *text) } #undef DEBUG_SUBSYSTEM -#define DEBUG_SUBSYSTEM S_LNET +#define DEBUG_SUBSYSTEM S_LIBCFS diff --git a/drivers/staging/lustre/lnet/libcfs/fail.c b/drivers/staging/lustre/lnet/libcfs/fail.c index 24f4701..f7d461c 100644 --- a/drivers/staging/lustre/lnet/libcfs/fail.c +++ b/drivers/staging/lustre/lnet/libcfs/fail.c @@ -30,6 +30,7 @@ */ #include +#include "libcfs_trace.h" unsigned long cfs_fail_loc; EXPORT_SYMBOL(cfs_fail_loc); @@ -124,17 +125,63 @@ int __cfs_fail_check_set(u32 id, u32 value, int set) } EXPORT_SYMBOL(__cfs_fail_check_set); +/* + * The idea here is to synchronise two threads to force a race. The + * first thread that calls this with a matching fail_loc is put to + * sleep. The next thread that calls with the same fail_loc wakes up + * the first and continues. + */ +void cfs_race(u32 id) +{ + if (CFS_FAIL_PRECHECK(id)) { + if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) { + int rc; + + cfs_race_state = 0; + trace_cerror_fail_race_sleeping(id); + rc = wait_event_interruptible(cfs_race_waitq, + cfs_race_state != 0); + trace_cerror_fail_race_awake(id, rc); + } else { + trace_cerror_fail_race_awaking(id); + cfs_race_state = 1; + wake_up(&cfs_race_waitq); + } + } +} +EXPORT_SYMBOL(cfs_race); + +int cfs_fail_check_set(u32 id, u32 value, int set, int quiet) +{ + bool precheck = CFS_FAIL_PRECHECK(id); + int ret = 0; + + if (unlikely(precheck)) { + ret = __cfs_fail_check_set(id, value, set); + if (!ret) + goto not_set; + + trace_info_fail_loc(id, value); + if (!quiet && __ratelimit(&libcfs_trace_rs)) { + pr_info("Libcfs: *** cfs_fail_loc=%x, val=%u***\n", + id, value); + } + } +not_set: + return ret; +} +EXPORT_SYMBOL(cfs_fail_check_set); + int __cfs_fail_timeout_set(u32 id, u32 value, int ms, int set) { int ret; ret = __cfs_fail_check_set(id, value, set); if (ret && likely(ms > 0)) { - CERROR("cfs_fail_timeout id %x sleeping for %dms\n", - id, ms); + trace_cerror_timeout_sleep(id, ms); set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(cfs_time_seconds(ms) / 1000); - CERROR("cfs_fail_timeout id %x awake\n", id); + trace_cerror_timeout_awake(id); } return ret; } diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_trace.c b/drivers/staging/lustre/lnet/libcfs/libcfs_trace.c new file mode 100644 index 0000000..eb6ea66 --- /dev/null +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_trace.c @@ -0,0 +1,38 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2017, James Simmons + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Seagate, Inc. + */ +#ifdef CONFIG_TRACEPOINTS +#include +#include + +#ifndef __CHECKER__ +#define CREATE_TRACE_POINTS +#include "libcfs_trace.h" +#endif /* __CHECKER__ */ + +#endif /* CONFIG_TRACEPOINTS */ diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_trace.h b/drivers/staging/lustre/lnet/libcfs/libcfs_trace.h new file mode 100644 index 0000000..74c7c33 --- /dev/null +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_trace.h @@ -0,0 +1,2610 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2016, James Simmons + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Seagate, Inc. + * + * libcfs tracepoint handling + */ + +#ifndef DEBUG_SUBSYSTEM +#define DEBUG_SUBSYSTEM S_LIBCFS +#endif + +#if !defined(__LIBCFS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) +#define __LIBCFS_TRACE_H + +#include +#include +#include +#include + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM libcfs + +/* create empty functions when tracing is disabled */ +#if !defined(CONFIG_TRACEPOINTS) +#undef TRACE_EVENT +#define TRACE_EVENT(name, proto, ...) \ +static inline void trace_ ## name(proto) {} +#undef TRACE_EVENT_CONDITION +#define TRACE_EVENT_CONDITION(name, proto, ...) \ +static inline void trace_ ## name(proto) {} + +#endif /* !CONFIG_TRACEPOINTS */ + +extern struct ratelimit_state libcfs_trace_rs; +struct cfs_cpt_table; + +TRACE_EVENT(libcfs_config_crypto, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *algo, int speed), + TP_ARGS(msg_file, msg_line, msg_fn, algo, speed), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(algo, algo) + __field(int, speed) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(algo, algo); + __entry->speed = speed; + ), + TP_printk("(%s:%d:%s) Crypto hash algorithm %s speed = %d MB/s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(algo), __entry->speed) +); + +#define trace_config(hash_name, hash_speed) \ +do { \ + trace_libcfs_config_crypto(__FILE__, __LINE__, __func__, \ + hash_name, hash_speed); \ + \ + CDEBUG(D_CONFIG, "Crypto hash algorithm %s speed = %d MB/s\n", \ + cfs_crypto_hash_name(hash_alg), \ + cfs_crypto_hash_speeds[hash_alg]); \ +} while (0) + +TRACE_EVENT(libcfs_console_cpu_cpt_setup, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int num_nodes, int num_cpus, int num_cpts), + TP_ARGS(msg_file, msg_line, msg_fn, num_nodes, num_cpus, num_cpts), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, num_nodes) + __field(int, num_cpus) + __field(int, num_cpts) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->num_nodes = num_nodes; + __entry->num_cpus = num_cpus; + __entry->num_cpts = num_cpts; + ), + TP_printk("(%s:%d:%s) HW NUMA nodes: %d, HW CPU cores: %d, npartitions: %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->num_nodes, __entry->num_cpus, __entry->num_cpts) +); + +#define trace_console(num_nodes, num_cpus, num_cpts) \ +do { \ + trace_libcfs_console_cpu_cpt_setup(__FILE__, __LINE__, __func__,\ + num_nodes, num_cpus, \ + num_cpts); \ + \ + LCONSOLE(0, "HW NUMA nodes: %d, HW CPU cores: %d, npartitions: %d\n", \ + num_nodes, num_cpus, num_cpts); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_bind_failure, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, const char *thread_name, + int cpt, int bound), + TP_ARGS(rs, msg_file, msg_line, msg_fn, thread_name, cpt, bound), + TP_CONDITION(__ratelimit(rs) && bound), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(thread_name, thread_name) + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(thread_name, thread_name); + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) Unable to bind %s on CPU partition %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(thread_name), __entry->cpt) +); + +#define trace_cwarn_bind_failure(thread_name, cpt, bound) \ +do { \ + trace_libcfs_warning_bind_failure(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, \ + thread_name, cpt, bound); \ + \ + CWARN("Unable to bind %s on CPU partition %d\n", thread_name, \ + cpt); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_invalid_cpt_number, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int num_cpt, int cpt_est), + TP_ARGS(rs, msg_file, msg_line, msg_fn, num_cpt, cpt_est), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, ncpt) + __field(int, cpt_est) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->ncpt = num_cpt; + __entry->cpt_est = cpt_est; + ), + TP_printk("(%s:%d:%s) CPU partition number %d is larger than suggested value (%d), your system may have performance issue or run out of memory while under pressure", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->ncpt, __entry->cpt_est) +); + +#define trace_cwarn_invalid_cpt_number(num_cpt, cpt_est) \ +do { \ + trace_libcfs_warning_invalid_cpt_number(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, num_cpt, \ + cpt_est); \ + \ + CWARN("CPU partition number %d is larger than suggested value (%d), your system may have performance issue or run out of memory while under pressure\n", \ + ncpt, rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_invalid_hash_algo, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, + enum cfs_crypto_hash_alg hash_algo), + TP_ARGS(rs, msg_file, msg_line, msg_fn, hash_algo), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, algo) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->algo = hash_algo; + ), + TP_printk("(%s:%d:%s) Unsupported hash algorithm id = %d, max id is %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->algo, CFS_HASH_ALG_MAX) +); + +#define trace_cwarn_invalid_hash_algo(algo) \ +do { \ + trace_libcfs_warning_invalid_hash_algo(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, algo); \ + \ + CWARN("Unsupported hash algorithm id = %d, max id is %d\n", \ + hash_alg, CFS_HASH_ALG_MAX); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_invalid_mask, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int len, + const char *str), + TP_ARGS(rs, msg_file, msg_line, msg_fn, len, str), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, len) + __string(mask, str) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->len = len; + __assign_str(mask, str); + ), + TP_printk("(%s:%d:%s) unknown mask '%.*s'.\n mask usage: [+|-] ...", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->len, __get_str(mask)) +); + +#define trace_cwarn_invalid_mask(len, mask) \ +do { \ + trace_libcfs_warning_invalid_mask(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, len, \ + mask); \ + \ + CWARN("unknown mask '%.*s'.\n mask usage: [+|-] ...\n",\ + len, mask); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_lock_no_key, + TP_PROTO(struct ratelimit_state *rs, struct lock_class_key *key, + const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(rs, key, msg_file, msg_line, msg_fn), + TP_CONDITION(__ratelimit(rs) && !key), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) Cannot setup class key for percpt lock, you may see recursive locking warnings which are actually fake.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cwarn_lock_no_key(key) \ +do { \ + trace_libcfs_warning_lock_no_key(&libcfs_trace_rs, key, \ + __FILE__, __LINE__, __func__); \ + \ + CWARN("can't show stack: kernel doesn't export show_task\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_no_show_task, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn), + TP_ARGS(rs, msg_file, msg_line, msg_fn), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) can't show stack: kernel doesn't export show_task", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cwarn_no_show_task(void) \ +do { \ + trace_libcfs_warning_no_show_task(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__); \ + \ + CWARN("can't show stack: kernel doesn't export show_task\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_unsupported_mask, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn), + TP_ARGS(rs, msg_file, msg_line, msg_fn), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) You are trying to use a numerical value for the mask - this will be deprecated in a future release.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cwarn_unsupported_mask(void) \ +do { \ + trace_libcfs_warning_unsupported_mask(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__); \ + \ + CWARN("You are trying to use a numerical value for the mask - this will be deprecated in a future release.\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_watchdog_lcw_dump, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int pid), + TP_ARGS(rs, msg_file, msg_line, msg_fn, pid), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, pid) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->pid = pid; + ), + TP_printk("(%s:%d:%s) Process %d was not found in the task list; watchdog callback may be incomplete", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->pid) +); + +#define trace_cwarn_watchdog_lcw_dump(pid) \ +do { \ + trace_libcfs_warning_watchdog_lcw_dump(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, pid); \ + \ + LCONSOLE_WARN("Process %d was not found in the task list; watchdog callback may be incomplete\n", \ + pid); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_watchdog_hang, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, unsigned int pid, + struct timespec64 ts), + TP_ARGS(rs, msg_file, msg_line, msg_fn, pid, ts), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(unsigned int, pid) + __field(unsigned long, sec) + __field(unsigned long, msec) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->pid = pid; + __entry->sec = ts.tv_sec; + __entry->msec = ts.tv_nsec / (NSEC_PER_SEC * 100); + ), + TP_printk("(%s:%d:%s) Service thread pid %u was inactive for %lu.%.02lu secs. The thread might be hung, or it might only be slow and will resume later. Dumping the stack trace for debugging purposes", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->pid, __entry->sec, __entry->msec) +); + +#define trace_cwarn_watchdog_hang(pid, ts) \ +do { \ + trace_libcfs_warning_watchdog_hang(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, pid, ts);\ + \ + LCONSOLE_WARN("Service thread pid %u was inactive for %lu.%.02lu secs. The thread might be hung, or it might only be slow and will resume later. Dumping the stack trace for debugging purposes\n", \ + pid, ts.tv_sec, \ + ts.tv_nsec / (NSEC_PER_SEC * 100)); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_warning_watchdog_overflow, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, unsigned int pid, + struct timespec64 ts, int limit), + TP_ARGS(rs, msg_file, msg_line, msg_fn, pid, ts, limit), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(unsigned int, pid) + __field(unsigned long, sec) + __field(unsigned long, msec) + __field(int, limit) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->pid = pid; + __entry->sec = ts.tv_sec; + __entry->msec = ts.tv_nsec / (NSEC_PER_SEC * 100); + __entry->limit = limit; + ), + TP_printk("(%s:%d:%s) Service thread pid %u was inactive for %lu.%.02lu secs. Watchdog stack traces are limited to 3 per %d seconds, skipping this one.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->pid, __entry->sec, __entry->msec, __entry->limit) +); + +#define trace_cwarn_watchdog_overflow(pid, ts, limit) \ +do { \ + trace_libcfs_warning_watchdog_overflow(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, pid, ts, \ + limit); \ + \ + LCONSOLE_WARN("Service thread pid %u was inactive for %lu.%.02lu secs. Watchdog stack traces are limited to 3 per %d seconds, skipping this one.\n", \ + pid, ts.tv_sec, \ + ts.tv_nsec / (NSEC_PER_SEC * 100), limit); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_allocate_map, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int ncpts), + TP_ARGS(rs, msg_file, msg_line, msg_fn, ncpts), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, ncpts) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->ncpts = ncpts; + ), + TP_printk("(%s:%d:%s) Failed to allocate CPU map(%d)", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->ncpts) +); + +#define trace_cerror_cpu_allocate_map(ncpts) \ +do { \ + trace_libcfs_error_cpu_allocate_map(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, ncpts); \ + \ + CERROR("Failed to allocate CPU map(%d)\n", ncpts); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_allocate_scratch, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn), + TP_ARGS(rs, msg_file, msg_line, msg_fn), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) Failed to allocate scratch cpumask", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cerror_cpu_allocate_scratch(void) \ +do { \ + trace_libcfs_error_cpu_allocate_scratch(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__); \ + \ + CERROR("Failed to allocate scratch cpumask\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_allocate_table, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn), + TP_ARGS(rs, msg_file, msg_line, msg_fn), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) Failed to allocate CPU partition table", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cerror_cpu_allocate_table(void) \ +do { \ + trace_libcfs_error_cpu_allocate_table(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__); \ + \ + CERROR("Failed to allocate CPU partition table\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_bad_ump_setup, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, unsigned int ncpts), + TP_ARGS(rs, msg_file, msg_line, msg_fn, ncpts), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(unsigned int, ncpts) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->ncpts = ncpts; + ), + TP_printk("(%s:%d:%s) Can't support CPU partition number %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->ncpts) +); + +#define trace_cerror_cpu_bad_ump_setup(ncpts) \ +do { \ + trace_libcfs_error_cpu_bad_ump_setup(&libcfs_trace_rs, __FILE__,\ + __LINE__, __func__, ncpts);\ + \ + CERROR("Can't support CPU partition number %d\n", ncpts); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_cpt_out_of_bound, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int cpt, + int num_cpts), + TP_ARGS(rs, msg_file, msg_line, msg_fn, cpt, num_cpts), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpt) + __field(int, ncpts) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpt = cpt; + __entry->ncpts = num_cpts; + ), + TP_printk("(%s:%d:%s) Invalid partition id %d, total partitions %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpt, __entry->ncpts) +); + +#define trace_cerror_cpus_cpt_out_of_bound(cpt, ncpts) \ +do { \ + trace_libcfs_error_cpu_cpt_out_of_bound(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, cpt, ncpts); \ + \ + CERROR("Invalid partition id %d, total partitions %d\n", cpt, \ + ncpts); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_invalid_pattern, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, const char *pattern), + TP_ARGS(rs, msg_file, msg_line, msg_fn, pattern), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(pattern, pattern) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(pattern, pattern); + ), + TP_printk("(%s:%d:%s) Invalid CPU pattern '%s'", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(pattern)) +); + +#define trace_cerror_cpus_invalid_pattern(pattern) \ +do { \ + trace_libcfs_error_cpu_invalid_pattern(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, pattern); \ + \ + CERROR("Invalid CPU pattern '%s'\n", pattern); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_invalid_range, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, const char *str), + TP_ARGS(rs, msg_file, msg_line, msg_fn, str), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(str, str) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(str, str); + ), + TP_printk("(%s:%d:%s) Can't parse number range in %s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(str)) +); + +#define trace_cerror_cpus_invalid_range(str) \ +do { \ + trace_libcfs_error_cpu_invalid_range(&libcfs_trace_rs, __FILE__,\ + __LINE__, __func__, str); \ + \ + CERROR("Can't parse number range in '%s'\n", str); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_empty_partition, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int cpt), + TP_ARGS(rs, msg_file, msg_line, msg_fn, cpt), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) No online CPU is found on partition %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpt) +); + +#define trace_cerror_cpus_empty_partition(cpt) \ +do { \ + trace_libcfs_error_cpu_empty_partition(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, cpt); \ + \ + CERROR("No online CPU is found on partition %d\n", cpt); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_fail_create_cptab, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, const char *pattern), + TP_ARGS(rs, msg_file, msg_line, msg_fn, pattern), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(pattern, pattern) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(pattern, pattern); + ), + TP_printk("(%s:%d:%s) Failed to create cptab from pattern %s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(pattern)) +); + +#define trace_cerror_cpus_fail_create_cptab(pattern) \ +do { \ + trace_libcfs_error_cpu_fail_create_cptab(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, pattern); \ + \ + CERROR("Failed to create cptab from pattern %s\n", pattern); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_fail_dup_pattern, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, const char *pattern), + TP_ARGS(rs, msg_file, msg_line, msg_fn, pattern), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(pattern, pattern) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(pattern, pattern); + ), + TP_printk("(%s:%d:%s) Failed to duplicate pattern %s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(pattern)) +); + +#define trace_cerror_cpus_fail_dup_pattern(pattern) \ +do { \ + trace_libcfs_error_cpu_fail_dup_pattern(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, pattern); \ + \ + CERROR("Failed to duplicate pattern '%s'\n", pattern); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_fail_create_ptable, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int npartition), + TP_ARGS(rs, msg_file, msg_line, msg_fn, npartition), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, npartition) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->npartition = npartition; + ), + TP_printk("(%s:%d:%s) Failed to create ptable with npartitions %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->npartition) +); + +#define trace_cerror_cpus_fail_create_ptable(num_partitions) \ +do { \ + trace_libcfs_error_cpu_fail_create_ptable(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, \ + num_partitions); \ + \ + CERROR("Failed to create ptable with npartitions %d\n", \ + num_partitions); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_fail_state, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int ncpt, + int num_nodes, int num_cores, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, ncpt, num_nodes, + num_cores, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, ncpt) + __field(int, num_nodes) + __field(int, num_cores) + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->ncpt = ncpt; + __entry->num_nodes = num_nodes; + __entry->num_cores = num_cores; + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) Failed (rc=%d) to setup CPU-partition-table with %d CPU-partitions, online HW nodes: %d, HW cpus: %d.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc, __entry->ncpt, __entry->num_nodes, + __entry->num_cores) +); + +#define trace_cerror_cpus_fail_state(ncpt, num_nodes, num_cores, rc) \ +do { \ + trace_libcfs_error_cpu_fail_state(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, ncpt, \ + num_nodes, num_cores, rc); \ + \ + CERROR("Failed (rc=%d) to setup CPU-partition-table with %d CPU-partitions, online HW nodes: %d, HW cpus: %d.\n", \ + rc, ncpt, num_nodes, num_cores); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_missing_bracket, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, const char *pattern, + int cpt), + TP_ARGS(rs, msg_file, msg_line, msg_fn, pattern, cpt), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(pattern, pattern) + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(pattern, pattern); + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) Missing right bracket for cpt %d, %s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpt, __get_str(pattern)) +); + +#define trace_cerror_cpus_missing_bracket(cpt, pattern) \ +do { \ + trace_libcfs_error_cpu_missing_bracket(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, pattern, cpt); \ + \ + CERROR("Missing right bracket for cpt %d, %s\n", cpt, pattern); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_missing, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int cpt), + TP_ARGS(rs, msg_file, msg_line, msg_fn, cpt), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) No online CPU found in CPU partition %d, did someone do CPU hotplug on system? You might need to reload Lustre modules to keep system working well.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpt) +); + +#define trace_cerror_cpus_missing(cpt) \ +do { \ + trace_libcfs_error_cpu_missing(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, cpt); \ + \ + CERROR("No online CPU found in CPU partition %d, did someone do CPU hotplug on system? You might need to reload Lustre modules to keep system working well.\n", \ + cpt); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_cpu_partition_set, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int cpt), + TP_ARGS(rs, msg_file, msg_line, msg_fn, cpt), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) Partition %d has already been set.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpt) +); + +#define trace_cerror_cpus_partition_set(cpt) \ +do { \ + trace_libcfs_error_cpu_partition_set(&libcfs_trace_rs, __FILE__,\ + __LINE__, __func__, cpt); \ + \ + CERROR("Partition %d has already been set.\n", cpt); \ +} while (0) + + + +TRACE_EVENT_CONDITION(libcfs_error_cpu_wrong_cpt_count, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int ncpt, int count), + TP_ARGS(rs, msg_file, msg_line, msg_fn, ncpt, count), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, ncpt) + __field(int, count) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->ncpt = ncpt; + __entry->count = count; + ), + TP_printk("(%s:%d:%s) Expect %d partitions but found %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->ncpt, __entry->count) +); + +#define trace_cerror_cpus_wrong_cpt_count(ncpt, count) \ +do { \ + trace_libcfs_error_cpu_wrong_cpt_count(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, ncpt, count); \ + \ + CERROR("Expect %d partitions but found %d\n", ncpt, count); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_startup_crypto, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) cfs_crypto_regster: error %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_cerror_startup_crypto(rc) \ +do { \ + trace_libcfs_error_startup_crypto(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, rc); \ + \ + CERROR("cfs_crypto_regster: error %d\n", rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_startup_procfs, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) insert_proc: error %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_cerror_startup_procfs(rc) \ +do { \ + trace_libcfs_error_startup_procfs(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, rc); \ + \ + CERROR("insert_proc: error %d\n", rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_startup_misc_dev, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) misc_register: error %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_cerror_startup_misc_dev(rc) \ +do { \ + trace_libcfs_error_startup_misc_dev(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, rc); \ + \ + CERROR("misc_register: error %d\n", rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_startup_wi, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) initialize workitem: error %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_cerror_startup_wi(rc) \ +do { \ + trace_libcfs_error_startup_wi(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, rc); \ + \ + CERROR("initialize workitem: error %d\n", rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_startup_wi_sched, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) Startup workitem scheduler: error: %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_cerror_startup_wi_sched(rc) \ +do { \ + trace_libcfs_error_startup_wi_sched(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, rc); \ + \ + CERROR("Startup workitem scheduler: error: %d\n", rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_watchdog_thread_shutdown, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs) && rc), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) pending timers list was not empty at time of watchdog dispatch shutdown", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cerror_watchdog_thread_shutdown(rc) \ +do { \ + trace_libcfs_error_watchdog_thread_shutdown(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, rc); \ + \ + if (rc) \ + CERROR("pending timers list was not empty at time of watchdog dispatch shutdown\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_watchdog_thread_startup, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, long rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(long, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) error spawning watchdog dispatch thread: %ld", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_cerror_watchdog_thread_startup(rc) \ +do { \ + trace_libcfs_error_watchdog_thread_startup(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, rc); \ + \ + CERROR("error spawning watchdog dispatch thread: %ld\n", rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_wi_thread_start, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, const char *name, + int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, name, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(thread_name, name) + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(thread_name, name); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) Failed to create thread for WI scheduler %s: %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(thread_name), __entry->rc) +); + +#define trace_cerror_wi_thread_start(name, rc) \ +do { \ + trace_libcfs_error_wi_thread_start(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, name, \ + rc); \ + \ + CERROR("Failed to create thread for WI scheduler %s: %d\n", \ + name, rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_timeout_awake, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, u32 id), + TP_ARGS(rs, msg_file, msg_line, msg_fn, id), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(u32, id) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->id = id; + ), + TP_printk("(%s:%d:%s) cfs_fail_timeout id %x awake", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->id) +); + +#define trace_cerror_timeout_awake(id) \ +do { \ + trace_libcfs_error_timeout_awake(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, id); \ + \ + CERROR("cfs_fail_timeout id %x awake\n", id); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_timeout_sleep, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, u32 id, int ms), + TP_ARGS(rs, msg_file, msg_line, msg_fn, id, ms), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(u32, id) + __field(int, ms) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->id = id; + __entry->ms = ms; + ), + TP_printk("(%s:%d:%s) cfs_fail_timeout id %x sleeping for %d ms", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->id, __entry->ms) +); + +#define trace_cerror_timeout_sleep(id, ms) \ +do { \ + trace_libcfs_error_timeout_sleep(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, id, ms); \ + \ + CERROR("cfs_fail_timeout id %x sleeping for %d ms\n", id, ms); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_fail_race_awake, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int id, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, id, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, id) + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->id = id; + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) cfs_fail_race id %x awake, rc=%d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->id, __entry->rc) +); + +#define trace_cerror_fail_race_awake(id, rc) \ +do { \ + trace_libcfs_error_fail_race_awake(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, id, rc); \ + \ + CERROR("cfs_fail_race id %x awake, rc=%d\n", id, rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_fail_race_awaking, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int id), + TP_ARGS(rs, msg_file, msg_line, msg_fn, id), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, id) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->id = id; + ), + TP_printk("(%s:%d:%s) cfs_fail_race id %x awaking", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->id) +); + +#define trace_cerror_fail_race_awaking(id) \ +do { \ + trace_libcfs_error_fail_race_awaking(&libcfs_trace_rs, __FILE__,\ + __LINE__, __func__, id); \ + \ + CERROR("cfs_fail_race id %x awaking\n", id); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_fail_race_sleeping, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int id), + TP_ARGS(rs, msg_file, msg_line, msg_fn, id), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, id) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->id = id; + ), + TP_printk("(%s:%d:%s) cfs_race id %x sleeping", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->id) +); + +#define trace_cerror_fail_race_sleeping(id) \ +do { \ + trace_libcfs_error_fail_race_sleeping(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, id); \ + \ + CERROR("cfs_race id %x sleeping\n", id); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_ioctl_buffer_to_big, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int ioc_len, + int max_len), + TP_ARGS(rs, msg_file, msg_line, msg_fn, ioc_len, max_len), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, len) + __field(int, max_len) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->len = ioc_len; + __entry->max_len = max_len; + ), + TP_printk("(%s:%d:%s) libcfs ioctl: user buffer is too large %d/%d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->len, __entry->max_len) +); + +#define trace_cerror_ioctl_buffer_to_big(len, max) \ +do { \ + trace_libcfs_error_ioctl_buffer_to_big(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, len, max); \ + \ + CERROR("libcfs ioctl: user buffer is too large %d/%d\n", len, \ + max); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_ioctl_buffer_to_small, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn), + TP_ARGS(rs, msg_file, msg_line, msg_fn), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) libcfs ioctl: user buffer is too small for ioctl", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cerror_ioctl_buffer_to_small(void) \ +do { \ + trace_libcfs_error_ioctl_buffer_to_small(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__); \ + \ + CERROR("libcfs ioctl: user buffer is too small for ioctl\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_ioctl_invalid_header, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) libcfs ioctl: data header error %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_cerror_ioctl_invalid_header(rc) \ +do { \ + trace_libcfs_error_ioctl_invalid_header(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, rc); \ + \ + CERROR("libcfs ioctl: data header error %d\n", rc); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_ioctl_invalid_parameter, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn), + TP_ARGS(rs, msg_file, msg_line, msg_fn), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) libcfs ioctl: parameter not correctly formatted", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_cerror_ioctl_invalid_parameter(void) \ +do { \ + trace_libcfs_error_ioctl_invalid_parameter(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__); \ + \ + CERROR("libcfs ioctl: parameter not correctly formatted\n"); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_ioctl_invalid_version, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int expected, + int version), + TP_ARGS(rs, msg_file, msg_line, msg_fn, expected, version), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, expected) + __field(int, version) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->expected = expected; + __entry->version = version; + ), + TP_printk("(%s:%d:%s) libcfs ioctl: version mismatch expected %#x, got %#x", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->expected, __entry->version) +); + +#define trace_cerror_ioctl_invalid_version(expected, version) \ +do { \ + trace_libcfs_error_ioctl_invalid_version(&libcfs_trace_rs, \ + __FILE__, __LINE__, \ + __func__, expected, \ + version); \ + \ + CERROR("libcfs ioctl: version mismatch expected %#x, got %#x\n",\ + expected, version); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_list_excess, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int max, int count), + TP_ARGS(rs, msg_file, msg_line, msg_fn, max, count), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, max) + __field(int, count) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->max = max; + __entry->count = count; + ), + TP_printk("(%s:%d:%s) Number of values %d exceeds max allowed %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->max, __entry->count) +); + +#define trace_cerror_list_excess(max, count) \ +do { \ + trace_libcfs_error_list_excess(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, max, count); \ + \ + CERROR("Number of values %d exceeds max allowed %d\n", max, \ + count); \ +} while (0) + +TRACE_EVENT_CONDITION(libcfs_error_log_upcall, + TP_PROTO(struct ratelimit_state *rs, const char *msg_file, + int msg_line, const char *msg_fn, int rc, + const char *argv0, const char *argv1), + TP_ARGS(rs, msg_file, msg_line, msg_fn, rc, argv0, argv1), + TP_CONDITION(__ratelimit(rs)), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + __string(argv0, argv0) + __string(argv1, argv1) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + __assign_str(argv0, argv0); + __assign_str(argv1, argv1); + ), + TP_printk("(%s:%d:%s) Error %d invoking LNET debug log upcall %s %s; check /sys/kernel/debug/lnet/debug_log_upcall", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc, __get_str(argv0), __get_str(argv1)) +); + +#define trace_cerror_log_upcall(rc, argv0, argv1) \ +do { \ + trace_libcfs_error_log_upcall(&libcfs_trace_rs, __FILE__, \ + __LINE__, __func__, rc, argv0, \ + argv1); \ + \ + CERROR("Error %d invoking LNET debug log upcall %s %s; check /sys/kernel/debug/lnet/debug_log_upcall\n",\ + rc, argv0, argv1); \ +} while (0) + +TRACE_EVENT(libcfs_other_setup, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) libcfs setup OK", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_other(void) \ +do { \ + trace_libcfs_other_setup(__FILE__, __LINE__, __func__); \ + \ + CDEBUG(D_OTHER, "libcfs setup OK\n"); \ +} while (0) + +TRACE_EVENT(libcfs_ha_debug_upcall, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *argv1, const char *argv2), + TP_ARGS(msg_file, msg_line, msg_fn, argv1, argv2), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(argv1, argv1) + __string(argv2, argv1) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(argv1, argv1); + __assign_str(argv2, argv2); + ), + TP_printk("(%s:%d:%s) Invoked LNET debug log upcall %s %s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(argv1), __get_str(argv2)) +); + +#define trace_ha(argv1, argv2) \ +do { \ + trace_libcfs_ha_debug_upcall(__FILE__, __LINE__, __func__, \ + argv1, argv2); \ + \ + CDEBUG(D_HA, "Invoked LNET debug log upcall %s %s\n", argv[0], \ + argv[1]); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_all_offline, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpt), + TP_ARGS(msg_file, msg_line, msg_fn, cpt), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) No online CPU is found in the CPU mask for CPU partition %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpt) +); + +#define trace_info_cpu_all_offline(cpt) \ +do { \ + trace_libcfs_info_cpu_all_offline(__FILE__, __LINE__, __func__, \ + cpt); \ + \ + CDEBUG(D_INFO, "No online CPU is found in the CPU mask for CPU partition %d\n",\ + cpt); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_already_in_cpumask, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpu), + TP_ARGS(msg_file, msg_line, msg_fn, cpu), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpu) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpu = cpu; + ), + TP_printk("(%s:%d:%s) CPU %d is already in cpumask", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpu) +); + +#define trace_info_cpu_already_in_cpumask(cpu) \ +do { \ + trace_libcfs_info_cpu_already_in_cpumask(__FILE__, __LINE__, \ + __func__, cpu); \ + \ + CDEBUG(D_INFO, "CPU %d is already in cpumask\n", cpu); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_changed, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpu, unsigned long action), + TP_ARGS(msg_file, msg_line, msg_fn, cpu, action), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpu) + __field(unsigned long, action) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpu = cpu; + __entry->action = action; + ), + TP_printk("(%s:%d:%s) CPU changed [cpu %u action %lx]", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpu, __entry->action) +); + +#define trace_info_cpu_changed(cpu, action) \ +do { \ + trace_libcfs_info_cpu_changed(__FILE__, __LINE__, __func__, cpu,\ + action); \ + \ + CDEBUG(D_INFO, "CPU changed [cpu %u action %lx]\n", cpu, \ + action); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_extra_mapping, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpu_id, int cpt), + TP_ARGS(msg_file, msg_line, msg_fn, cpu_id, cpt), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpu_id) + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpu_id = cpu_id; + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) CPU %d is already in partition %d cpumask", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpu_id, __entry->cpt) +); + +#define trace_info_cpu_extra_mapping(cpu_id, cpt) \ +do { \ + trace_libcfs_info_cpu_extra_mapping(__FILE__, __LINE__, \ + __func__, cpu_id, cpt); \ + \ + CDEBUG(D_INFO, "CPU %d is already in partition %d cpumask\n", \ + cpu_id, cpt); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_invalid_id, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpu_id), + TP_ARGS(msg_file, msg_line, msg_fn, cpu_id), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpu_id) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpu_id = cpu_id; + ), + TP_printk("(%s:%d:%s) Invalid CPU id %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpu_id) +); + +#define trace_info_cpu_invalid_id(cpu_id) \ +do { \ + trace_libcfs_info_cpu_invalid_id(__FILE__, __LINE__, __func__, \ + cpu_id); \ + \ + CDEBUG(D_INFO, "Invalid CPU id %d\n", cpu_id); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_invalid_numa, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int numa_id, int cpu_id), + TP_ARGS(msg_file, msg_line, msg_fn, numa_id, cpu_id), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, numa_id) + __field(int, cpu_id) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->numa_id = numa_id; + __entry->cpu_id = cpu_id; + ), + TP_printk("(%s:%d:%s) Invalid NUMA id %d for CPU partition %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->numa_id, __entry->cpu_id) +); + +#define trace_info_cpu_invalid_numa(numa_id, cpu_id) \ +do { \ + trace_libcfs_info_cpu_invalid_numa(__FILE__, __LINE__, __func__,\ + numa_id, cpu_id); \ + \ + CDEBUG(D_INFO, "Invalid NUMA id %d for CPU partition %d\n", \ + numa_id, cpu_id); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_not_mapped, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpu_id, int cpt), + TP_ARGS(msg_file, msg_line, msg_fn, cpu_id, cpt), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpu_id) + __field(int, cpt) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpu_id = cpu_id; + __entry->cpt = cpt; + ), + TP_printk("(%s:%d:%s) CPU %d is not in cpu-partition %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpu_id, __entry->cpt) +); + +#define trace_info_cpu_not_mapped(cpu_id, cpt) \ +do { \ + trace_libcfs_info_cpu_not_mapped(__FILE__, __LINE__, __func__, \ + cpu_id, cpt); \ + \ + CDEBUG(D_INFO, "CPU %d is not in cpu-partition %d\n", cpu_id, \ + cpt); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_offline, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpu_id), + TP_ARGS(msg_file, msg_line, msg_fn, cpu_id), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpu_id) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpu_id = cpu_id; + ), + TP_printk("(%s:%d:%s) CPU %d is invalid or it's offline", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpu_id) +); + +#define trace_info_cpu_offline(cpu_id) \ +do { \ + trace_libcfs_info_cpu_offline(__FILE__, __LINE__, __func__, \ + cpu_id); \ + \ + CDEBUG(D_INFO, "CPU %d is invalid or it's offline\n", cpu_id); \ +} while (0) + +TRACE_EVENT(libcfs_info_cpu_unavailable, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int cpt, struct cfs_cpt_table *cptab), + TP_ARGS(msg_file, msg_line, msg_fn, cpt, cptab), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cpt) + __field(struct cfs_cpt_table *, cptab) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cpt = cpt; + __entry->cptab = cptab; + ), + TP_printk("(%s:%d:%s) Try to unset cpu %d which is not in CPT-table %p", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cpt, __entry->cptab) +); + +#define trace_info_cpu_unavailable(cpt, cptab) \ +do { \ + trace_libcfs_info_cpu_unavailable(__FILE__, __LINE__, __func__, \ + cpt, cptab); \ + \ + CDEBUG(D_INFO, "Try to unset cpu %d which is not in CPT-table %p\n",\ + cpt, cptab); \ +} while (0) + +TRACE_EVENT(libcfs_info_crypto_crc32_pclmul, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) PCLMULQDQ-NI instructions are not detected.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_crypto_crc32_pclmul_missing(void) \ +do { \ + trace_libcfs_info_crypto_crc32_pclmul(__FILE__, __LINE__, \ + __func__); \ + \ + CDEBUG(D_INFO, "PCLMULQDQ-NI instructions are not detected.\n");\ +} while (0) + +TRACE_EVENT(libcfs_info_crypto_crc32c_pclmul, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) CRC32 instruction are not detected.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_crypto_crc32c_pclmul_missing(void) \ +do { \ + trace_libcfs_info_crypto_crc32c_pclmul(__FILE__, __LINE__, \ + __func__); \ + \ + CDEBUG(D_INFO, "CRC32 instruction are not detected.\n"); \ +} while (0) + +TRACE_EVENT(libcfs_info_crypto_ahash_alloc_fail, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *name), + TP_ARGS(msg_file, msg_line, msg_fn, name), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(cht_name, name) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(cht_name, name); + ), + TP_printk("(%s:%d:%s) Failed to alloc crypto hash %s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(cht_name)) +); + +#define trace_info_crypto_ahash_alloc_fail(cht_name) \ +do { \ + trace_libcfs_info_crypto_ahash_alloc_fail(__FILE__, __LINE__, \ + __func__, cht_name); \ + \ + CDEBUG(D_INFO, "Failed to alloc crypto hash %s\n", cht_name); \ +} while (0) + +TRACE_EVENT(libcfs_info_crypto_request_alloc_fail, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *name), + TP_ARGS(msg_file, msg_line, msg_fn, name), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(cht_name, name) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(cht_name, name); + ), + TP_printk("(%s:%d:%s) Failed to alloc ahash_request for %s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(cht_name)) +); + +#define trace_info_crypto_request_alloc_fail(cht_name) \ +do { \ + trace_libcfs_info_crypto_request_alloc_fail(__FILE__, __LINE__, \ + __func__, cht_name);\ + \ + CDEBUG(D_INFO, "Failed to alloc ahash_request for %s\n", \ + cht_name); \ +} while (0) + +TRACE_EVENT(libcfs_info_crypto_setup, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *algo, const char *driver, int speed), + TP_ARGS(msg_file, msg_line, msg_fn, algo, driver, speed), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(algo, algo) + __string(driver, driver) + __field(int, speed) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(algo, algo); + __assign_str(driver, driver); + __entry->speed = speed; + ), + TP_printk("(%s:%d:%s) Using crypto hash: %s (%s) speed %d MB/s", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(algo), __get_str(driver), __entry->speed) +); + +#define trace_info_crypto_setup(algo, driver, speed) \ +do { \ + trace_libcfs_info_crypto_setup(__FILE__, __LINE__, __func__, \ + algo, driver, speed); \ + \ + CDEBUG(D_INFO, "Using crypto hash: %s (%s) speed %d MB/s\n", \ + algo, driver, speed); \ +} while (0) + +TRACE_EVENT(libcfs_info_crypto_test_fail, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *algo, int err), + TP_ARGS(msg_file, msg_line, msg_fn, algo, err), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(algo, algo) + __field(int, err) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(algo, algo); + __entry->err = err; + ), + TP_printk("(%s:%d:%s) Crypto hash algorithm %s test error: rc = %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(algo), __entry->err) +); + +#define trace_info_crypto_test_fail(algo, err) \ +do { \ + trace_libcfs_info_crypto_test_fail(__FILE__, __LINE__, __func__,\ + algo, err); \ + \ + CDEBUG(D_INFO, "Crypto hash algorithm %s test error: rc = %d\n",\ + algo, err); \ +} while (0) + +TRACE_EVENT(libcfs_info_fail_loc, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + u32 id, u32 value), + TP_ARGS(msg_file, msg_line, msg_fn, id, value), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(u32, cfs_fail_loc) + __field(u32, value) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cfs_fail_loc = id; + __entry->value = value; + ), + TP_printk("(%s:%d:%s) *** cfs_fail_loc=%x, val=%u***", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cfs_fail_loc, __entry->value) +); + +#define trace_info_fail_loc(id, value) \ +do { \ + trace_libcfs_info_fail_loc(__FILE__, __LINE__, __func__, id, \ + value); \ + \ + CDEBUG(D_INFO, "*** cfs_fail_loc=%x, val=%u***\n", id, value); \ +} while (0) + +TRACE_EVENT(libcfs_info_hash_flushing, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *name, unsigned int iter), + TP_ARGS(msg_file, msg_line, msg_fn, name, iter), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(hs_name, name) + __field(unsigned int, iter) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(hs_name, name); + __entry->iter = iter; + ), + TP_printk("(%s:%d:%s) Try to empty hash: %s, loop: %u", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(hs_name), __entry->iter) +); + +#define trace_info_hash_flushing(hs_name, i) \ +do { \ + trace_libcfs_info_hash_flushing(__FILE__, __LINE__, __func__, \ + hs_name, i); \ + \ + CDEBUG(D_INFO, "Try to empty hash: %s, loop: %u\n", hs_name, i);\ +} while (0) + +TRACE_EVENT(libcfs_info_hash_quit_rehashing, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int rc), + TP_ARGS(msg_file, msg_line, msg_fn, rc), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, rc) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->rc = rc; + ), + TP_printk("(%s:%d:%s) early quit of rehashing: %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->rc) +); + +#define trace_info_hash_quit_rehashing(rc) \ +do { \ + trace_libcfs_info_hash_quit_rehashing(__FILE__, __LINE__, \ + __func__, rc); \ + \ + CDEBUG(D_INFO, "early quit of rehashing: %d\n", rc); \ +} while (0) + +TRACE_EVENT(libcfs_info_ptask_setup, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *name, unsigned int weight, const char *plist, + const char *cblist), + TP_ARGS(msg_file, msg_line, msg_fn, name, weight, plist, cblist), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(name, name) + __field(unsigned int, weight) + __string(plist, plist) + __string(cblist, cblist) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(name, name); + __entry->weight = weight; + __assign_str(plist, plist); + __assign_str(cblist, cblist); + ), + TP_printk("(%s:%d:%s) %s weight=%u plist='%s' cblist='%s'", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(name), __entry->weight, __get_str(plist), + __get_str(cblist)) +); + +#define trace_info_ptask_setup(name, weight, plist, cblist) \ +do { \ + trace_libcfs_info_ptask_setup(__FILE__, __LINE__, __func__, \ + name, weight, plist, cblist); \ + \ + CDEBUG(D_INFO, "%s weight=%u plist='%s' cblist='%s'\n", name, \ + weight, plist, cblist); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_alloc_failed, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) Could not allocate new lc_watchdog", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_watchdog_alloc_failed(void) \ +do { \ + trace_libcfs_info_watchdog_alloc_failed(__FILE__, __LINE__, \ + __func__); \ + \ + CDEBUG(D_INFO, "Could not allocate new lc_watchdog\n"); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_dispatch_starting, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) starting dispatch thread", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_watchdog_dispatch_starting(void) \ +do { \ + trace_libcfs_info_watchdog_dispatch_starting(__FILE__, __LINE__,\ + __func__); \ + \ + CDEBUG(D_INFO, "starting dispatch thread\n"); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_dispatch_complete, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) starting dispatch thread", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_watchdog_dispatch_complete(void) \ +do { \ + trace_libcfs_info_watchdog_dispatch_complete(__FILE__, __LINE__,\ + __func__); \ + \ + CDEBUG(D_INFO, "starting dispatch thread\n"); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_dispatch_main, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) Watchdog got woken up...", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_watchdog_dispatch_main(void) \ +do { \ + trace_libcfs_info_watchdog_dispatch_main(__FILE__, __LINE__, \ + __func__); \ + \ + CDEBUG(D_INFO, "Watchdog got woken up...\n"); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_dispatch_stopping, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) trying to stop watchdog dispatcher.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_watchdog_dispatch_stopping(void) \ +do { \ + trace_libcfs_info_watchdog_dispatch_stopping(__FILE__, __LINE__,\ + __func__); \ + \ + CDEBUG(D_INFO, "trying to stop watchdog dispatcher."); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_dispatch_stopped, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) watchdog dispatcher has shut down.", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_watchdog_dispatch_stopped(void) \ +do { \ + trace_libcfs_info_watchdog_dispatch_stopped(__FILE__, __LINE__, \ + __func__); \ + \ + CDEBUG(D_INFO, "watchdog dispatcher has shut down.\n"); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_flagged_stop, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn), + TP_ARGS(msg_file, msg_line, msg_fn), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + ), + TP_printk("(%s:%d:%s) LCW_FLAG_STOP set, shutting down...", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func)) +); + +#define trace_info_watchdog_flagged_stop(void) \ +do { \ + trace_libcfs_info_watchdog_flagged_stop(__FILE__, __LINE__, \ + __func__); \ + \ + CDEBUG(D_INFO, "LCW_FLAG_STOP set, shutting down...\n"); \ +} while (0) + +TRACE_EVENT(libcfs_info_watchdog_pid, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int pid), + TP_ARGS(msg_file, msg_line, msg_fn, pid), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, pid) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->pid = pid; + ), + TP_printk("(%s:%d:%s) found lcw for pid %d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->pid) +); + +#define trace_info_watchdog_pid(pid) \ +do { \ + trace_libcfs_info_watchdog_pid(__FILE__, __LINE__, __func__, \ + pid); \ + \ + CDEBUG(D_INFO, "found lcw for pid %d\n", pid); \ +} while (0) + +TRACE_EVENT(libcfs_info_workitem_destroy, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *ws_name), + TP_ARGS(msg_file, msg_line, msg_fn, ws_name), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(ws_name, ws_name) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(ws_name, ws_name); + ), + TP_printk("(%s:%d:%s) %s is in progress of stopping", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(ws_name)) +); + +#define trace_info_workitem_destroy(ws_name) \ +do { \ + trace_libcfs_info_workitem_destroy(__FILE__, __LINE__, __func__,\ + ws_name); \ + \ + CDEBUG(D_INFO, "%s is in progress of stopping\n", ws_name); \ +} while (0) + +TRACE_EVENT(libcfs_ioctl_invalid, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int ioctl_cmd), + TP_ARGS(msg_file, msg_line, msg_fn, ioctl_cmd), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, cmd) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cmd = ioctl_cmd; + ), + TP_printk("(%s:%d:%s) invalid ioctl ( type %d, nr %d, size %d )", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + _IOC_TYPE(__entry->cmd), _IOC_NR(__entry->cmd), + _IOC_SIZE(__entry->cmd)) +); + +#define trace_ioctl_failed(cmd) \ +do { \ + trace_libcfs_ioctl_invalid(__FILE__, __LINE__, __func__, cmd); \ + \ + CDEBUG(D_IOCTL, "invalid ioctl ( type %d, nr %d, size %d )\n", \ + _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd)); \ +} while (0) + +TRACE_EVENT(libcfs_ioctl, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + unsigned long ioctl_cmd), + TP_ARGS(msg_file, msg_line, msg_fn, ioctl_cmd), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(unsigned long, cmd) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->cmd = ioctl_cmd; + ), + TP_printk("(%s:%d:%s) libcfs ioctl cmd %lu", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->cmd) +); + +#define trace_ioctl(cmd) \ +do { \ + trace_libcfs_ioctl(__FILE__, __LINE__, __func__, cmd); \ + \ + CDEBUG(D_IOCTL, "libcfs ioctl cmd %lu\n", cmd); \ +} while (0) + +TRACE_EVENT(libcfs_warning_hash_depth, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + const char *hs_name, int bits, int dep_max, int bkt, + int dep_off), + TP_ARGS(msg_file, msg_line, msg_fn, hs_name, bits, dep_max, bkt, + dep_off), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __string(name, hs_name) + __field(int, bits) + __field(int, dep_max) + __field(int, bkt) + __field(int, dep_off) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __assign_str(name, hs_name); + __entry->bits = bits; + __entry->dep_max = dep_max; + __entry->bkt = bkt; + __entry->dep_off = dep_off; + ), + TP_printk("(%s:%d:%s) #### HASH %s (bits: %d): max depth %d at bucket %d/%d", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __get_str(name), __entry->bits, __entry->dep_max, + __entry->bkt, __entry->dep_off) +); + +#define trace_warn_hash_depth(name, bits, max, bkt, off) \ +do { \ + trace_libcfs_warning_hash_depth(__FILE__, __LINE__, __func__, \ + name, bits, max, bkt, dep_off); \ + \ + LCONSOLE_WARN("#### HASH %s (bits: %d): max depth %d at bucket %d/%d\n",\ + hs->hs_name, bits, dep, bkt, off); \ +} while (0) + +TRACE_EVENT(libcfs_warning_watchdog_expired, + TP_PROTO(const char *msg_file, int msg_line, const char *msg_fn, + int pid, const char *message, struct timespec64 ts), + TP_ARGS(msg_file, msg_line, msg_fn, pid, message, ts), + TP_STRUCT__entry( + __string(msg_file, msg_file ? msg_file : "") + __field(int, msg_line) + __string(msg_func, msg_fn ? msg_fn : "") + __field(int, pid) + __string(msg, message) + __field(unsigned long, sec) + __field(unsigned long, msec) + ), + TP_fast_assign( + __assign_str(msg_file, kbasename(msg_file)); + __entry->msg_line = msg_line; + __assign_str(msg_func, msg_fn); + __entry->pid = pid; + __assign_str(msg, message); + __entry->sec = ts.tv_sec; + __entry->msec = ts.tv_nsec / (NSEC_PER_SEC * 100); + ), + TP_printk("(%s:%d:%s) Service thread pid %u %s after %lu.%.02lu secs. This indicates the system was overloaded (too many service threads, or there were not enough hardware resources).", + __get_str(msg_file), __entry->msg_line, __get_str(msg_func), + __entry->pid, __get_str(msg), __entry->sec, __entry->msec) +); + +#define trace_warn_watchdog_expired(pid, msg, ts) \ +do { \ + trace_libcfs_warning_watchdog_expired(__FILE__, __LINE__, \ + __func__, pid, msg, ts); \ + \ + LCONSOLE_WARN("Service thread pid %u %s after %lu.%.02lu secs. This indicates the system was overloaded (too many service threads, or there were not enough hardware resources).\n", \ + pid, msg, ts.tv_sec, \ + ts.tv_nsec / (NSEC_PER_SEC * 100)); \ +} while (0) + +#endif /* __LIBCFS_TRACE_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . + +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE libcfs_trace + +#include diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c index 16a3ae7..0160595 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c @@ -30,10 +30,11 @@ * Lustre is a trademark of Sun Microsystems, Inc. */ -#define DEBUG_SUBSYSTEM S_LNET +#define DEBUG_SUBSYSTEM S_LIBCFS #define LUSTRE_TRACEFILE_PRIVATE #include +#include "../libcfs_trace.h" #include "../tracefile.h" /* percents to share the total debug memory for each type */ @@ -201,6 +202,7 @@ void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking) switch (hdr->ph_subsys) { case S_LND: case S_LNET: + case S_LIBCFS: return "LNetError"; default: return "LustreError"; @@ -213,6 +215,7 @@ void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking) switch (hdr->ph_subsys) { case S_LND: case S_LNET: + case S_LIBCFS: return "LNet"; default: return "Lustre"; diff --git a/drivers/staging/lustre/lnet/libcfs/tracefile.c b/drivers/staging/lustre/lnet/libcfs/tracefile.c index 68f283a..56441b8 100644 --- a/drivers/staging/lustre/lnet/libcfs/tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/tracefile.c @@ -420,7 +420,8 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata, __LASSERT(tage->used <= PAGE_SIZE); console: - if (!(mask & libcfs_printk)) { + if (!(mask & libcfs_printk) || + (msgdata->msg_subsys & S_LIBCFS)) { /* no console output requested */ if (tcd) cfs_trace_put_tcd(tcd); diff --git a/drivers/staging/lustre/lnet/libcfs/tracefile.h b/drivers/staging/lustre/lnet/libcfs/tracefile.h index c3547cd..fd5f75c 100644 --- a/drivers/staging/lustre/lnet/libcfs/tracefile.h +++ b/drivers/staging/lustre/lnet/libcfs/tracefile.h @@ -97,12 +97,6 @@ int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, #define CFS_TRACEFILE_SIZE (500 << 20) -/* - * Size of a buffer for sprinting console messages if we can't get a page - * from system - */ -#define CFS_TRACE_CONSOLE_BUFFER_SIZE 1024 - union cfs_trace_data_union { struct cfs_trace_cpu_data { /* -- 1.8.3.1 From jsimmons at infradead.org Sun Aug 20 02:52:26 2017 From: jsimmons at infradead.org (James Simmons) Date: Sun, 20 Aug 2017 03:52:26 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: fix structure size for ARM OABI In-Reply-To: References: <1502894655-9731-1-git-send-email-cakturk@gmail.com> <20170817162639.GA13066@kroah.com> Message-ID: > On Aug 17, 2017, at 10:26, Greg KH wrote: > > > > On Wed, Aug 16, 2017 at 05:44:15PM +0300, Cihangir Akturk wrote: > >> When building the kernel for the ARM architecture without setting > >> CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 > >> differs, due to different alignment requirements of OABI and EABI. I have to ask are you testing the lustre on ARM? > >> Marking the anonymous union within struct lov_user_md_v3 as > >> '_packed' solves this issue. Otherwise we get the following > >> error: > >> > >> drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion > >> of macro ‘BUILD_BUG_ON’ > >> BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3)); > >> > >> Signed-off-by: Cihangir Akturk > >> --- > >> drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > > > This file is no longer in the tree :( > > With James' recent patch series, this has moved to include/uapi/linux/lustre/lustre_user.h BTW is __packed valid for UAPI headers? From jsimmons at infradead.org Sun Aug 20 02:53:39 2017 From: jsimmons at infradead.org (James Simmons) Date: Sun, 20 Aug 2017 03:53:39 +0100 (BST) Subject: [lustre-devel] [PATCH v2 01/14] staging: lustre: llite: Remove filtering of seclabel xattr In-Reply-To: <20170817162348.GA22834@kroah.com> References: <1502727664-29438-1-git-send-email-jsimmons@infradead.org> <1502727664-29438-2-git-send-email-jsimmons@infradead.org> <20170817162348.GA22834@kroah.com> Message-ID: > On Mon, Aug 14, 2017 at 12:20:51PM -0400, James Simmons wrote: > > From: Robin Humble > > > > The security.capability xattr is used to implement File > > Capabilities in recent Linux versions. Capabilities are a > > fine grained approach to granting executables elevated > > privileges. eg. /bin/ping can have capabilities > > cap_net_admin, cap_net_raw+ep instead of being setuid root. > > > > This xattr has long been filtered out by llite, initially for > > stability reasons (b15587), and later over performance > > concerns as this xattr is read for every file with eg. > > 'ls --color'. Since LU-2869 xattr's are cached on clients, > > alleviating most performance concerns. > > > > Removing llite's filtering of the security.capability xattr > > enables using Lustre as a root filesystem, which is used on > > some large clusters. > > > > Signed-off-by: Robin Humble > > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9562 > > Reviewed-on: https://review.whamcloud.com/27292 > > Reviewed-by: John L. Hammond > > Reviewed-by: Sebastien Buisson > > Reviewed-by: Oleg Drokin > > Signed-off-by: James Simmons > > --- > > Changelog: > > > > v1) Initial submit with wrong patch attached. > > v2) Proper patch this time. > > I don't see a v1 patch anywhere... Its the patch I asked you to drop earlier. Same commit message but I mixed up the patch with another patch. > Anyway, when you do this, please make your subject such that I can sort > the emails properly and they show up in the correct order, so put the > "v2" after the patch number like this: > > Subject: [PATCH 01/14 v2] staging: lustre: llite: Remove filtering of > > I think git does that correctly for you automatically if you use it... Will do. From jsimmons at infradead.org Sun Aug 20 02:58:03 2017 From: jsimmons at infradead.org (James Simmons) Date: Sun, 20 Aug 2017 03:58:03 +0100 (BST) Subject: [lustre-devel] [PATCH 0/6] dcache/namei fixes for lustre In-Reply-To: <150164273003.13199.7841976922211510658.stgit@noble> References: <150164273003.13199.7841976922211510658.stgit@noble> Message-ID: > This series is a revised version of two patches I sent > previously (one of which was sadly broken). > That patch has been broken into multiple parts for easy > review. The other is included unchanged as the last of > this series. > > I was drawn to look at this code due to the tests on > DCACHE_DISCONNECTED which are often wrong, and it turns out > they are used wrongly in lustre too. Fixing one led to some > clean-up. Fixing the other is straight forward. > > A particular change here from the previous posting is > the first patch which tests for DCACHE_PAR_LOOKUP in ll_dcompare(). > Without this patch, two threads can be looking up the same > name in a given directory in parallel. This parallelism lead > to my concerns about needing improved locking in ll_splice_alias(). > Instead of improving the locking, I now avoid the need for it > by fixing ll_dcompare. > > This code passes basic "smoke tests". > > Note that the cast to "struct dentry *" in the first patch is because > we have a "const struct dentry *" but d_in_lookup() requires a > pointer to a non-const structure. I'll send a separate patch to > change d_in_lookup(). To let you know this patch has been under going testing and we have a ticket open to track the progess: https://jira.hpdd.intel.com/browse/LU-9868 Your patch did reveal that a piece of a fix landed earlier is missing :-( So currently the client can oops. I will send the fix shortly but this work will have to rebased after. As soon as we can get some cycles we will figure out what is going on. Thanks for helping out. > NeilBrown (6): > staging: lustre: llite: handle DCACHE_PAR_LOOKUP in ll_dcompare > staging: lustre: llite: use d_splice_alias for directories. > staging: lustre: llite: remove directory-specific code from ll_find_alias() > staging: lluste: llite: simplify ll_find_alias() > staging: lustre: llite: refine ll_find_alias based on d_exact_alias > staging: lustre: llite: fix incorrect DCACHE_DISCONNECTED test > > > drivers/staging/lustre/lustre/llite/dcache.c | 10 +++ > .../staging/lustre/lustre/llite/llite_internal.h | 2 - > drivers/staging/lustre/lustre/llite/namei.c | 60 ++++++++++---------- > 3 files changed, 40 insertions(+), 32 deletions(-) > > -- > Signature > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > From cakturk at gmail.com Mon Aug 21 12:38:32 2017 From: cakturk at gmail.com (Cihangir Akturk) Date: Mon, 21 Aug 2017 15:38:32 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: fix structure size for ARM OABI In-Reply-To: References: <1502894655-9731-1-git-send-email-cakturk@gmail.com> <20170817162639.GA13066@kroah.com> Message-ID: <20170821123832.GC6148@yoga.localdomain> On Sun, Aug 20, 2017 at 03:52:26AM +0100, James Simmons wrote: > > > On Aug 17, 2017, at 10:26, Greg KH wrote: > > > > > > On Wed, Aug 16, 2017 at 05:44:15PM +0300, Cihangir Akturk wrote: > > >> When building the kernel for the ARM architecture without setting > > >> CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 > > >> differs, due to different alignment requirements of OABI and EABI. > > I have to ask are you testing the lustre on ARM? No, I was just compiling the kernel for ARM architecture, and I hit this issue. If it's possible, I can give it a try with a bunch of raspberry pis or another cheap board? > > > >> Marking the anonymous union within struct lov_user_md_v3 as > > >> '_packed' solves this issue. Otherwise we get the following > > >> error: > > >> > > >> drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion > > >> of macro ‘BUILD_BUG_ON’ > > >> BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3)); > > >> > > >> Signed-off-by: Cihangir Akturk > > >> --- > > >> drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +- > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > This file is no longer in the tree :( > > > > With James' recent patch series, this has moved to include/uapi/linux/lustre/lustre_user.h > > BTW is __packed valid for UAPI headers? From dan.carpenter at oracle.com Wed Aug 23 06:51:31 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Wed, 23 Aug 2017 09:51:31 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: obd: check for allocation failure Message-ID: <20170823064917.afedqlponb5qu6og@mwanda> lustre_cfg_new() can fail with ERR_PTR(-ENOMEM) so we should check for that. Fixes: d7e09d0397e8 ("staging: add Lustre file system client support") Signed-off-by: Dan Carpenter diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 8e0d4b1d86dc..7cb99f11caa0 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -159,6 +159,8 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, lustre_cfg_bufs_set_string(&bufs, 4, s4); lcfg = lustre_cfg_new(cmd, &bufs); + if (IS_ERR(lcfg)) + return PTR_ERR(lcfg); lcfg->lcfg_nid = nid; rc = class_process_config(lcfg); lustre_cfg_free(lcfg); From oleg.drokin at intel.com Tue Aug 22 16:10:45 2017 From: oleg.drokin at intel.com (Oleg Drokin) Date: Tue, 22 Aug 2017 12:10:45 -0400 Subject: [lustre-devel] new tag 2.10.52 Message-ID: <1BBE5547-428A-413F-9B0F-6CF04EC1EE60@intel.com> Hello! I just tagged 2.10.52 in master development branch of Lustre community tree. Here's the changelog: Alex Zhuravlev (1): LU-7899 osd: batch EA updates Amir Shehata (1): LU-9817 lnet: safe access to msg Andreas Dilger (1): LU-8619 lbuild: update ZFS to use 0.7.1 Andriy Skulysh (1): LU-8578 ldlm: ELC shouldn't wait on lock flush Bob Glossman (2): LU-9712 kernel: correct malformed ChangeLog LU-9816 kernel: kernel upgrade RHEL7.4 [3.10.0-693.el7] Brian J. Murrell (2): LU-9731 Limit work-around to EL7 only LU-9850 patchless client should conflict patched kernel Bruno Faccini (1): LU-9744 mdt: avoid wrong CLF_HSM_DIRTY report in ChangeLog Chris Hanna (1): LU-8275 tests: add flag to enable secret shared key for tests Deepa Dinamani (1): LU-9558 kernel: replace CURRENT_TIME macro Dmitry Eremin (1): LU-8066 libcfs: migrate to debugfs Elena Gryaznova (1): LU-8618 tests: ha.sh improvements Emoly Liu (1): LU-9376 tests: remove sanity.sh test_103b Fan Yong (1): LU-9499 lfsck: set target bitmap properly Hongchao Zhang (2): LU-9364 test: wait rmultiop_start to start LU-9235 libcfs: don't dump stack if just touched James Nunez (4): LU-9826 tests: Do not run conf-sanity 32b with ZFS LU-9295 test: skip sanity-lfsck 9 less than 2.8 LU-9887 tests: ignore error sanity-lfsck test 9a,b LU-9888 tests: Do not run conf-sanity 32b with ZFS James Simmons (9): LU-7356 build: handle configure options for mount plugin LU-9019 mgs: migrate to 64 bit time LU-6142 socklnd: remove typedefs from ksocklnd LU-9758 build: allow disabling lustre test and iokit rpm creation LU-8958 llite: remove llite_loop left overs LU-6245 uapi: move libcfs/lnet UAPI header into own uapi directory LU-6245 tests: remove it_test LU-6401 uapi: migrate remaining uapi headers to uapi directory LU-8066 obd: fix LPROC_SEQ_FOPS macros for debugfs Jinshan Xiong (2): LU-9054 tests: disable test_312 due to zdb issue LU-8999 quota: fix quota iteration interface Lai Siyao (2): LU-9748 lod: safely access update log stat LU-9725 quota: always deregister lwp Nathaniel Clark (2): LU-9799 mount: Call read_ldd with initialized mount type LU-9745 dkms: Fix included dkms.conf file Oleg Drokin (3): LU-9829 lnet: Properly dereference string pointer LU-9832 tests: Use sys/sysmacros.h for major/minor/makedev New tag 2.10.52 Ruth A Klundt (1): LU-9494 test: Improve message for skipping tests Sergey Cheremencev (1): LU-9266 hsm: don't add request when cdt is stopped Steve Guminski (3): LU-6210 utils: Use C99 initializer in jt_nodemap_test_id() LU-6210 utils: Use C99 initializer in jt_nodemap_del_range() LU-6210 utils: Use C99 struct initializers in lsnapshot Wang Shilong (1): LU-9597 ofd: fix race for project setattr Wei Liu (1): LU-9826 test: Recreate disk2_7-zfs image to have a bigger file system dilip krishnagiri (1): LU-9012 contrib: to rename file ending with :rhel5.ed From gregkh at linuxfoundation.org Wed Aug 23 23:22:54 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Wed, 23 Aug 2017 16:22:54 -0700 Subject: [lustre-devel] [PATCH] staging: lustre: obd: check for allocation failure In-Reply-To: <20170823064917.afedqlponb5qu6og@mwanda> References: <20170823064917.afedqlponb5qu6og@mwanda> Message-ID: <20170823232254.GA6868@kroah.com> On Wed, Aug 23, 2017 at 09:51:31AM +0300, Dan Carpenter wrote: > lustre_cfg_new() can fail with ERR_PTR(-ENOMEM) so we should check for > that. > > Fixes: d7e09d0397e8 ("staging: add Lustre file system client support") > Signed-off-by: Dan Carpenter > > diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c > index 8e0d4b1d86dc..7cb99f11caa0 100644 > --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c > +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c > @@ -159,6 +159,8 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, > lustre_cfg_bufs_set_string(&bufs, 4, s4); > > lcfg = lustre_cfg_new(cmd, &bufs); > + if (IS_ERR(lcfg)) > + return PTR_ERR(lcfg); > lcfg->lcfg_nid = nid; > rc = class_process_config(lcfg); > lustre_cfg_free(lcfg); Doesn't apply to my tree anymore :( From dan.carpenter at oracle.com Sat Aug 26 06:02:55 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Sat, 26 Aug 2017 09:02:55 +0300 Subject: [lustre-devel] [PATCH 1/3] staging: lustre: obdclass: return -EFAULT if copy_to_user() fails Message-ID: <20170826060255.tf4vnkfd4e2rey45@mwanda> We recently changed from using obd_ioctl_popdata() to calling copy_to_user() directly. This if statement was supposed to be deleted but it was over looked. "err" is zero at this point so it means we return success. Fixes: b03679f6a41a ("staging: lustre: uapi: remove obd_ioctl_popdata() wrapper") Signed-off-by: Dan Carpenter diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 57c84e8e1d8e..8ad3adb2ceb1 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -262,7 +262,6 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) dev); if (copy_to_user((void __user *)arg, data, sizeof(*data))) - if (err) err = -EFAULT; goto out; } From dan.carpenter at oracle.com Sat Aug 26 06:04:18 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Sat, 26 Aug 2017 09:04:18 +0300 Subject: [lustre-devel] [PATCH 2/3] staging: lustre: obdclass: return -EFAULT if copy_from_user() fails Message-ID: <20170826060418.quvhtwbayenb7a5j@mwanda> The copy_from_user() function returns the number of bytes which we weren't able to copy. We don't want to return that to the user but instead we want to return -EFAULT. Fixes: d7e09d0397e8 ("staging: add Lustre file system client support") Signed-off-by: Dan Carpenter diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 57c84e8e1d8e..545358923271 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -180,7 +180,8 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) err = -ENOMEM; goto out; } - err = copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1); + if (copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1)) + err = -EFAULT; if (!err) err = lustre_cfg_sanity_check(lcfg, data->ioc_plen1); if (!err) From dan.carpenter at oracle.com Sat Aug 26 06:04:46 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Sat, 26 Aug 2017 09:04:46 +0300 Subject: [lustre-devel] [PATCH 3/3] staging: lustre: obdclass: fix checking for obd_init_checks() Message-ID: <20170826060446.ezohk7527vuphcy7@mwanda> The obd_init_checks() function can either return -EOVERFLOW or -EINVAL but we accidentally ignore -EINVAL returns. Signed-off-by: Dan Carpenter --- This patch is the right thing, but it's always a bit risky turning on new checks and I haven't tested this. diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 545358923271..2df218b010e1 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -448,7 +448,7 @@ static int __init obdclass_init(void) obd_zombie_impexp_init(); err = obd_init_checks(); - if (err == -EOVERFLOW) + if (err) return err; class_init_uuidlist(); From gregkh at linuxfoundation.org Mon Aug 28 08:24:26 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Mon, 28 Aug 2017 10:24:26 +0200 Subject: [lustre-devel] [PATCH] staging: lustre: constify cl_lock_operations In-Reply-To: References: Message-ID: <20170828082426.GA1401@kroah.com> On Sun, Aug 27, 2017 at 11:35:27AM +0530, Arvind Yadav wrote: > cl_lock_operations are not supposed to change at runtime. > cl_lock_slice_add is working with const cl_lock_operations. > So mark the non-const cl_lock_operations structs as const. > > Signed-off-by: Arvind Yadav > --- > drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Someone else already sent this same patch in, and it's already applied in my tree :( From bevans at cray.com Mon Aug 28 19:52:41 2017 From: bevans at cray.com (Ben Evans) Date: Mon, 28 Aug 2017 19:52:41 +0000 Subject: [lustre-devel] CONFIG_PROC_FS Message-ID: I see that this flag is set for all kernels, and from what I can tell, will always be on. Is there a reason that anyone knows of to keep it and the related #ifdef's? I'm guessing that this is a holdover from the days were non-linux builds were still being considered. -Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From paf at cray.com Mon Aug 28 20:02:56 2017 From: paf at cray.com (Patrick Farrell) Date: Mon, 28 Aug 2017 20:02:56 +0000 Subject: [lustre-devel] CONFIG_PROC_FS In-Reply-To: References: Message-ID: No, this is a kernel config thing (check a kernel source tree), not defined by Lustre - You can build Linux without /proc. I imagine that's for the tiny kernel people. - Patrick ________________________________ From: lustre-devel on behalf of Ben Evans Sent: Monday, August 28, 2017 2:52:41 PM To: lustre-devel at lists.lustre.org Subject: [lustre-devel] CONFIG_PROC_FS I see that this flag is set for all kernels, and from what I can tell, will always be on. Is there a reason that anyone knows of to keep it and the related #ifdef's? I'm guessing that this is a holdover from the days were non-linux builds were still being considered. -Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: