Re: [PATCH] [media] media: imx: use setup_timer
On Sun, 2017-08-13 at 21:39 +0300, Cihangir Akturk wrote: > Use setup_timer function instead of initializing timer with the > function and data fields. > > Generated by: scripts/coccinelle/api/setup_timer.cocci. > > Signed-off-by: Cihangir Akturk > --- > drivers/staging/media/imx/imx-ic-prpencvf.c | 5 ++--- > drivers/staging/media/imx/imx-media-csi.c | 5 ++--- > 2 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c > b/drivers/staging/media/imx/imx-ic-prpencvf.c > index ed363fe..65f5729 100644 > --- a/drivers/staging/media/imx/imx-ic-prpencvf.c > +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c > @@ -1278,9 +1278,8 @@ static int prp_init(struct imx_ic_priv > *ic_priv) > priv->ic_priv = ic_priv; > > spin_lock_init(&priv->irqlock); > - init_timer(&priv->eof_timeout_timer); > - priv->eof_timeout_timer.data = (unsigned long)priv; > - priv->eof_timeout_timer.function = prp_eof_timeout; > + setup_timer(&priv->eof_timeout_timer, prp_eof_timeout, > + (unsigned long)priv); > > priv->vdev = imx_media_capture_device_init(&ic_priv->sd, > PRPENCVF_SRC_PAD) > ; > diff --git a/drivers/staging/media/imx/imx-media-csi.c > b/drivers/staging/media/imx/imx-media-csi.c > index a2d2669..8fef5f1 100644 > --- a/drivers/staging/media/imx/imx-media-csi.c > +++ b/drivers/staging/media/imx/imx-media-csi.c > @@ -1731,9 +1731,8 @@ static int imx_csi_probe(struct platform_device > *pdev) > priv->csi_id = pdata->csi; > priv->smfc_id = (priv->csi_id == 0) ? 0 : 2; > > - init_timer(&priv->eof_timeout_timer); > - priv->eof_timeout_timer.data = (unsigned long)priv; > - priv->eof_timeout_timer.function = csi_idmac_eof_timeout; > + setup_timer(&priv->eof_timeout_timer, csi_idmac_eof_timeout, > + (unsigned long)priv); > spin_lock_init(&priv->irqlock); > > v4l2_subdev_init(&priv->sd, &csi_subdev_ops); Reviewed-by: Philipp Zabel regards Philipp ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging:rtl8188eu Fix coding style issues
This patch solves the following warnings thrown by checkpatch script WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Janani Sankara Babu --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index d8d88b5..767928a 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -56,7 +56,7 @@ u8 rtw_do_join(struct adapter *padapter) RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_do_join(): site survey if scanned_queue is empty\n.")); /* submit site_survey_cmd */ ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0); - if (_SUCCESS != ret) { + if (ret != _SUCCESS) { pmlmepriv->to_join = false; RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_do_join(): site survey return error\n.")); } @@ -110,7 +110,7 @@ u8 rtw_do_join(struct adapter *padapter) if (!pmlmepriv->LinkDetectInfo.bBusyTraffic || pmlmepriv->to_roaming > 0) { ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0); - if (_SUCCESS != ret) { + if (ret != _SUCCESS) { pmlmepriv->to_join = false; RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("do_join(): site survey return error\n.")); } @@ -621,7 +621,7 @@ int rtw_set_country(struct adapter *adapter, const char *country_code) DBG_88E("%s country_code:%s\n", __func__, country_code); for (i = 0; i < ARRAY_SIZE(channel_table); i++) { - if (0 == strcmp(channel_table[i].name, country_code)) { + if (strcmp(channel_table[i].name, country_code) == 0) { channel_plan = channel_table[i].channel_plan; break; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 28/28] drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers
On Fri, Aug 11, 2017 at 06:11:08PM +0200, Hans de Goede wrote: > Hi, > > On 11-08-17 18:04, Sean Paul wrote: > > On Fri, Aug 11, 2017 at 03:26:45PM +0200, Hans de Goede wrote: > > > Hi, > > > > > > On 11-08-17 14:33, Cihangir Akturk wrote: > > > > Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() > > > > and drm_*_unreference() helpers. > > > > > > > > drm_*_reference() and drm_*_unreference() functions are just > > > > compatibility alias for drm_*_get() and drm_*_put() and should not be > > > > used by new code. So convert all users of compatibility functions to > > > > use the new APIs. > > > > > > > > Generated by: scripts/coccinelle/api/drm-get-put.cocci > > > > > > > > Signed-off-by: Cihangir Akturk > > > > > > Thank you for doing this, looks good to me: > > > > > > Reviewed-by: Hans de Goede > > > > > > > Applied to drm-misc-next, thank you for the review! > > Erm vboxvideo is in staging, does this mean all patches for > it will now go through drm-misc-next despite it being in > staging (*) ? Because if some patches get merged through > drm-misc-next and some through Greg's staging repo that > is not going to end well. -staging doesn't work for drm. And yes this patch needs to go in through drm-misc I think (I don't want to be at Greg's mercy for merging cleanups, same way we don't wait for driver maintainers if they don't merge the patch in a timely fashion). I'd say if no one is actually working on vbox cleanup (i.e. porting to atomic) we'll throw it out next cycle again. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] [media] media: imx: depends on V4L2 sub-device userspace API
This driver uses various v4l2_subdev_get_try_*() functions provided by V4L2 sub-device userspace API. Current configuration of Kconfig file allows us to enable VIDEO_IMX_MEDIA without enabling this API. This breaks the build of driver. Depend on VIDEO_V4L2_SUBDEV_API to fix this issue. Signed-off-by: Cihangir Akturk --- drivers/staging/media/imx/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index 7eff50b..d8c3890 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -1,6 +1,7 @@ config VIDEO_IMX_MEDIA tristate "i.MX5/6 V4L2 media core driver" - depends on MEDIA_CONTROLLER && VIDEO_V4L2 && ARCH_MXC && IMX_IPUV3_CORE + depends on MEDIA_CONTROLLER && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && \ + ARCH_MXC && IMX_IPUV3_CORE select V4L2_FWNODE ---help--- Say yes here to enable support for video4linux media controller -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 28/28] drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers
Hi, On 14-08-17 10:58, Daniel Vetter wrote: On Fri, Aug 11, 2017 at 06:11:08PM +0200, Hans de Goede wrote: Hi, On 11-08-17 18:04, Sean Paul wrote: On Fri, Aug 11, 2017 at 03:26:45PM +0200, Hans de Goede wrote: Hi, On 11-08-17 14:33, Cihangir Akturk wrote: Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and drm_*_unreference() helpers. drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() and should not be used by new code. So convert all users of compatibility functions to use the new APIs. Generated by: scripts/coccinelle/api/drm-get-put.cocci Signed-off-by: Cihangir Akturk Thank you for doing this, looks good to me: Reviewed-by: Hans de Goede Applied to drm-misc-next, thank you for the review! Erm vboxvideo is in staging, does this mean all patches for it will now go through drm-misc-next despite it being in staging (*) ? Because if some patches get merged through drm-misc-next and some through Greg's staging repo that is not going to end well. -staging doesn't work for drm. And yes this patch needs to go in through drm-misc I think (I don't want to be at Greg's mercy for merging cleanups, same way we don't wait for driver maintainers if they don't merge the patch in a timely fashion). I'd say if no one is actually working on vbox cleanup (i.e. porting to atomic) we'll throw it out next cycle again. Michael Thayer from vbox upstream has said repeatedly that he is preparing a patch-set to move vboxvideo over to the atomic APIs). ATM I'm focusing on the other 2 vbox-guest drivers (but that is almost done) so if Michael does not follow through on this then I will take care of this. Either way please don't remove the driver, we do plan to clean it up and having it ping pong into, out of and back into the mainline kernel is really not helpful. Regards, Hans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: lnet: fix incorrect arguments order calling lstcon_session_new
> 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 > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: lustre: Off by two in lmv_fid2path()
> 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; > } > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [bug report] staging: lustre: lov: Ensure correct operation for large object sizes
> 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. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally
> 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: > > > > textdata bss dec hex filename > > > > 2618822564208 326527f8c > > > > drivers/staging/lustre/lustre/mgc/mgc_request.o > > > > > > > > after: > > > > textdata bss dec hex filename > > > > 2614022564208 326047f5c > > > > 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); > > > > charseclogname[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 > > > > de...@linuxdriverproject.org > > > > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > > > > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: mgc: fix potential use after free in error path
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: > textdata bss dec hex filename > 26188 22564208 326527f8c > drivers/staging/lustre/lustre/mgc/mgc_request.o > > after: > textdata bss dec hex filename > 26092 22564208 325567f2c > 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; > charseclogname[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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/64] staging: lustre: uapi: return error code for ostid_set_id
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/64] staging: lustre: uapi: remove unused function in lustre_disk.h
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) -#defineget_mount_flags(sb)(s2lsi(sb)->lsi_lmd->lmd_flags) -#defineget_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_headlmi_list_chain; -}; /** prototypes */ -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/64] staging: lustre: uapi: Move functions out of lustre_idl.h
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 & 0xUll); - 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 */ @@ -3
[PATCH 00/64] staging: lustre: uapi: normalize the lustre headers
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/{ => ua
[PATCH 02/64] staging: lustre: uapi: remove unused functions for lustre_fid.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/64] staging: lustre: uapi: remove userland version of obd_ioctl_*()
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/64] staging: lustre: uapi: update URL doc link in lustre_fid.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/64] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h
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 000..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 se
[PATCH 12/64] staging: lustre: uapi: move lustre_ioctl.h to uapi directory
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
[PATCH 10/64] staging: lustre: uapi: move obd_ioctl_getdata() declaration
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/64] staging: lustre: uapi: remove obd_ioctl_freedata() wrapper
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
[PATCH 16/64] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h
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@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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/64] staging: lustre: uapi: move lustre_param.h to uapi directory
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
[PATCH 13/64] staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/64] staging: lustre: uapi: label lustre_param.h as an uapi header
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/64] staging: lustre: uapi: cleanup headers for lustre_ioctl.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/64] staging: lustre: uapi: remove included headers out of lustre_param.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/64] staging: lustre: uapi: label lustre_ioctl.h as a UAPI header
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/64] staging: lustre: uapi: remove obd_ioctl_popdata() wrapper
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/64] staging: lustre: uapi: remove lustre_cfg_free wrapper
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/64] staging: lustre: uapi: don't memory allocate in UAPI header
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 =
[PATCH 20/64] staging: lustre: uapi: style cleanups for lustre_param.h
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@tcp0" /dev/sda - lctl conf_param testfs-OST failover.node=3@elan,192.168.0.3@tcp0 - ... testfs-MDT.lov.stripesize=4M - ... testfs-OST.ost.client_cache_seconds=15 - ... testfs.sys.timeout= - ... testfs.llite.max_read_ahead_mb=16 -*/ + * tunefs.lustre --param="failover.node=192.168.0.13@tcp0" /dev/sda + * lctl conf_param testfs-OST failover.node=3@elan,192.168.0.3@tcp0 + * ... testfs-MDT.lov.stripesize=4M + * ... testfs-OST.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.cli
[PATCH 11/64] staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c
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; + }
[PATCH 30/64] staging: lustre: uapi: label lustre_cfg.h as an uapi header
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/64] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/64] staging: lustre: obdclass: no need to check for kfree
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/64] staging: lustre: uapi: move lustre_cfg.h to uapi directory
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/64] staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/64] staging: lustre: socklnd: create socklnd.h UAPI header
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_NTYPES4 - -#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 000..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_NTYPES4 + +#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN + +#endif -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 36/64] staging: lustre: lnet: migrate headers to lnet uapi directory
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 #incl
[PATCH 38/64] staging: lustre: lnet: remove userland function prototype in lnetctl.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/64] staging: lustre: uapi: change variable type to match
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/64] staging: lustre: libcfs: remove LOGL and LOGU macros
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/64] staging: lustre: uapi: style cleanup of lustre_cfg.h
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 +
[PATCH 23/64] staging: lustre: uapi: move lustre_cfg_string() to obd_config.c
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 33/64] staging: lustre: libcfs: create libcfs_debug.h UAPI header
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_UNDEFINED0x0001 -#define S_MDC 0x0002 -#define S_MDS 0x0004 -#define S_OSC 0x0008 -#define S_OST 0x0010 -#define S_CLASS0x0020 -#define S_LOG 0x0040 -#define S_LLITE0x0080 -#define S_RPC 0x0100 -#define S_MGMT 0x0200 -#define S_LNET 0x0400 -#define S_LND 0x0800 /* ALL LNDs */ -#define S_PINGER 0x1000 -#define S_FILTER 0x2000 -/* unused */ -#define S_ECHO 0x8000 -#define S_LDLM 0x0001 -#define S_LOV 0x0002 -#define S_LQUOTA 0x0004 -#define S_OSD 0x0008 -#define S_LFSCK0x0010 -/* unused */ -/* unused */ -#define S_LMV 0x0080 /* b_new_cmd */ -/* unused */ -#define S_SEC 0x0200 /* upcall cache */ -#define S_GSS 0x0400 /* b_new_cmd */ -/* unused */ -#define S_MGC 0x1000 -#define S_MGS 0x2000 -#define S_FID 0x4000 /* b_new_cmd */ -#define S_FLD 0x8000 /* 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_TRACE0x0001 /* ENTRY/EXIT markers */ -#define D_INODE0x0002 -#define D_SUPER0x0004 -#define D_EXT2 0x0008 /* anything from ext2_debug */ -#define D_MALLOC 0x0010 /* print malloc, free information */ -#define D_CACHE0x0020 /* cache-related items */ -#define D_INFO 0x0040 /* general information */ -#define D_IOCTL0x0080 /* ioctl related information */ -#define D_NETERROR 0x0100 /* network errors */ -#define D_NET 0x0200 /* network communications */ -#define D_WARNING 0x0400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */ -#define D_BUFFS0x0800 -#define D_OTHER0x1000 -#define D_DENTRY 0x2000 -#define D_NETTRACE 0x4000 -#define D_PAGE 0x8000 /* bulk page handling */ -#define D_DLMTRACE 0x0001 -#define D_ERROR0x0002 /* CERROR(...) == CDEBUG (D_ERROR, ...) */ -#define D_EMERG0x0004 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */ -#define D_HA 0x0008 /* recovery and failover */ -#define D_RPCTRACE 0x0010 /* for distributed debugging */ -#define D_VFSTRACE 0x0020 -#define D_READA0x0040 /* read-ahead */ -#define D_MMAP 0x0080 -#define D_CONFIG 0x0100 -#define D_CONSOLE 0x0200 -#define D_QUOTA0x0400 -#define D_SEC 0x0800 -#define D_LFSCK0x1000 /* For both OI scrub and LFSCK */ -#define D_HSM 0x2000 - -#define LIBCFS_DEBUG_MASKS_NAMES { \ - "trace", "inode
[PATCH 31/64] staging: lustre: libcfs: remove htonl hack in libcfs.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 39/64] staging: lustre: lnet: remove BIT macro from lnetctl.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/64] staging: lustre: lnet: delete lnet.h
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..000 --- 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 "
[PATCH 37/64] staging: lustre: libcfs: sort headers in libcfs.h
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_PORT512 #define LNET_ACCEPTOR_MAX_RESERVED_PORT1023 @@ -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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/14] staging: lustre: llite: break up ll_setstripe_ea function
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 01/14] staging: lustre: llite: Remove filtering of seclabel xattr
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/14] staging: lustre: llite: xattr related handling fixes
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/14] staging: lustre: llite: add simple comment about lustre.lov xattrs
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/14] staging: lustre: llite: return from ll_adjust_lum() if lump is NULL
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/14] staging: lustre: llite: record in stats attempted removal of lma/link xattr
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/14] staging: lustre: llite: refactor lustre.lov xattr handling
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)) { - /
[PATCH 07/14] staging: lustre: llite: fix sparse variable length array warning
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/14] staging: lustre: llite: fix invalid size test in ll_setstripe_ea()
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/14] staging: lustre: llite: eat -EEXIST on setting trunsted.lov
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/14] staging: lustre: llite: style changes in xattr.c
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/14] staging: lustre: llite: use proper types in the xattr code
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/14] staging: lustre: llite: cleanup posix acl xattr code
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/14] staging: lustre: llite: cleanup xattr code comments
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/14] staging: lustre: llite: add support set_acl method in inode operations
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
[PATCH 40/64] staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 41/64] staging: lustre: uapi: migrate remaining uapi headers to uapi directory
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
[PATCH 42/64] staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL
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 0xd0de -#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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 45/64] staging: lustre: fid: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 43/64] staging: lustre: uapi: use proper byteorder functions in lustre_idl.h
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 44/64] staging: lustre: uapi: remove BIT macro from UAPI headers
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 = 0x0001, + IT_CREAT= 0x0002, + IT_OPEN_CREAT = 0x0003, + IT_READDIR = 0x0004, + IT_GETATTR = 0x0008, + IT_LOOKUP = 0x0010, + IT_UNLINK = 0x0020, + IT_TRUNC= 0x0040, + IT_GETXATTR = 0x0080, + IT_EXEC = 0x0100, + IT_PIN = 0x0200, + IT_LAYOUT = 0x0400, + IT_QUOTA_DQACQ = 0x0800, + IT_QUOTA_CONN = 0x1000, + IT_SETXATTR = 0x2000, }; 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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 46/64] staging: lustre: fld: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 47/64] staging: lustre: ptlrpc: add include path to Makefile
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_d
[PATCH 48/64] staging: lustre: llite: add include path to Makefile
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/stag
[PATCH 49/64] staging: lustre: lmv: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 54/64] staging: lustre: obdecho: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 50/64] staging: lustre: lov: add include path to Makefile
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
[PATCH 52/64] staging: lustre: mgc: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 51/64] staging: lustre: mdc: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listin
[PATCH 53/64] staging: lustre: obdclass: add include path to Makefile
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_c
[PATCH 56/64] staging: lustre: lustre: cleanup paths for lustre internal headers
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,
[PATCH 57/64] staging: lustre: lustre: cleanup paths for lustre UAPI headers
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 60/64] staging: lustre: ko2iblnd: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 59/64] staging: lustre: lnet: add include path to Makefile
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 ln
[PATCH 55/64] staging: lustre: osc: add include path to Makefile
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_statu
[PATCH 58/64] staging: lustre: lnet: selftest: add include path to Makefile
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 64/64] staging: lustre: lnet: cleanup paths for all LNet headers
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 62/64] staging: lustre: libcfs: add include path to Makefile
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 intva_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
[PATCH 61/64] staging: lustre: ksocklnd: add include path to Makefile
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_NSCHEDS3 -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 63/64] staging: lustre: libcfs: cleanup paths for libcfs headers
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 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] media: imx: depends on V4L2 sub-device userspace API
Hi Akturk, this has already been fixed, see 4560cb4a0c ("media: imx: add VIDEO_V4L2_SUBDEV_API dependency"). Steve On 08/14/2017 04:00 AM, Cihangir Akturk wrote: This driver uses various v4l2_subdev_get_try_*() functions provided by V4L2 sub-device userspace API. Current configuration of Kconfig file allows us to enable VIDEO_IMX_MEDIA without enabling this API. This breaks the build of driver. Depend on VIDEO_V4L2_SUBDEV_API to fix this issue. Signed-off-by: Cihangir Akturk --- drivers/staging/media/imx/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index 7eff50b..d8c3890 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -1,6 +1,7 @@ config VIDEO_IMX_MEDIA tristate "i.MX5/6 V4L2 media core driver" - depends on MEDIA_CONTROLLER && VIDEO_V4L2 && ARCH_MXC && IMX_IPUV3_CORE + depends on MEDIA_CONTROLLER && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && \ + ARCH_MXC && IMX_IPUV3_CORE select V4L2_FWNODE ---help--- Say yes here to enable support for video4linux media controller ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] media: imx: depends on V4L2 sub-device userspace API
On Mon, Aug 14, 2017 at 10:57:46AM -0700, Steve Longerbeam wrote: > Hi Akturk, this has already been fixed, see Sorry. Apparently, I missed to update my tree, somehow. > > 4560cb4a0c ("media: imx: add VIDEO_V4L2_SUBDEV_API dependency"). > > Steve > > On 08/14/2017 04:00 AM, Cihangir Akturk wrote: > > This driver uses various v4l2_subdev_get_try_*() functions provided by > > V4L2 sub-device userspace API. Current configuration of Kconfig file > > allows us to enable VIDEO_IMX_MEDIA without enabling this API. This > > breaks the build of driver. > > > > Depend on VIDEO_V4L2_SUBDEV_API to fix this issue. > > > > Signed-off-by: Cihangir Akturk > > --- > > drivers/staging/media/imx/Kconfig | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/staging/media/imx/Kconfig > > b/drivers/staging/media/imx/Kconfig > > index 7eff50b..d8c3890 100644 > > --- a/drivers/staging/media/imx/Kconfig > > +++ b/drivers/staging/media/imx/Kconfig > > @@ -1,6 +1,7 @@ > > config VIDEO_IMX_MEDIA > > tristate "i.MX5/6 V4L2 media core driver" > > - depends on MEDIA_CONTROLLER && VIDEO_V4L2 && ARCH_MXC && IMX_IPUV3_CORE > > + depends on MEDIA_CONTROLLER && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && \ > > + ARCH_MXC && IMX_IPUV3_CORE > > select V4L2_FWNODE > > ---help--- > > Say yes here to enable support for video4linux media controller > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] media: imx: use setup_timer
Thanks, Reviewed-by: Steve Longerbeam Tested-by: Steve Longerbeam Steve On 08/13/2017 11:39 AM, Cihangir Akturk wrote: Use setup_timer function instead of initializing timer with the function and data fields. Generated by: scripts/coccinelle/api/setup_timer.cocci. Signed-off-by: Cihangir Akturk --- drivers/staging/media/imx/imx-ic-prpencvf.c | 5 ++--- drivers/staging/media/imx/imx-media-csi.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index ed363fe..65f5729 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -1278,9 +1278,8 @@ static int prp_init(struct imx_ic_priv *ic_priv) priv->ic_priv = ic_priv; spin_lock_init(&priv->irqlock); - init_timer(&priv->eof_timeout_timer); - priv->eof_timeout_timer.data = (unsigned long)priv; - priv->eof_timeout_timer.function = prp_eof_timeout; + setup_timer(&priv->eof_timeout_timer, prp_eof_timeout, + (unsigned long)priv); priv->vdev = imx_media_capture_device_init(&ic_priv->sd, PRPENCVF_SRC_PAD); diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index a2d2669..8fef5f1 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1731,9 +1731,8 @@ static int imx_csi_probe(struct platform_device *pdev) priv->csi_id = pdata->csi; priv->smfc_id = (priv->csi_id == 0) ? 0 : 2; - init_timer(&priv->eof_timeout_timer); - priv->eof_timeout_timer.data = (unsigned long)priv; - priv->eof_timeout_timer.function = csi_idmac_eof_timeout; + setup_timer(&priv->eof_timeout_timer, csi_idmac_eof_timeout, + (unsigned long)priv); spin_lock_init(&priv->irqlock); v4l2_subdev_init(&priv->sd, &csi_subdev_ops); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 6/6] [media] media: imx: capture: constify vb2_ops structures
Thanks, Reviewed-by: Steve Longerbeam Steve On 08/05/2017 03:47 AM, Julia Lawall wrote: These vb2_ops structures are only stored in the ops field of a vb2_queue structure, which is declared as const. Thus the vb2_ops structures themselves can be const. Done with the help of Coccinelle. // @r disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p = { ... }; @ok@ identifier r.i; struct vb2_queue e; position p; @@ e.ops = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct vb2_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct vb2_ops i = { ... }; // Signed-off-by: Julia Lawall --- drivers/staging/media/imx/imx-media-capture.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index ddab4c2..ea145ba 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -62,7 +62,7 @@ struct capture_priv { /* In bytes, per queue */ #define VID_MEM_LIMIT SZ_64M -static struct vb2_ops capture_qops; +static const struct vb2_ops capture_qops; /* * Video ioctls follow @@ -503,7 +503,7 @@ static void capture_stop_streaming(struct vb2_queue *vq) spin_unlock_irqrestore(&priv->q_lock, flags); } -static struct vb2_ops capture_qops = { +static const struct vb2_ops capture_qops = { .queue_setup = capture_queue_setup, .buf_init= capture_buf_init, .buf_prepare = capture_buf_prepare, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] staging/imx: always select VIDEOBUF2_DMA_CONTIG
Thanks, Reviewed-by: Steve Longerbeam Steve On 08/07/2017 03:49 AM, Arnd Bergmann wrote: I ran into a rare build error during randconfig testing: drivers/staging/media/imx/imx-media-capture.o: In function `capture_stop_streaming': imx-media-capture.c:(.text+0x224): undefined reference to `vb2_buffer_done' drivers/staging/media/imx/imx-media-capture.o: In function `imx_media_capture_device_register': imx-media-capture.c:(.text+0xe60): undefined reference to `vb2_queue_init' imx-media-capture.c:(.text+0xfa0): undefined reference to `vb2_dma_contig_memops' While VIDEOBUF2_DMA_CONTIG was already selected by the camera driver, it wasn't necessarily there with just the base driver enabled. This moves the 'select' statement to the top-level option to make sure it's always available. Fixes: 64b5a49df486 ("[media] media: imx: Add Capture Device Interface") Signed-off-by: Arnd Bergmann --- drivers/staging/media/imx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index 719508fcb0e9..2be921cd0d55 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -2,6 +2,7 @@ config VIDEO_IMX_MEDIA tristate "i.MX5/6 V4L2 media core driver" depends on MEDIA_CONTROLLER && VIDEO_V4L2 && ARCH_MXC && IMX_IPUV3_CORE depends on VIDEO_V4L2_SUBDEV_API + select VIDEOBUF2_DMA_CONTIG select V4L2_FWNODE ---help--- Say yes here to enable support for video4linux media controller @@ -13,7 +14,6 @@ menu "i.MX5/6 Media Sub devices" config VIDEO_IMX_CSI tristate "i.MX5/6 Camera Sensor Interface driver" depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C - select VIDEOBUF2_DMA_CONTIG default y ---help--- A video4linux camera sensor interface driver for i.MX5/6. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/45] staging: unisys: more changes to the code.
On Thu, Aug 10, 2017 at 08:18:54PM +, Kershner, David A wrote: > > -Original Message- > > From: David Kershner [mailto:david.kersh...@unisys.com] > > Sent: Tuesday, August 1, 2017 10:40 AM > > To: gre...@linuxfoundation.org; driverdev-devel@linuxdriverproject.org; > > *S-Par-Maintainer ; jes.soren...@gmail.com > > Cc: Kershner, David A > > Subject: [PATCH 00/45] staging: unisys: more changes to the code. > > > > The following patch series addresses issues from internal code-review as > > well as checkpatch errors and suggestions from GregKH. > > > > We have updated our commenting style to be more readable (and adopted a > > kernel-doc like format). We have intentionally not made them kernel-doc by > > removing the extra asterisk from the first line. > > > > Greg, I just realized that although the patchset applies cleanly to > staging-next, it will conflict with the patch: > > Subject: [PATCH v2] staging: unisys: Switch to use new generic UUID > API > From: Andy Shevchenko [mailto:andriy.shevche...@linux.intel.com] > > So feel free to drop the series and accept his and I can fix the conflicts, > or > do you want to drop all the patches and I pick it up and resend the series > with the patch included? I'll drop all of the patches, and wait for you to resend them all with his patch as part of the series. That's the easiest for me :) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: pi433: style fixes for conditionals
On Mon, Aug 07, 2017 at 07:51:42PM -0400, Frank Jozsa wrote: > Cleans up some incongruous braces > > Signed-off-by: Frank Jozsa > --- > drivers/staging/pi433/pi433_if.c | 203 > +++ > 1 file changed, 78 insertions(+), 125 deletions(-) You sent two patches that seem to be different, yet have the same subject line :( Please fix up and resend them both correctly. Also correctly cc: the needed developers using scripts/get_maintainer.pl. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/4] staging: pi433: Style fix - Correct long lines
On Thu, Aug 03, 2017 at 05:20:43PM +0530, Rishabh Hardas wrote: > Signed-off-by: Rishabh Hardas > --- I can not take patches without any changelog text at all, sorry. Please fix up and resend this series. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/pi433: Solved some coding style issues in pi433_if.c
On Tue, Aug 01, 2017 at 10:39:06AM +0530, Rishabh Hardas wrote: > From: Rishabh Hardas > > Solved a few coding style issues, used BIT macro to set MINORBITS. > > Signed-off-by: Rishabh Hardas > Reviewed-by: Marcus Wolf > --- > drivers/staging/pi433/pi433_if.c | 24 ++-- > 1 file changed, 14 insertions(+), 10 deletions(-) Patch does not apply to my tree :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: pi433: Fix warnings from sparse
On Sat, Aug 12, 2017 at 10:39:41AM -0400, Quentin Swain wrote: > Running sparse produced warnings regarding use of conflicting > enum types and logical vs bitwise operator use. > > Signed-off-by: Quentin Swain > --- > drivers/staging/pi433/pi433_if.c | 4 ++-- > drivers/staging/pi433/rf69.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) Patch does not apply to my tree, and be sure to always properly cc: the correct developers for a patch by using scripts/get_maintainer.pl. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel