Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On 11/26/2013 11:34 AM, Greg Kroah-Hartman wrote: On Tue, Nov 26, 2013 at 11:25:24AM +0800, Peng Tao wrote: On Tue, Nov 26, 2013 at 11:14 AM, Greg Kroah-Hartman wrote: On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: From: Mikhail Pershin MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. It is not checkpatch clean :( Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time... Strange. I did run checkpatch before sending the patchset out. Just tried again. Still pass. [X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total: 0 errors, 0 warnings, 883 lines checked 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission. What message did you see? One about return(); OK. Looks like a latest checkpatch.pl change. After rebasing my working copy to latest staging-next, I can see the same error. I'll fix up. Sorry for the noise. Thanks, Tao >From 93455fbe9b61a66218225c2ec4c14fc2a86bcf67 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Thu, 31 Oct 2013 17:06:29 +0800 Subject: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2059 Lustre-change: http://review.whamcloud.com/5049 Signed-off-by: Mikhail Pershin Reviewed-by: Lai Siyao Reviewed-by: Alex Zhuravlev Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger --- drivers/staging/lustre/lustre/include/dt_object.h |2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 13 +- drivers/staging/lustre/lustre/include/obd.h|4 +- drivers/staging/lustre/lustre/mgc/libmgc.c |3 - drivers/staging/lustre/lustre/mgc/mgc_request.c| 401 drivers/staging/lustre/lustre/obdclass/llog.c | 212 +++ .../staging/lustre/lustre/obdclass/local_storage.c |9 +- .../staging/lustre/lustre/obdclass/local_storage.h |3 + drivers/staging/lustre/lustre/obdclass/lu_object.c |2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c |3 + 10 files changed, 408 insertions(+), 244 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/dt_object.h b/drivers/staging/lustre/lustre/include/dt_object.h index e116bb2..9304c26 100644 --- a/drivers/staging/lustre/lustre/include/dt_object.h +++ b/drivers/staging/lustre/lustre/include/dt_object.h @@ -692,7 +692,7 @@ struct local_oid_storage { struct dt_object *los_obj; /* data used to generate new fids */ - struct mutex los_id_lock; + struct mutex los_id_lock; __u64 los_seq; __u32 los_last_oid; }; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 721aa05..896c757 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -136,7 +136,11 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_handle **lgh, struct llog_logid *logid, char *name, enum llog_open_param open_param); int llog_close(const struct lu_env *env, struct llog_handle *cathandle); -int llog_get_size(struct llog_handle *loghandle); +int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt, + char *name); +int llog_backup(const struct lu_env *env, struct obd_device *obd, + struct llog_ctxt *ctxt, struct llog_ctxt *bak_ctxt, + char *name, char *backup); /* llog_process flags */ #define LLOG_FLAG_NODEAMON 0x0001 @@ -382,6 +386,13 @@ static inline int llog_data_len(int len) return cfs_size_round(len); } +static inline int llog_get_size(struct llog_handle *loghandle) +{ + if (loghandle && loghandle->lgh_hdr) + return loghandle->lgh_hdr->llh_count; + return 0; +} + static inline struct llog_ctxt *llog_ctxt_get(struct llog_ctxt *ctxt) { atomic_inc(>loc_refcount); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index d0aea15..f0c1773 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -399,8 +399,8 @@ struct
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On Tue, Nov 26, 2013 at 11:25:24AM +0800, Peng Tao wrote: > On Tue, Nov 26, 2013 at 11:14 AM, Greg Kroah-Hartman > wrote: > > On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: > >> From: Mikhail Pershin > >> > >> MGC uses lvfs API to access local llogs blocking removal of old code > >> > >> - MGS is converted to use OSD API for local llogs > >> - llog_is_empty() and llog_backup() are introduced > >> - initial OSD start initialize run ctxt so llog can use it too > >> - shrink dcache after initial scrub in osd-ldiskfs to avoid holding > >> data of unlinked objects until umount. > > > > It is not checkpatch clean :( > > > > Come on, it's not hard to do this yourself, why do you make me find > > these errors for you? It does nothing but make me not want to look at > > lustre patches for a long time... > > Strange. I did run checkpatch before sending the patchset out. > > Just tried again. Still pass. > > [X61@linux-lustre]$./scripts/checkpatch.pl > 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total: > 0 errors, 0 warnings, 883 lines checked > > 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no > obvious style problems and is ready for submission. > > What message did you see? One about return(); greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On Tue, Nov 26, 2013 at 11:14 AM, Greg Kroah-Hartman wrote: > On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: >> From: Mikhail Pershin >> >> MGC uses lvfs API to access local llogs blocking removal of old code >> >> - MGS is converted to use OSD API for local llogs >> - llog_is_empty() and llog_backup() are introduced >> - initial OSD start initialize run ctxt so llog can use it too >> - shrink dcache after initial scrub in osd-ldiskfs to avoid holding >> data of unlinked objects until umount. > > It is not checkpatch clean :( > > Come on, it's not hard to do this yourself, why do you make me find > these errors for you? It does nothing but make me not want to look at > lustre patches for a long time... Strange. I did run checkpatch before sending the patchset out. Just tried again. Still pass. [X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total: 0 errors, 0 warnings, 883 lines checked 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission. What message did you see? Thanks, Tao -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: > From: Mikhail Pershin > > MGC uses lvfs API to access local llogs blocking removal of old code > > - MGS is converted to use OSD API for local llogs > - llog_is_empty() and llog_backup() are introduced > - initial OSD start initialize run ctxt so llog can use it too > - shrink dcache after initial scrub in osd-ldiskfs to avoid holding > data of unlinked objects until umount. It is not checkpatch clean :( Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
From: Mikhail Pershin MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2059 Lustre-change: http://review.whamcloud.com/5049 Signed-off-by: Mikhail Pershin Reviewed-by: Lai Siyao Reviewed-by: Alex Zhuravlev Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger --- drivers/staging/lustre/lustre/include/dt_object.h |2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 13 +- drivers/staging/lustre/lustre/include/obd.h|4 +- drivers/staging/lustre/lustre/mgc/libmgc.c |3 - drivers/staging/lustre/lustre/mgc/mgc_request.c| 401 drivers/staging/lustre/lustre/obdclass/llog.c | 212 +++ .../staging/lustre/lustre/obdclass/local_storage.c |9 +- .../staging/lustre/lustre/obdclass/local_storage.h |3 + drivers/staging/lustre/lustre/obdclass/lu_object.c |2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c |3 + 10 files changed, 408 insertions(+), 244 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/dt_object.h b/drivers/staging/lustre/lustre/include/dt_object.h index e116bb2..9304c26 100644 --- a/drivers/staging/lustre/lustre/include/dt_object.h +++ b/drivers/staging/lustre/lustre/include/dt_object.h @@ -692,7 +692,7 @@ struct local_oid_storage { struct dt_object *los_obj; /* data used to generate new fids */ - struct mutex los_id_lock; + struct mutex los_id_lock; __u64 los_seq; __u32 los_last_oid; }; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 721aa05..896c757 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -136,7 +136,11 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_handle **lgh, struct llog_logid *logid, char *name, enum llog_open_param open_param); int llog_close(const struct lu_env *env, struct llog_handle *cathandle); -int llog_get_size(struct llog_handle *loghandle); +int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt, + char *name); +int llog_backup(const struct lu_env *env, struct obd_device *obd, + struct llog_ctxt *ctxt, struct llog_ctxt *bak_ctxt, + char *name, char *backup); /* llog_process flags */ #define LLOG_FLAG_NODEAMON 0x0001 @@ -382,6 +386,13 @@ static inline int llog_data_len(int len) return cfs_size_round(len); } +static inline int llog_get_size(struct llog_handle *loghandle) +{ + if (loghandle && loghandle->lgh_hdr) + return loghandle->lgh_hdr->llh_count; + return 0; +} + static inline struct llog_ctxt *llog_ctxt_get(struct llog_ctxt *ctxt) { atomic_inc(>loc_refcount); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index d0aea15..f0c1773 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -399,8 +399,8 @@ struct client_obd { /* mgc datastruct */ struct semaphore cl_mgc_sem; - struct vfsmount *cl_mgc_vfsmnt; - struct dentry *cl_mgc_configs_dir; + struct local_oid_storage *cl_mgc_los; + struct dt_object*cl_mgc_configs_dir; atomic_t cl_mgc_refcount; struct obd_export *cl_mgc_mgsexp; diff --git a/drivers/staging/lustre/lustre/mgc/libmgc.c b/drivers/staging/lustre/lustre/mgc/libmgc.c index 7b4947c..9b40c57 100644 --- a/drivers/staging/lustre/lustre/mgc/libmgc.c +++ b/drivers/staging/lustre/lustre/mgc/libmgc.c @@ -99,11 +99,8 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) static int mgc_cleanup(struct obd_device *obd) { - struct client_obd *cli = >u.cli; int rc; - LASSERT(cli->cl_mgc_vfsmnt == NULL); - ptlrpcd_decref(); rc = client_obd_cleanup(obd); diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 93b601d..bf4d8e9 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -41,17 +41,14 @@ #define DEBUG_SUBSYSTEM S_MGC #define D_MGC D_CONFIG /*|D_WARNING*/ -# include -# include -# include -# include - +#include #include #include #include #include -#include #include +#include + #include "mgc_internal.h" static int mgc_name2resid(char *name, int
[PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
From: Mikhail Pershin mike.pers...@intel.com MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2059 Lustre-change: http://review.whamcloud.com/5049 Signed-off-by: Mikhail Pershin mike.pers...@intel.com Reviewed-by: Lai Siyao lai.si...@intel.com Reviewed-by: Alex Zhuravlev alexey.zhurav...@intel.com Reviewed-by: James Simmons uja.o...@gmail.com Reviewed-by: Oleg Drokin oleg.dro...@intel.com Signed-off-by: Peng Tao bergw...@gmail.com Signed-off-by: Andreas Dilger andreas.dil...@intel.com --- drivers/staging/lustre/lustre/include/dt_object.h |2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 13 +- drivers/staging/lustre/lustre/include/obd.h|4 +- drivers/staging/lustre/lustre/mgc/libmgc.c |3 - drivers/staging/lustre/lustre/mgc/mgc_request.c| 401 drivers/staging/lustre/lustre/obdclass/llog.c | 212 +++ .../staging/lustre/lustre/obdclass/local_storage.c |9 +- .../staging/lustre/lustre/obdclass/local_storage.h |3 + drivers/staging/lustre/lustre/obdclass/lu_object.c |2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c |3 + 10 files changed, 408 insertions(+), 244 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/dt_object.h b/drivers/staging/lustre/lustre/include/dt_object.h index e116bb2..9304c26 100644 --- a/drivers/staging/lustre/lustre/include/dt_object.h +++ b/drivers/staging/lustre/lustre/include/dt_object.h @@ -692,7 +692,7 @@ struct local_oid_storage { struct dt_object *los_obj; /* data used to generate new fids */ - struct mutex los_id_lock; + struct mutex los_id_lock; __u64 los_seq; __u32 los_last_oid; }; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 721aa05..896c757 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -136,7 +136,11 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_handle **lgh, struct llog_logid *logid, char *name, enum llog_open_param open_param); int llog_close(const struct lu_env *env, struct llog_handle *cathandle); -int llog_get_size(struct llog_handle *loghandle); +int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt, + char *name); +int llog_backup(const struct lu_env *env, struct obd_device *obd, + struct llog_ctxt *ctxt, struct llog_ctxt *bak_ctxt, + char *name, char *backup); /* llog_process flags */ #define LLOG_FLAG_NODEAMON 0x0001 @@ -382,6 +386,13 @@ static inline int llog_data_len(int len) return cfs_size_round(len); } +static inline int llog_get_size(struct llog_handle *loghandle) +{ + if (loghandle loghandle-lgh_hdr) + return loghandle-lgh_hdr-llh_count; + return 0; +} + static inline struct llog_ctxt *llog_ctxt_get(struct llog_ctxt *ctxt) { atomic_inc(ctxt-loc_refcount); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index d0aea15..f0c1773 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -399,8 +399,8 @@ struct client_obd { /* mgc datastruct */ struct semaphore cl_mgc_sem; - struct vfsmount *cl_mgc_vfsmnt; - struct dentry *cl_mgc_configs_dir; + struct local_oid_storage *cl_mgc_los; + struct dt_object*cl_mgc_configs_dir; atomic_t cl_mgc_refcount; struct obd_export *cl_mgc_mgsexp; diff --git a/drivers/staging/lustre/lustre/mgc/libmgc.c b/drivers/staging/lustre/lustre/mgc/libmgc.c index 7b4947c..9b40c57 100644 --- a/drivers/staging/lustre/lustre/mgc/libmgc.c +++ b/drivers/staging/lustre/lustre/mgc/libmgc.c @@ -99,11 +99,8 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) static int mgc_cleanup(struct obd_device *obd) { - struct client_obd *cli = obd-u.cli; int rc; - LASSERT(cli-cl_mgc_vfsmnt == NULL); - ptlrpcd_decref(); rc = client_obd_cleanup(obd); diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 93b601d..bf4d8e9 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -41,17 +41,14 @@ #define DEBUG_SUBSYSTEM S_MGC #define D_MGC D_CONFIG /*|D_WARNING*/ -# include linux/module.h -# include
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: From: Mikhail Pershin mike.pers...@intel.com MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. It is not checkpatch clean :( Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time... -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On Tue, Nov 26, 2013 at 11:14 AM, Greg Kroah-Hartman gre...@linuxfoundation.org wrote: On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: From: Mikhail Pershin mike.pers...@intel.com MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. It is not checkpatch clean :( Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time... Strange. I did run checkpatch before sending the patchset out. Just tried again. Still pass. [X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total: 0 errors, 0 warnings, 883 lines checked 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission. What message did you see? Thanks, Tao -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On Tue, Nov 26, 2013 at 11:25:24AM +0800, Peng Tao wrote: On Tue, Nov 26, 2013 at 11:14 AM, Greg Kroah-Hartman gre...@linuxfoundation.org wrote: On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: From: Mikhail Pershin mike.pers...@intel.com MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. It is not checkpatch clean :( Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time... Strange. I did run checkpatch before sending the patchset out. Just tried again. Still pass. [X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total: 0 errors, 0 warnings, 883 lines checked 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission. What message did you see? One about return(); greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs
On 11/26/2013 11:34 AM, Greg Kroah-Hartman wrote: On Tue, Nov 26, 2013 at 11:25:24AM +0800, Peng Tao wrote: On Tue, Nov 26, 2013 at 11:14 AM, Greg Kroah-Hartman gre...@linuxfoundation.org wrote: On Tue, Nov 26, 2013 at 10:04:56AM +0800, Peng Tao wrote: From: Mikhail Pershin mike.pers...@intel.com MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. It is not checkpatch clean :( Come on, it's not hard to do this yourself, why do you make me find these errors for you? It does nothing but make me not want to look at lustre patches for a long time... Strange. I did run checkpatch before sending the patchset out. Just tried again. Still pass. [X61@linux-lustre]$./scripts/checkpatch.pl 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch total: 0 errors, 0 warnings, 883 lines checked 0002-staging-lustre-llog-MGC-to-use-OSD-API-for-backup-lo.patch has no obvious style problems and is ready for submission. What message did you see? One about return(); OK. Looks like a latest checkpatch.pl change. After rebasing my working copy to latest staging-next, I can see the same error. I'll fix up. Sorry for the noise. Thanks, Tao From 93455fbe9b61a66218225c2ec4c14fc2a86bcf67 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin mike.pers...@intel.com Date: Thu, 31 Oct 2013 17:06:29 +0800 Subject: [PATCH 02/16] staging/lustre/llog: MGC to use OSD API for backup logs MGC uses lvfs API to access local llogs blocking removal of old code - MGS is converted to use OSD API for local llogs - llog_is_empty() and llog_backup() are introduced - initial OSD start initialize run ctxt so llog can use it too - shrink dcache after initial scrub in osd-ldiskfs to avoid holding data of unlinked objects until umount. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2059 Lustre-change: http://review.whamcloud.com/5049 Signed-off-by: Mikhail Pershin mike.pers...@intel.com Reviewed-by: Lai Siyao lai.si...@intel.com Reviewed-by: Alex Zhuravlev alexey.zhurav...@intel.com Reviewed-by: James Simmons uja.o...@gmail.com Reviewed-by: Oleg Drokin oleg.dro...@intel.com Signed-off-by: Peng Tao bergw...@gmail.com Signed-off-by: Andreas Dilger andreas.dil...@intel.com --- drivers/staging/lustre/lustre/include/dt_object.h |2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 13 +- drivers/staging/lustre/lustre/include/obd.h|4 +- drivers/staging/lustre/lustre/mgc/libmgc.c |3 - drivers/staging/lustre/lustre/mgc/mgc_request.c| 401 drivers/staging/lustre/lustre/obdclass/llog.c | 212 +++ .../staging/lustre/lustre/obdclass/local_storage.c |9 +- .../staging/lustre/lustre/obdclass/local_storage.h |3 + drivers/staging/lustre/lustre/obdclass/lu_object.c |2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c |3 + 10 files changed, 408 insertions(+), 244 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/dt_object.h b/drivers/staging/lustre/lustre/include/dt_object.h index e116bb2..9304c26 100644 --- a/drivers/staging/lustre/lustre/include/dt_object.h +++ b/drivers/staging/lustre/lustre/include/dt_object.h @@ -692,7 +692,7 @@ struct local_oid_storage { struct dt_object *los_obj; /* data used to generate new fids */ - struct mutex los_id_lock; + struct mutex los_id_lock; __u64 los_seq; __u32 los_last_oid; }; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 721aa05..896c757 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -136,7 +136,11 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_handle **lgh, struct llog_logid *logid, char *name, enum llog_open_param open_param); int llog_close(const struct lu_env *env, struct llog_handle *cathandle); -int llog_get_size(struct llog_handle *loghandle); +int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt, + char *name); +int llog_backup(const struct lu_env *env, struct obd_device *obd, + struct llog_ctxt *ctxt, struct llog_ctxt *bak_ctxt, + char *name, char *backup); /* llog_process flags */ #define LLOG_FLAG_NODEAMON 0x0001 @@ -382,6 +386,13 @@ static inline int llog_data_len(int len) return cfs_size_round(len); } +static inline int llog_get_size(struct llog_handle *loghandle) +{ + if (loghandle loghandle-lgh_hdr) + return loghandle-lgh_hdr-llh_count; + return 0; +} + static inline struct llog_ctxt *llog_ctxt_get(struct llog_ctxt *ctxt) { atomic_inc(ctxt-loc_refcount); diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging