[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1502727664-29438-6-git-send-email-jsimmons@infradead.org>
Date: Mon, 14 Aug 2017 12:20:55 -0400
From: James Simmons <jsimmons@...radead.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org,
Andreas Dilger <andreas.dilger@...el.com>,
Oleg Drokin <oleg.drokin@...el.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lustre Development List <lustre-devel@...ts.lustre.org>,
Bobi Jam <bobijam.xu@...el.com>,
James Simmons <jsimmons@...radead.org>
Subject: [PATCH 05/14] staging: lustre: llite: return from ll_adjust_lum() if lump is NULL
From: Bobi Jam <bobijam.xu@...el.com>
No need to check several times if lump is NULL. Just test once and
return 0 if NULL.
Signed-off-by: Bobi Jam <bobijam.xu@...el.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9484
Reviewed-on: https://review.whamcloud.com/27126
Reviewed-by: Dmitry Eremin <dmitry.eremin@...el.com>
Reviewed-by: Niu Yawei <yawei.niu@...el.com>
Reviewed-by: James Simmons <uja.ornl@...oo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@...el.com>
Signed-off-by: James Simmons <jsimmons@...radead.org>
---
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
Powered by blists - more mailing lists