[PATCH 5/5] staging: lustre: Remove unnecessary braces {} for single statement blocks

2015-07-27 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Remove unnecessary braces {} for single line statement blocks.

Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 1f6ca7c..0f34171 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -376,9 +376,8 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx) == page));
}
 
-   if (page != NULL) {
+   if (page != NULL)
return page;
-   }
 
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] staging: lustre: Replace spaces at the start of a line.

2015-07-27 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Replace the spaces at the start of a line with tab for indent.

Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 282ae73..4def881 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -52,12 +52,12 @@ static void cl_page_delete0(const struct lu_env *env, 
struct cl_page *pg,
int radix);
 
 # define PASSERT(env, page, expr) \
-  do { \
+   do {\
  if (unlikely(!(expr))) {\
  CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
  LASSERT(0);  \
  }  \
-  } while (0)
+   } while (0)
 
 # define PINVRNT(env, page, exp) \
((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] staging: lustre: Adjust code indent for macro and tail blackslash

2015-07-27 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Adjust code indent for macro with tab, as well as tail blackslash.

Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 4def881..7c86437 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -51,12 +51,12 @@
 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
int radix);
 
-# define PASSERT(env, page, expr) \
-   do {\
- if (unlikely(!(expr))) {\
- CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
- LASSERT(0);  \
- }  \
+# define PASSERT(env, page, expr) \
+   do {   \
+   if (unlikely(!(expr))) {   \
+   CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n); \
+   LASSERT(0);\
+   }  \
} while (0)
 
 # define PINVRNT(env, page, exp) \
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] staging: lustre: Remove a trailing */ of a separate line.

2015-07-27 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Remove a trailing */ of a separate comments block line.

Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index ec21f2b..1f6ca7c 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -354,8 +354,10 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx, PFID(hdr-coh_lu.loh_fid), vmpage, vmpage-private, type);
/* fast path. */
if (type == CPT_CACHEABLE) {
-   /* vmpage lock is used to protect the child/parent
-* relationship */
+   /*
+* vmpage lock is used to protect the child/parent
+* relationship
+*/
KLASSERT(PageLocked(vmpage));
/*
 * cl_vmpage_page() can be called here without any locks as
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/5] Remove unnecessary braces {} for single statement blocks

2015-07-27 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Remove unnecessary braces {} for single line statement blocks.

Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 1f6ca7c..0f34171 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -376,9 +376,8 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx) == page));
}
 
-   if (page != NULL) {
+   if (page != NULL)
return page;
-   }
 
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] staging: lustre: Fix a file 8 warnings of coding sytle.

2015-07-27 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Fix file cl_page.c 8 coding style warning issues as follow:
  Replace spaces at the start of a line.
  Adjust code indent for macro and tail blackslash
  Add a blank line after declarations.
  Remove a trailing */ of a separate line.
  Remove unnecessary braces {} for single statement blocks

 drivers/staging/lustre/lustre/obdclass/cl_page.c | 25 +---
 1 file changed, 14 insertions(+), 11 deletions(-)

-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] staging: lustre: cl_page.c: Fix one file coding sytle issue.

2015-07-25 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Fix one file coding sytle issues.
  Include 3 warnings and 2 errors of coding sytle of cl_page.c.

 drivers/staging/lustre/lustre/obdclass/cl_page.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] staging: lustre: Add blank line after variable definition.

2015-07-25 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Add blank line after local variable definition to make it clear for reading.
Signed-off-by: Pan Li incarnation.p@outlook.com

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index a7f3032..8b2c1e7 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -169,6 +169,7 @@ int cl_page_gang_lookup(const struct lu_env *env, struct 
cl_object *obj,
while ((nr = radix_tree_gang_lookup(hdr-coh_tree, (void **)pvec,
idx, CLT_PVEC_SIZE))  0) {
int end_of_region = 0;
+
idx = pvec[nr - 1]-cp_index + 1;
for (i = 0, j = 0; i  nr; ++i) {
page = pvec[i];
@@ -286,6 +287,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env 
*env,
GFP_NOFS);
if (page != NULL) {
int result = 0;
+
atomic_set(page-cp_ref, 1);
if (type == CPT_CACHEABLE) /* for radix tree */
atomic_inc(page-cp_ref);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] staging: lustre: Add one space after ', ' in parameters list.

2015-07-25 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Add one space after ',' in function call parameters list.
Signed-off-by: Pan Li incarnation.p@outlook.com

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 8b2c1e7..739814e 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -1427,7 +1427,7 @@ void cl_page_clip(const struct lu_env *env, struct 
cl_page *pg,
CL_PAGE_HEADER(D_TRACE, env, pg, %d %d\n, from, to);
CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_clip),
   (const struct lu_env *,
-   const struct cl_page_slice *,int, int),
+   const struct cl_page_slice *, int, int),
   from, to);
 }
 EXPORT_SYMBOL(cl_page_clip);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/5] staging: lustre: Adjust code indent for macro.

2015-07-25 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Adjust code indent for macro, within tabs at the start and space in front of 
'\' for indent.
Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 4cc17d3..428c6b2 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -51,12 +51,12 @@
 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
int radix);
 
-# define PASSERT(env, page, expr) \
-   do {\
- if (unlikely(!(expr))) {\
- CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
- LASSERT(0);  \
- }  \
+# define PASSERT(env, page, expr) \
+   do {   \
+   if (unlikely(!(expr))) {   \
+   CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n); \
+   LASSERT(0);\
+   }  \
} while (0)
 
 # define PINVRNT(env, page, exp) \
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/5] staging: lustre: Remove unnecessary braces {}

2015-07-25 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Remove unnecessary braces {} in single line statement code block.
Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 739814e..c386c43 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -374,9 +374,8 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx) == page));
}
 
-   if (page != NULL) {
+   if (page != NULL)
return page;
-   }
 
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] staging: lustre: Replace spaces at the start of a line

2015-07-25 Thread Incarnation P. Lee
From: Pan Li incarnation.p@outlook.com

Replace the spaces at the start of a line within tab.
Signed-off-by: Pan Li incarnation.p@outlook.com
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index c386c43..4cc17d3 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -52,12 +52,12 @@ static void cl_page_delete0(const struct lu_env *env, 
struct cl_page *pg,
int radix);
 
 # define PASSERT(env, page, expr) \
-  do { \
+   do {\
  if (unlikely(!(expr))) {\
  CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
  LASSERT(0);  \
  }  \
-  } while (0)
+   } while (0)
 
 # define PINVRNT(env, page, exp) \
((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/5] Adjust code indent for conditional statements with tab.

2015-07-23 Thread Incarnation P. Lee
Signed-off-by: Incarnation P. Lee incarnation.p@outlook.com

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 4cc17d3..428c6b2 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -51,12 +51,12 @@
 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
int radix);
 
-# define PASSERT(env, page, expr) \
-   do {\
- if (unlikely(!(expr))) {\
- CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
- LASSERT(0);  \
- }  \
+# define PASSERT(env, page, expr) \
+   do {   \
+   if (unlikely(!(expr))) {   \
+   CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n); \
+   LASSERT(0);\
+   }  \
} while (0)
 
 # define PINVRNT(env, page, exp) \
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] Add blank line under variable declaration.

2015-07-23 Thread Incarnation P. Lee
Signed-off-by: Incarnation P. Lee incarnation.p@outlook.com

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index a7f3032..8b2c1e7 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -169,6 +169,7 @@ int cl_page_gang_lookup(const struct lu_env *env, struct 
cl_object *obj,
while ((nr = radix_tree_gang_lookup(hdr-coh_tree, (void **)pvec,
idx, CLT_PVEC_SIZE))  0) {
int end_of_region = 0;
+
idx = pvec[nr - 1]-cp_index + 1;
for (i = 0, j = 0; i  nr; ++i) {
page = pvec[i];
@@ -286,6 +287,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env 
*env,
GFP_NOFS);
if (page != NULL) {
int result = 0;
+
atomic_set(page-cp_ref, 1);
if (type == CPT_CACHEABLE) /* for radix tree */
atomic_inc(page-cp_ref);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Fix one source file coding sytle issue.

2015-07-23 Thread Incarnation P. Lee
drivers/staging/lustre/lustre/obdclass/cl_page.c

Signed-off-by: Incarnation P. Lee incarnation.p@outlook.com
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/5] Remove unnecessary braces {} are for single statement blocks

2015-07-23 Thread Incarnation P. Lee
Signed-off-by: Incarnation P. Lee incarnation.p@outlook.com

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 739814e..c386c43 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -374,9 +374,8 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx) == page));
}
 
-   if (page != NULL) {
+   if (page != NULL)
return page;
-   }
 
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] Replace spaces at the start of a line with tab.

2015-07-23 Thread Incarnation P. Lee
Signed-off-by: Incarnation P. Lee incarnation.p@outlook.com

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index c386c43..4cc17d3 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -52,12 +52,12 @@ static void cl_page_delete0(const struct lu_env *env, 
struct cl_page *pg,
int radix);
 
 # define PASSERT(env, page, expr) \
-  do { \
+   do {\
  if (unlikely(!(expr))) {\
  CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
  LASSERT(0);  \
  }  \
-  } while (0)
+   } while (0)
 
 # define PINVRNT(env, page, exp) \
((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] Add one space after that ',' in parameters list.

2015-07-23 Thread Incarnation P. Lee
Signed-off-by: Incarnation P. Lee incarnation.p@outlook.com

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 8b2c1e7..739814e 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -1427,7 +1427,7 @@ void cl_page_clip(const struct lu_env *env, struct 
cl_page *pg,
CL_PAGE_HEADER(D_TRACE, env, pg, %d %d\n, from, to);
CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_clip),
   (const struct lu_env *,
-   const struct cl_page_slice *,int, int),
+   const struct cl_page_slice *, int, int),
   from, to);
 }
 EXPORT_SYMBOL(cl_page_clip);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Fix one file coding style issus of linux-next-20150708

2015-07-16 Thread Incarnation P. Lee
Signed-off-by: Li Pan (Incarnation P. Lee) incarnation.p@outlook.com

Fix one file coding sytle issue on linux-next-20150708, including macro
aligned, missing blank lines after variable declarnation and brace missing
in one line if structure.
This patch can be one part of Eudyotula Task10.

---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index a7f3032..428c6b2 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -51,13 +51,13 @@
 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
int radix);
 
-# define PASSERT(env, page, expr) \
-  do { \
- if (unlikely(!(expr))) {\
- CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
- LASSERT(0);  \
- }  \
-  } while (0)
+# define PASSERT(env, page, expr) \
+   do {   \
+   if (unlikely(!(expr))) {   \
+   CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n); \
+   LASSERT(0);\
+   }  \
+   } while (0)
 
 # define PINVRNT(env, page, exp) \
((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
@@ -169,6 +169,7 @@ int cl_page_gang_lookup(const struct lu_env *env, struct 
cl_object *obj,
while ((nr = radix_tree_gang_lookup(hdr-coh_tree, (void **)pvec,
idx, CLT_PVEC_SIZE))  0) {
int end_of_region = 0;
+
idx = pvec[nr - 1]-cp_index + 1;
for (i = 0, j = 0; i  nr; ++i) {
page = pvec[i];
@@ -286,6 +287,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env 
*env,
GFP_NOFS);
if (page != NULL) {
int result = 0;
+
atomic_set(page-cp_ref, 1);
if (type == CPT_CACHEABLE) /* for radix tree */
atomic_inc(page-cp_ref);
@@ -372,9 +374,8 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx) == page));
}
 
-   if (page != NULL) {
+   if (page != NULL)
return page;
-   }
 
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
@@ -1425,7 +1426,7 @@ void cl_page_clip(const struct lu_env *env, struct 
cl_page *pg,
CL_PAGE_HEADER(D_TRACE, env, pg, %d %d\n, from, to);
CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_clip),
   (const struct lu_env *,
-   const struct cl_page_slice *,int, int),
+   const struct cl_page_slice *, int, int),
   from, to);
 }
 EXPORT_SYMBOL(cl_page_clip);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Fix script/checkpatch.pl coding style issus.

2015-07-09 Thread Incarnation P. Lee
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index a7f3032..428c6b2 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -51,13 +51,13 @@
 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
int radix);
 
-# define PASSERT(env, page, expr) \
-  do { \
- if (unlikely(!(expr))) {\
- CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
- LASSERT(0);  \
- }  \
-  } while (0)
+# define PASSERT(env, page, expr) \
+   do {   \
+   if (unlikely(!(expr))) {   \
+   CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n); \
+   LASSERT(0);\
+   }  \
+   } while (0)
 
 # define PINVRNT(env, page, exp) \
((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
@@ -169,6 +169,7 @@ int cl_page_gang_lookup(const struct lu_env *env, struct 
cl_object *obj,
while ((nr = radix_tree_gang_lookup(hdr-coh_tree, (void **)pvec,
idx, CLT_PVEC_SIZE))  0) {
int end_of_region = 0;
+
idx = pvec[nr - 1]-cp_index + 1;
for (i = 0, j = 0; i  nr; ++i) {
page = pvec[i];
@@ -286,6 +287,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env 
*env,
GFP_NOFS);
if (page != NULL) {
int result = 0;
+
atomic_set(page-cp_ref, 1);
if (type == CPT_CACHEABLE) /* for radix tree */
atomic_inc(page-cp_ref);
@@ -372,9 +374,8 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx) == page));
}
 
-   if (page != NULL) {
+   if (page != NULL)
return page;
-   }
 
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
@@ -1425,7 +1426,7 @@ void cl_page_clip(const struct lu_env *env, struct 
cl_page *pg,
CL_PAGE_HEADER(D_TRACE, env, pg, %d %d\n, from, to);
CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_clip),
   (const struct lu_env *,
-   const struct cl_page_slice *,int, int),
+   const struct cl_page_slice *, int, int),
   from, to);
 }
 EXPORT_SYMBOL(cl_page_clip);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Fix script/checkpatch.pl coding style issus.

2015-07-09 Thread Incarnation P. Lee
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index a7f3032..428c6b2 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -51,13 +51,13 @@
 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
int radix);
 
-# define PASSERT(env, page, expr) \
-  do { \
- if (unlikely(!(expr))) {\
- CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n);\
- LASSERT(0);  \
- }  \
-  } while (0)
+# define PASSERT(env, page, expr) \
+   do {   \
+   if (unlikely(!(expr))) {   \
+   CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr \n); \
+   LASSERT(0);\
+   }  \
+   } while (0)
 
 # define PINVRNT(env, page, exp) \
((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
@@ -169,6 +169,7 @@ int cl_page_gang_lookup(const struct lu_env *env, struct 
cl_object *obj,
while ((nr = radix_tree_gang_lookup(hdr-coh_tree, (void **)pvec,
idx, CLT_PVEC_SIZE))  0) {
int end_of_region = 0;
+
idx = pvec[nr - 1]-cp_index + 1;
for (i = 0, j = 0; i  nr; ++i) {
page = pvec[i];
@@ -286,6 +287,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env 
*env,
GFP_NOFS);
if (page != NULL) {
int result = 0;
+
atomic_set(page-cp_ref, 1);
if (type == CPT_CACHEABLE) /* for radix tree */
atomic_inc(page-cp_ref);
@@ -372,9 +374,8 @@ static struct cl_page *cl_page_find0(const struct lu_env 
*env,
   idx) == page));
}
 
-   if (page != NULL) {
+   if (page != NULL)
return page;
-   }
 
/* allocate and initialize cl_page */
page = cl_page_alloc(env, o, idx, vmpage, type);
@@ -1425,7 +1426,7 @@ void cl_page_clip(const struct lu_env *env, struct 
cl_page *pg,
CL_PAGE_HEADER(D_TRACE, env, pg, %d %d\n, from, to);
CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_clip),
   (const struct lu_env *,
-   const struct cl_page_slice *,int, int),
+   const struct cl_page_slice *, int, int),
   from, to);
 }
 EXPORT_SYMBOL(cl_page_clip);
-- 
1.9.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel