Re: [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-13 Thread Shivani Bhardwaj
On Fri, Nov 13, 2015 at 6:33 PM, Sudip Mukherjee
 wrote:
>
> On Wed, Nov 11, 2015 at 11:03:34PM +0530, Shivani Bhardwaj wrote:
> > On Wed, Nov 11, 2015 at 11:01 PM, Greg KH  
> > wrote:
> > > On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote:
> > >> On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot  
> > >> wrote:
> 
> > >>
> > >> I'm not getting any of these errors at compilation. I've checked
> > >> thrice. Could you please tell what am I doing wrong so that I can
> > >> avoid introducing errors in future patches?
> > >
> > > Use the .config provided, odds are you have lockdep enabled.
> >
> > Thanks Greg.
> > I tried that. Still no errors. Any other suggestion?
>
> while removing the wrapper you missed that cl_lock_lockdep_init() is:
>
> static void cl_lock_lockdep_init(struct cl_lock *lock)
> {
> lockdep_set_class_and_name(lock, _lock_key, "EXT");
> }
>
> if CONFIG_LOCKDEP is defined.
> and if CONFIG_LOCKDEP is not defined then:
>
> static void cl_lock_lockdep_init(struct cl_lock *lock)
> {}
>
> your patch is using lockdep_set_class_and_name() in both cases.
>

Yes! This is the problem.
Thank you Sudip.

> regards
> sudip
--
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] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-13 Thread Shivani Bhardwaj
On Fri, Nov 13, 2015 at 6:33 PM, Sudip Mukherjee
<sudipm.mukher...@gmail.com> wrote:
>
> On Wed, Nov 11, 2015 at 11:03:34PM +0530, Shivani Bhardwaj wrote:
> > On Wed, Nov 11, 2015 at 11:01 PM, Greg KH <gre...@linuxfoundation.org> 
> > wrote:
> > > On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote:
> > >> On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot <l...@intel.com> 
> > >> wrote:
> 
> > >>
> > >> I'm not getting any of these errors at compilation. I've checked
> > >> thrice. Could you please tell what am I doing wrong so that I can
> > >> avoid introducing errors in future patches?
> > >
> > > Use the .config provided, odds are you have lockdep enabled.
> >
> > Thanks Greg.
> > I tried that. Still no errors. Any other suggestion?
>
> while removing the wrapper you missed that cl_lock_lockdep_init() is:
>
> static void cl_lock_lockdep_init(struct cl_lock *lock)
> {
> lockdep_set_class_and_name(lock, _lock_key, "EXT");
> }
>
> if CONFIG_LOCKDEP is defined.
> and if CONFIG_LOCKDEP is not defined then:
>
> static void cl_lock_lockdep_init(struct cl_lock *lock)
> {}
>
> your patch is using lockdep_set_class_and_name() in both cases.
>

Yes! This is the problem.
Thank you Sudip.

> regards
> sudip
--
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] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-11 Thread Shivani Bhardwaj
On Wed, Nov 11, 2015 at 11:01 PM, Greg KH  wrote:
> On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote:
>> On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot  wrote:
>> > Hi Shivani,
>> >
>> > [auto build test ERROR on staging/staging-testing]
>> > [also build test ERROR on v4.3 next-2015]
>> >
>> > url:
>> > https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/2015-182452
>> > config: m68k-allyesconfig (attached as .config)
>> > reproduce:
>> > wget 
>> > https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>> >  -O ~/bin/make.cross
>> > chmod +x ~/bin/make.cross
>> > # save the attached .config to linux build tree
>> > make.cross ARCH=m68k
>> >
>> > All errors (new ones prefixed by >>):
>> >
>> >In file included from include/linux/spinlock_types.h:18:0,
>> > from include/linux/spinlock.h:81,
>> > from include/linux/mmzone.h:7,
>> > from include/linux/gfp.h:5,
>> > from include/linux/slab.h:14,
>> > from 
>> > drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40,
>> > from 
>> > drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39,
>> > from 
>> > drivers/staging/lustre/lustre/obdclass/cl_lock.c:43:
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 
>> > 'cl_lock_alloc':
>> >>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 
>> >>> 'cl_lock_key' undeclared (first use in this function)
>> >   lockdep_set_class_and_name(lock, _lock_key, "EXT");
>> > ^
>> >include/linux/lockdep.h:401:15: note: in definition of macro 
>> > 'lockdep_set_class_and_name'
>> >   do { (void)(key); (void)(name); } while (0)
>> >   ^
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each 
>> > undeclared identifier is reported only once for each function it appears in
>> >   lockdep_set_class_and_name(lock, _lock_key, "EXT");
>> > ^
>> >include/linux/lockdep.h:401:15: note: in definition of macro 
>> > 'lockdep_set_class_and_name'
>> >   do { (void)(key); (void)(name); } while (0)
>> >   ^
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level:
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 
>> > 'cl_lock_lockdep_init' defined but not used [-Wunused-function]
>> > static void cl_lock_lockdep_init(struct cl_lock *lock)
>> > ^
>> >
>> > vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c
>> >
>> >373  lockdep_set_class(>cll_guard, 
>> > _lock_guard_class);
>> >374  init_waitqueue_head(>cll_wq);
>> >375  head = obj->co_lu.lo_header;
>> >376  CS_LOCKSTATE_INC(obj, CLS_NEW);
>> >377  CS_LOCK_INC(obj, total);
>> >378  CS_LOCK_INC(obj, create);
>> >  > 379  lockdep_set_class_and_name(lock, _lock_key, 
>> > "EXT");
>> >380  list_for_each_entry(obj, >loh_layers,
>> >381  co_lu.lo_linkage) {
>> >382  int err;
>> >
>> > ---
>> > 0-DAY kernel test infrastructureOpen Source Technology 
>> > Center
>> > https://lists.01.org/pipermail/kbuild-all   Intel 
>> > Corporation
>>
>> Hi all,
>>
>> I'm not getting any of these errors at compilation. I've checked
>> thrice. Could you please tell what am I doing wrong so that I can
>> avoid introducing errors in future patches?
>
> Use the .config provided, odds are you have lockdep enabled.

Thanks Greg.
I tried that. Still no errors. Any other suggestion?
--
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] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-11 Thread Shivani Bhardwaj
On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot  wrote:
> Hi Shivani,
>
> [auto build test ERROR on staging/staging-testing]
> [also build test ERROR on v4.3 next-2015]
>
> url:
> https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/2015-182452
> config: m68k-allyesconfig (attached as .config)
> reproduce:
> wget 
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>  -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=m68k
>
> All errors (new ones prefixed by >>):
>
>In file included from include/linux/spinlock_types.h:18:0,
> from include/linux/spinlock.h:81,
> from include/linux/mmzone.h:7,
> from include/linux/gfp.h:5,
> from include/linux/slab.h:14,
> from 
> drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40,
> from 
> drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39,
> from drivers/staging/lustre/lustre/obdclass/cl_lock.c:43:
>drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 
> 'cl_lock_alloc':
>>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 
>>> 'cl_lock_key' undeclared (first use in this function)
>   lockdep_set_class_and_name(lock, _lock_key, "EXT");
> ^
>include/linux/lockdep.h:401:15: note: in definition of macro 
> 'lockdep_set_class_and_name'
>   do { (void)(key); (void)(name); } while (0)
>   ^
>drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each 
> undeclared identifier is reported only once for each function it appears in
>   lockdep_set_class_and_name(lock, _lock_key, "EXT");
> ^
>include/linux/lockdep.h:401:15: note: in definition of macro 
> 'lockdep_set_class_and_name'
>   do { (void)(key); (void)(name); } while (0)
>   ^
>drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level:
>drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 
> 'cl_lock_lockdep_init' defined but not used [-Wunused-function]
> static void cl_lock_lockdep_init(struct cl_lock *lock)
> ^
>
> vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c
>
>373  lockdep_set_class(>cll_guard, 
> _lock_guard_class);
>374  init_waitqueue_head(>cll_wq);
>375  head = obj->co_lu.lo_header;
>376  CS_LOCKSTATE_INC(obj, CLS_NEW);
>377  CS_LOCK_INC(obj, total);
>378  CS_LOCK_INC(obj, create);
>  > 379  lockdep_set_class_and_name(lock, _lock_key, "EXT");
>380  list_for_each_entry(obj, >loh_layers,
>381  co_lu.lo_linkage) {
>382  int err;
>
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation

Hi all,

I'm not getting any of these errors at compilation. I've checked
thrice. Could you please tell what am I doing wrong so that I can
avoid introducing errors in future patches?

Thank you
Shivani
--
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] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-11 Thread Shivani Bhardwaj
Remove the wrapper function cl_lock_lockdep_init() and replace its only
call with the function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/obdclass/cl_lock.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c 
b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
index 1836dc0..813d0ab 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
@@ -147,11 +147,6 @@ static void cl_lock_trace0(int level, const struct lu_env 
*env,
 #ifdef CONFIG_LOCKDEP
 static struct lock_class_key cl_lock_key;
 
-static void cl_lock_lockdep_init(struct cl_lock *lock)
-{
-   lockdep_set_class_and_name(lock, _lock_key, "EXT");
-}
-
 static void cl_lock_lockdep_acquire(const struct lu_env *env,
struct cl_lock *lock, __u32 enqflags)
 {
@@ -381,7 +376,7 @@ static struct cl_lock *cl_lock_alloc(const struct lu_env 
*env,
CS_LOCKSTATE_INC(obj, CLS_NEW);
CS_LOCK_INC(obj, total);
CS_LOCK_INC(obj, create);
-   cl_lock_lockdep_init(lock);
+   lockdep_set_class_and_name(lock, _lock_key, "EXT");
list_for_each_entry(obj, >loh_layers,
co_lu.lo_linkage) {
int err;
-- 
2.1.0

--
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] staging: lustre: Remove cl_2queue_add wrapper

2015-11-11 Thread Shivani Bhardwaj
Remove the wrapper function cl_2queue_add() and replace all its calls in
different files with the function it wrapped. Also, comments are added
wherever necessary to make the working of function clear. Prototype of
the function is also removed from the header file as it is no longer
needed.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/include/cl_object.h   |  1 -
 drivers/staging/lustre/lustre/llite/rw26.c  |  5 -
 drivers/staging/lustre/lustre/llite/vvp_io.c|  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_io.c  | 14 --
 drivers/staging/lustre/lustre/obdecho/echo_client.c |  6 --
 5 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 73564f8..e81c591 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -3127,7 +3127,6 @@ void cl_page_list_disown (const struct lu_env *env,
  struct cl_io *io, struct cl_page_list *plist);
 
 void cl_2queue_init (struct cl_2queue *queue);
-void cl_2queue_add  (struct cl_2queue *queue, struct cl_page *page);
 void cl_2queue_disown   (const struct lu_env *env,
 struct cl_io *io, struct cl_2queue *queue);
 void cl_2queue_discard  (const struct lu_env *env,
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 3da4c01..39fa13b 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -298,7 +298,10 @@ ssize_t ll_direct_rw_pages(const struct lu_env *env, 
struct cl_io *io,
}
 
if (likely(do_io)) {
-   cl_2queue_add(queue, clp);
+   /*
+* Add a page to the incoming page list of 2-queue.
+*/
+   cl_page_list_add(>c2_qin, clp);
 
/*
 * Set page clip to tell transfer formation engine
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c 
b/drivers/staging/lustre/lustre/llite/vvp_io.c
index 37773c1..b7bdc35 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -849,7 +849,7 @@ static int vvp_io_read_page(const struct lu_env *env,
 * Add page into the queue even when it is marked uptodate above.
 * this will unlock it automatically as part of cl_page_list_disown().
 */
-   cl_2queue_add(queue, page);
+   cl_page_list_add(>c2_qin, page);
if (sbi->ll_ra_info.ra_max_pages_per_file &&
sbi->ll_ra_info.ra_max_pages)
ll_readahead(env, io, ras,
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index 37c449b..e56dce5 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -1212,15 +1212,6 @@ void cl_2queue_init(struct cl_2queue *queue)
 EXPORT_SYMBOL(cl_2queue_init);
 
 /**
- * Add a page to the incoming page list of 2-queue.
- */
-void cl_2queue_add(struct cl_2queue *queue, struct cl_page *page)
-{
-   cl_page_list_add(>c2_qin, page);
-}
-EXPORT_SYMBOL(cl_2queue_add);
-
-/**
  * Disown pages in both lists of a 2-queue.
  */
 void cl_2queue_disown(const struct lu_env *env,
@@ -1258,7 +1249,10 @@ EXPORT_SYMBOL(cl_2queue_fini);
 void cl_2queue_init_page(struct cl_2queue *queue, struct cl_page *page)
 {
cl_2queue_init(queue);
-   cl_2queue_add(queue, page);
+   /*
+* Add a page to the incoming page list of 2-queue.
+*/
+   cl_page_list_add(>c2_qin, page);
 }
 EXPORT_SYMBOL(cl_2queue_init_page);
 
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 35a2f59..d82a087 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -1228,8 +1228,10 @@ static int cl_echo_object_brw(struct echo_object *eco, 
int rw, u64 offset,
cl_page_put(env, clp);
break;
}
-
-   cl_2queue_add(queue, clp);
+   /*
+* Add a page to the incoming page list of 2-queue.
+*/
+   cl_page_list_add(>c2_qin, clp);
 
/* drop the reference count for cl_page_find, so that the page
 * will be freed in cl_2queue_fini. */
-- 
2.1.0

--
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] staging: lustre: cl_io: Remove cl_lock_descr_fid wrapper

2015-11-11 Thread Shivani Bhardwaj
Remove unnecessary wrapper function cl_lock_descr_fid() and replace all
its calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index e67cea7..37c449b 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -236,16 +236,11 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io 
*io,
 }
 EXPORT_SYMBOL(cl_io_rw_init);
 
-static inline const struct lu_fid *
-cl_lock_descr_fid(const struct cl_lock_descr *descr)
-{
-   return lu_object_fid(>cld_obj->co_lu);
-}
-
 static int cl_lock_descr_sort(const struct cl_lock_descr *d0,
  const struct cl_lock_descr *d1)
 {
-   return lu_fid_cmp(cl_lock_descr_fid(d0), cl_lock_descr_fid(d1)) ?:
+   return lu_fid_cmp(lu_object_fid(>cld_obj->co_lu),
+ lu_object_fid(>cld_obj->co_lu)) ?:
__diff_normalize(d0->cld_start, d1->cld_start);
 }
 
@@ -254,7 +249,8 @@ static int cl_lock_descr_cmp(const struct cl_lock_descr *d0,
 {
int ret;
 
-   ret = lu_fid_cmp(cl_lock_descr_fid(d0), cl_lock_descr_fid(d1));
+   ret = lu_fid_cmp(lu_object_fid(>cld_obj->co_lu),
+lu_object_fid(>cld_obj->co_lu));
if (ret)
return ret;
if (d0->cld_end < d1->cld_start)
-- 
2.1.0

--
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] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-11 Thread Shivani Bhardwaj
Remove the wrapper function cl_lock_lockdep_init() and replace its only
call with the function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/obdclass/cl_lock.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c 
b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
index 1836dc0..813d0ab 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
@@ -147,11 +147,6 @@ static void cl_lock_trace0(int level, const struct lu_env 
*env,
 #ifdef CONFIG_LOCKDEP
 static struct lock_class_key cl_lock_key;
 
-static void cl_lock_lockdep_init(struct cl_lock *lock)
-{
-   lockdep_set_class_and_name(lock, _lock_key, "EXT");
-}
-
 static void cl_lock_lockdep_acquire(const struct lu_env *env,
struct cl_lock *lock, __u32 enqflags)
 {
@@ -381,7 +376,7 @@ static struct cl_lock *cl_lock_alloc(const struct lu_env 
*env,
CS_LOCKSTATE_INC(obj, CLS_NEW);
CS_LOCK_INC(obj, total);
CS_LOCK_INC(obj, create);
-   cl_lock_lockdep_init(lock);
+   lockdep_set_class_and_name(lock, _lock_key, "EXT");
list_for_each_entry(obj, >loh_layers,
co_lu.lo_linkage) {
int err;
-- 
2.1.0

--
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] staging: lustre: cl_io: Remove cl_lock_descr_fid wrapper

2015-11-11 Thread Shivani Bhardwaj
Remove unnecessary wrapper function cl_lock_descr_fid() and replace all
its calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index e67cea7..37c449b 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -236,16 +236,11 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io 
*io,
 }
 EXPORT_SYMBOL(cl_io_rw_init);
 
-static inline const struct lu_fid *
-cl_lock_descr_fid(const struct cl_lock_descr *descr)
-{
-   return lu_object_fid(>cld_obj->co_lu);
-}
-
 static int cl_lock_descr_sort(const struct cl_lock_descr *d0,
  const struct cl_lock_descr *d1)
 {
-   return lu_fid_cmp(cl_lock_descr_fid(d0), cl_lock_descr_fid(d1)) ?:
+   return lu_fid_cmp(lu_object_fid(>cld_obj->co_lu),
+ lu_object_fid(>cld_obj->co_lu)) ?:
__diff_normalize(d0->cld_start, d1->cld_start);
 }
 
@@ -254,7 +249,8 @@ static int cl_lock_descr_cmp(const struct cl_lock_descr *d0,
 {
int ret;
 
-   ret = lu_fid_cmp(cl_lock_descr_fid(d0), cl_lock_descr_fid(d1));
+   ret = lu_fid_cmp(lu_object_fid(>cld_obj->co_lu),
+lu_object_fid(>cld_obj->co_lu));
if (ret)
return ret;
if (d0->cld_end < d1->cld_start)
-- 
2.1.0

--
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] staging: lustre: Remove cl_2queue_add wrapper

2015-11-11 Thread Shivani Bhardwaj
Remove the wrapper function cl_2queue_add() and replace all its calls in
different files with the function it wrapped. Also, comments are added
wherever necessary to make the working of function clear. Prototype of
the function is also removed from the header file as it is no longer
needed.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/include/cl_object.h   |  1 -
 drivers/staging/lustre/lustre/llite/rw26.c  |  5 -
 drivers/staging/lustre/lustre/llite/vvp_io.c|  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_io.c  | 14 --
 drivers/staging/lustre/lustre/obdecho/echo_client.c |  6 --
 5 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 73564f8..e81c591 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -3127,7 +3127,6 @@ void cl_page_list_disown (const struct lu_env *env,
  struct cl_io *io, struct cl_page_list *plist);
 
 void cl_2queue_init (struct cl_2queue *queue);
-void cl_2queue_add  (struct cl_2queue *queue, struct cl_page *page);
 void cl_2queue_disown   (const struct lu_env *env,
 struct cl_io *io, struct cl_2queue *queue);
 void cl_2queue_discard  (const struct lu_env *env,
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 3da4c01..39fa13b 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -298,7 +298,10 @@ ssize_t ll_direct_rw_pages(const struct lu_env *env, 
struct cl_io *io,
}
 
if (likely(do_io)) {
-   cl_2queue_add(queue, clp);
+   /*
+* Add a page to the incoming page list of 2-queue.
+*/
+   cl_page_list_add(>c2_qin, clp);
 
/*
 * Set page clip to tell transfer formation engine
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c 
b/drivers/staging/lustre/lustre/llite/vvp_io.c
index 37773c1..b7bdc35 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -849,7 +849,7 @@ static int vvp_io_read_page(const struct lu_env *env,
 * Add page into the queue even when it is marked uptodate above.
 * this will unlock it automatically as part of cl_page_list_disown().
 */
-   cl_2queue_add(queue, page);
+   cl_page_list_add(>c2_qin, page);
if (sbi->ll_ra_info.ra_max_pages_per_file &&
sbi->ll_ra_info.ra_max_pages)
ll_readahead(env, io, ras,
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index 37c449b..e56dce5 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -1212,15 +1212,6 @@ void cl_2queue_init(struct cl_2queue *queue)
 EXPORT_SYMBOL(cl_2queue_init);
 
 /**
- * Add a page to the incoming page list of 2-queue.
- */
-void cl_2queue_add(struct cl_2queue *queue, struct cl_page *page)
-{
-   cl_page_list_add(>c2_qin, page);
-}
-EXPORT_SYMBOL(cl_2queue_add);
-
-/**
  * Disown pages in both lists of a 2-queue.
  */
 void cl_2queue_disown(const struct lu_env *env,
@@ -1258,7 +1249,10 @@ EXPORT_SYMBOL(cl_2queue_fini);
 void cl_2queue_init_page(struct cl_2queue *queue, struct cl_page *page)
 {
cl_2queue_init(queue);
-   cl_2queue_add(queue, page);
+   /*
+* Add a page to the incoming page list of 2-queue.
+*/
+   cl_page_list_add(>c2_qin, page);
 }
 EXPORT_SYMBOL(cl_2queue_init_page);
 
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 35a2f59..d82a087 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -1228,8 +1228,10 @@ static int cl_echo_object_brw(struct echo_object *eco, 
int rw, u64 offset,
cl_page_put(env, clp);
break;
}
-
-   cl_2queue_add(queue, clp);
+   /*
+* Add a page to the incoming page list of 2-queue.
+*/
+   cl_page_list_add(>c2_qin, clp);
 
/* drop the reference count for cl_page_find, so that the page
 * will be freed in cl_2queue_fini. */
-- 
2.1.0

--
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] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-11 Thread Shivani Bhardwaj
On Wed, Nov 11, 2015 at 11:01 PM, Greg KH <gre...@linuxfoundation.org> wrote:
> On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote:
>> On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot <l...@intel.com> wrote:
>> > Hi Shivani,
>> >
>> > [auto build test ERROR on staging/staging-testing]
>> > [also build test ERROR on v4.3 next-2015]
>> >
>> > url:
>> > https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/2015-182452
>> > config: m68k-allyesconfig (attached as .config)
>> > reproduce:
>> > wget 
>> > https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>> >  -O ~/bin/make.cross
>> > chmod +x ~/bin/make.cross
>> > # save the attached .config to linux build tree
>> > make.cross ARCH=m68k
>> >
>> > All errors (new ones prefixed by >>):
>> >
>> >In file included from include/linux/spinlock_types.h:18:0,
>> > from include/linux/spinlock.h:81,
>> > from include/linux/mmzone.h:7,
>> > from include/linux/gfp.h:5,
>> > from include/linux/slab.h:14,
>> > from 
>> > drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40,
>> > from 
>> > drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39,
>> > from 
>> > drivers/staging/lustre/lustre/obdclass/cl_lock.c:43:
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 
>> > 'cl_lock_alloc':
>> >>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 
>> >>> 'cl_lock_key' undeclared (first use in this function)
>> >   lockdep_set_class_and_name(lock, _lock_key, "EXT");
>> > ^
>> >include/linux/lockdep.h:401:15: note: in definition of macro 
>> > 'lockdep_set_class_and_name'
>> >   do { (void)(key); (void)(name); } while (0)
>> >   ^
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each 
>> > undeclared identifier is reported only once for each function it appears in
>> >   lockdep_set_class_and_name(lock, _lock_key, "EXT");
>> > ^
>> >include/linux/lockdep.h:401:15: note: in definition of macro 
>> > 'lockdep_set_class_and_name'
>> >   do { (void)(key); (void)(name); } while (0)
>> >   ^
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level:
>> >drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 
>> > 'cl_lock_lockdep_init' defined but not used [-Wunused-function]
>> > static void cl_lock_lockdep_init(struct cl_lock *lock)
>> > ^
>> >
>> > vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c
>> >
>> >373  lockdep_set_class(>cll_guard, 
>> > _lock_guard_class);
>> >374  init_waitqueue_head(>cll_wq);
>> >375  head = obj->co_lu.lo_header;
>> >376  CS_LOCKSTATE_INC(obj, CLS_NEW);
>> >377  CS_LOCK_INC(obj, total);
>> >378  CS_LOCK_INC(obj, create);
>> >  > 379  lockdep_set_class_and_name(lock, _lock_key, 
>> > "EXT");
>> >380  list_for_each_entry(obj, >loh_layers,
>> >381  co_lu.lo_linkage) {
>> >382  int err;
>> >
>> > ---
>> > 0-DAY kernel test infrastructureOpen Source Technology 
>> > Center
>> > https://lists.01.org/pipermail/kbuild-all   Intel 
>> > Corporation
>>
>> Hi all,
>>
>> I'm not getting any of these errors at compilation. I've checked
>> thrice. Could you please tell what am I doing wrong so that I can
>> avoid introducing errors in future patches?
>
> Use the .config provided, odds are you have lockdep enabled.

Thanks Greg.
I tried that. Still no errors. Any other suggestion?
--
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] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper

2015-11-11 Thread Shivani Bhardwaj
On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot <l...@intel.com> wrote:
> Hi Shivani,
>
> [auto build test ERROR on staging/staging-testing]
> [also build test ERROR on v4.3 next-2015]
>
> url:
> https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/2015-182452
> config: m68k-allyesconfig (attached as .config)
> reproduce:
> wget 
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>  -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=m68k
>
> All errors (new ones prefixed by >>):
>
>In file included from include/linux/spinlock_types.h:18:0,
> from include/linux/spinlock.h:81,
> from include/linux/mmzone.h:7,
> from include/linux/gfp.h:5,
> from include/linux/slab.h:14,
> from 
> drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40,
> from 
> drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39,
> from drivers/staging/lustre/lustre/obdclass/cl_lock.c:43:
>drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 
> 'cl_lock_alloc':
>>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 
>>> 'cl_lock_key' undeclared (first use in this function)
>   lockdep_set_class_and_name(lock, _lock_key, "EXT");
> ^
>include/linux/lockdep.h:401:15: note: in definition of macro 
> 'lockdep_set_class_and_name'
>   do { (void)(key); (void)(name); } while (0)
>   ^
>drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each 
> undeclared identifier is reported only once for each function it appears in
>   lockdep_set_class_and_name(lock, _lock_key, "EXT");
> ^
>include/linux/lockdep.h:401:15: note: in definition of macro 
> 'lockdep_set_class_and_name'
>   do { (void)(key); (void)(name); } while (0)
>   ^
>drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level:
>drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 
> 'cl_lock_lockdep_init' defined but not used [-Wunused-function]
> static void cl_lock_lockdep_init(struct cl_lock *lock)
> ^
>
> vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c
>
>373  lockdep_set_class(>cll_guard, 
> _lock_guard_class);
>374  init_waitqueue_head(>cll_wq);
>375  head = obj->co_lu.lo_header;
>376  CS_LOCKSTATE_INC(obj, CLS_NEW);
>377  CS_LOCK_INC(obj, total);
>378  CS_LOCK_INC(obj, create);
>  > 379  lockdep_set_class_and_name(lock, _lock_key, "EXT");
>380  list_for_each_entry(obj, >loh_layers,
>381  co_lu.lo_linkage) {
>382  int err;
>
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation

Hi all,

I'm not getting any of these errors at compilation. I've checked
thrice. Could you please tell what am I doing wrong so that I can
avoid introducing errors in future patches?

Thank you
Shivani
--
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 v2 8/8] Staging: lustre: llite: Remove ll_finish_md_op_data wrapper

2015-11-09 Thread Shivani Bhardwaj
Remove the wrapper function ll_finish_md_op_data() and replace all
its calls with the standard function kfree() that it wraps. Also,
prototype of the function is removed as it is no longer of any use.

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

 drivers/staging/lustre/lustre/llite/llite_internal.h |  1 -
 drivers/staging/lustre/lustre/llite/llite_lib.c  | 13 -
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 157c3284..d12d483 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -792,7 +792,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
  struct inode *i1, struct inode *i2,
  const char *name, int namelen,
  int mode, __u32 opc, void *data);
-void ll_finish_md_op_data(struct md_op_data *op_data);
 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
 void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req);
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4a8c759..143be87 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1355,7 +1355,7 @@ out:
if (!rc)
rc = rc1;
}
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (!S_ISDIR(inode->i_mode)) {
mutex_lock(>i_mutex);
@@ -1732,7 +1732,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 
op_data->op_valid = OBD_MD_FLFLAGS;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu\n", rc, inode->i_ino);
return -abs(rc);
@@ -1763,7 +1763,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
rc = md_setattr(sbi->ll_md_exp, op_data,
NULL, 0, NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc)
return rc;
@@ -1934,7 +1934,7 @@ void ll_open_cleanup(struct super_block *sb, struct 
ptlrpc_request *open_req)
op_data->op_mod_time = get_seconds();
md_close(exp, op_data, NULL, _req);
ptlrpc_req_finished(close_req);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 }
 
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
@@ -2170,11 +2170,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
return op_data;
 }
 
-void ll_finish_md_op_data(struct md_op_data *op_data)
-{
-   kfree(op_data);
-}
-
 int ll_show_options(struct seq_file *seq, struct dentry *dentry)
 {
struct ll_sb_info *sbi;
-- 
2.1.0

--
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 v2 7/8] Staging: lustre: llite_close: Substitute function calls

2015-11-09 Thread Shivani Bhardwaj
Substitute standard function kfree() in place of the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/llite_close.c 
b/drivers/staging/lustre/lustre/llite/llite_close.c
index 3f348a3..c4f22ec 100644
--- a/drivers/staging/lustre/lustre/llite/llite_close.c
+++ b/drivers/staging/lustre/lustre/llite/llite_close.c
@@ -301,7 +301,7 @@ static void ll_done_writing(struct inode *inode)
CERROR("inode %lu mdc done_writing failed: rc = %d\n",
   inode->i_ino, rc);
 out:
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (och) {
md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och);
kfree(och);
-- 
2.1.0

--
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 v2 6/8] Staging: lustre: llite_nfs: Replace function calls with kfree

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index e578a11..a3a89a7 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -306,7 +306,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
return (void *)op_data;
 
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino);
return ERR_PTR(rc);
-- 
2.1.0

--
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 v2 5/8] Staging: lustre: symlink: Substitute standard function

2015-11-09 Thread Shivani Bhardwaj
Substitute the standard function kfree() for the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/symlink.c 
b/drivers/staging/lustre/lustre/llite/symlink.c
index 69b2036..6b0d1cc 100644
--- a/drivers/staging/lustre/lustre/llite/symlink.c
+++ b/drivers/staging/lustre/lustre/llite/symlink.c
@@ -73,7 +73,7 @@ static int ll_readlink_internal(struct inode *inode,
 
op_data->op_valid = OBD_MD_LINKNAME;
rc = md_getattr(sbi->ll_md_exp, op_data, request);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
if (rc != -ENOENT)
CERROR("inode %lu: rc = %d\n", inode->i_ino, rc);
-- 
2.1.0

--
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 v2 4/8] Staging: lustre: xattr_cache: Change function calls to kfree

2015-11-09 Thread Shivani Bhardwaj
Change the calls of the function ll_finish_md_op_data() to the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c 
b/drivers/staging/lustre/lustre/llite/xattr_cache.c
index e1e599c..b7f3efc 100644
--- a/drivers/staging/lustre/lustre/llite/xattr_cache.c
+++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c
@@ -306,7 +306,7 @@ static int ll_xattr_find_get_lock(struct inode *inode,
op_data->op_valid = OBD_MD_FLXATTR | OBD_MD_FLXATTRLS;
 
rc = md_enqueue(exp, , oit, op_data, , NULL, 0, NULL, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (rc < 0) {
CDEBUG(D_CACHE,
-- 
2.1.0

--
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 v2 3/8] Staging: lustre: namei: Replace calls with kfree

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 2ca2200..f058ebe2 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -531,7 +531,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, 
struct dentry *dentry,
 
rc = md_intent_lock(ll_i2mdexp(parent), op_data, NULL, 0, it,
lookup_flags, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
retval = ERR_PTR(rc);
goto out;
@@ -786,7 +786,7 @@ static int ll_new_node(struct inode *dir, struct dentry 
*dentry,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), rdev, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 
@@ -961,7 +961,7 @@ static int ll_unlink(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc)
goto out;
 
@@ -1011,7 +1011,7 @@ static int ll_rmdir(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == 0) {
ll_update_times(request, dir);
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1);
@@ -1060,7 +1060,7 @@ static int ll_link(struct dentry *old_dentry, struct 
inode *dir,
return PTR_ERR(op_data);
 
err = md_link(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto out;
 
@@ -1096,7 +1096,7 @@ static int ll_rename(struct inode *old_dir, struct dentry 
*old_dentry,
old_dentry->d_name.len,
new_dentry->d_name.name,
new_dentry->d_name.len, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (!err) {
ll_update_times(request, old_dir);
ll_update_times(request, new_dir);
-- 
2.1.0

--
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 v2 2/8] Staging: lustre: file: Replace function calls with standard function

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

 drivers/staging/lustre/lustre/llite/file.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 02f2759..186b5af 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -202,7 +202,7 @@ static int ll_close_inode_openhandle(struct obd_export 
*md_exp,
rc = -EBUSY;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 out:
if (exp_connect_som(exp) && !epoch_close &&
@@ -420,7 +420,7 @@ static int ll_intent_file_open(struct dentry *dentry, void 
*lmm,
itp->it_flags |= MDS_OPEN_BY_FID;
rc = md_intent_lock(sbi->ll_md_exp, op_data, lmm, lmmsize, itp,
0 /*unused */, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == -ESTALE) {
/* reason for keep own exit path - don`t flood log
* with messages with -ESTALE errors.
@@ -819,7 +819,7 @@ ll_lease_open(struct inode *inode, struct file *file, 
fmode_t fmode,
 * open in ll_md_blocking_ast(). Otherwise as ll_md_blocking_lease_ast
 * doesn't deal with openhandle, so normal openhandle will be leaked. */
LDLM_FL_NO_LRU | LDLM_FL_EXCL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc < 0)
goto out_release_it;
@@ -1393,7 +1393,7 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const 
char *filename,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name failed on %s: rc %d\n",
   filename, rc);
@@ -2056,7 +2056,7 @@ static int ll_swap_layouts(struct file *file1, struct 
file *file2,
 
rc = obd_iocontrol(LL_IOC_LOV_SWAP_LAYOUTS, ll_i2mdexp(llss->inode1),
   sizeof(*op_data), op_data, NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 putgl:
if (gid != 0) {
@@ -2131,7 +2131,7 @@ static int ll_hsm_state_set(struct inode *inode, struct 
hsm_state_set *hss)
rc = obd_iocontrol(LL_IOC_HSM_STATE_SET, ll_i2mdexp(inode),
   sizeof(*op_data), op_data, NULL);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((void *)arg, hus, sizeof(*hus)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hus);
return rc;
}
@@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((char *)arg, hca, sizeof(*hca)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hca);
return rc;
}
@@ -2761,7 +2761,7 @@ ll_file_flock(struct file *file, int cmd, struct 
file_lock *file_lock)
rc = rc2;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2896,7 +2896,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
   based lookup */
, 0, ,
ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
oit.it_create_mode &= ~M_CHECK_STALE;
if (rc < 0) {
rc = ll_inode_revalidate_fini(inode, rc);
@@ -2938,7 +2938,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
 
op_data->op_valid = valid;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
rc = ll_inode_revalidate_fini(inode, rc);
return rc;
@@ -3533,7 +3533,7 @@ again:
ptlrpc_req_finished(it.d.lustre.it_data);
it.d.lustre.it_data = NULL;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
mode = it.d.lustre.it_lock_mode;
it.d.lustre.it_lock_mode = 0;
-- 
2.1.0

--
To unsubscribe from this list: send the line &

[PATCH v2 1/8] Staging: lustre: dir: Replace function calls

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
Changes in v2:
Fix commit message and merge a patch

 drivers/staging/lustre/lustre/llite/dir.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index 5c2ef92..ba3f469 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -182,7 +182,7 @@ static int ll_dir_filler(void *_hash, struct page *page0)
op_data->op_npages = npages;
op_data->op_offset = hash;
rc = md_readpage(exp, op_data, page_pool, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
/* page0 is special, which was added into page cache early */
delete_from_page_cache(page0);
@@ -363,7 +363,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
rc = md_enqueue(ll_i2sbi(dir)->ll_md_exp, , ,
op_data, , NULL, 0, NULL, 0);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
request = (struct ptlrpc_request *)it.d.lustre.it_data;
if (request)
@@ -669,7 +669,7 @@ static int ll_dir_setdirstripe(struct inode *dir, struct 
lmv_user_md *lump,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), 0, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 err_exit:
@@ -730,7 +730,7 @@ int ll_dir_setstripe(struct inode *inode, struct 
lov_user_md *lump,
/* swabbing is done in lov_setstripe() on server side */
rc = md_setattr(sbi->ll_md_exp, op_data, lump, lum_size,
NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc) {
if (rc != -EPERM && rc != -EACCES)
@@ -802,7 +802,7 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md 
**lmmp,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr failed on inode %lu/%u: rc %d\n",
   inode->i_ino,
@@ -868,7 +868,7 @@ int ll_get_mdt_idx(struct inode *inode)
op_data->op_flags |= MF_GET_MDT_IDX;
rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
mdtidx = op_data->op_mds;
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
return rc;
@@ -1301,7 +1301,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 
op_data->op_valid = OBD_MD_FLID;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
goto out_free;
-- 
2.1.0

--
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 v2 0/8] Remove wrapper function and clean up the code

2015-11-09 Thread Shivani Bhardwaj
This patchset removes an unnecessary wrapper function, its prototype and
replaces all its calls in different files with the standard function
that it wraps.
After applying this patch, code becomes cleaner.

Changes in v2:
Fix commit message and merge a patch

Shivani Bhardwaj (8):
  Staging: lustre: dir: Replace function calls
  Staging: lustre: file: Replace function calls with standard function
  Staging: lustre: namei: Replace calls with kfree
  Staging: lustre: xattr_cache: Change function calls to kfree
  Staging: lustre: symlink: Substitute standard function
  Staging: lustre: llite_nfs: Replace function calls with kfree
  Staging: lustre: llite_close: Substitute function calls
  Staging: lustre: llite: Remove ll_finish_md_op_data wrapper

 drivers/staging/lustre/lustre/llite/dir.c  | 14 ++---
 drivers/staging/lustre/lustre/llite/file.c | 24 +++---
 drivers/staging/lustre/lustre/llite/llite_close.c  |  2 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  1 -
 drivers/staging/lustre/lustre/llite/llite_lib.c| 13 
 drivers/staging/lustre/lustre/llite/llite_nfs.c|  2 +-
 drivers/staging/lustre/lustre/llite/namei.c| 12 +--
 drivers/staging/lustre/lustre/llite/symlink.c  |  2 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  2 +-
 9 files changed, 33 insertions(+), 39 deletions(-)

-- 
2.1.0

--
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 8/9] Staging: lustre: llite_lib: Remove wrapper function

2015-11-09 Thread Shivani Bhardwaj
On Tue, Nov 10, 2015 at 12:48 AM, Simmons, James A.  wrote:
>>On Mon, Nov 9, 2015 at 7:07 PM, Michał Kępień  wrote:
 Remove the function ll_finish_md_op_data() and replace all its calls
 with the standrd function ll_finish_md_op_data().
>>>
>>> I believe you meant to write "standard function kfree()".
>>>
>>
>>Yes. I am so sorry. Should I be sending the whole series again?
>>Thank you
>>Shivani
>
> Yes please redo the series. I saw Oleg's concern and I would recommend that
> besides the conversion to kfree that you add comments about what is being 
> deleted.
> I.E
>
> /* Free struct md_op_data  data*/
> kfree(...)

I'll do that.
Thank you
--
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] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper

2015-11-09 Thread Shivani Bhardwaj
Remove the wrapper function lustre_posix_acl_xattr_free() and replace its
call in the file xattr with the function kfree() that it wrapped. Also,
its prototype from the header lustre_eacl is removed as it is no longer
of any use.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/include/lustre_eacl.h | 2 --
 drivers/staging/lustre/lustre/llite/xattr.c | 5 -
 drivers/staging/lustre/lustre/obdclass/acl.c| 9 -
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_eacl.h 
b/drivers/staging/lustre/lustre/include/lustre_eacl.h
index fee4d2c..0b66593 100644
--- a/drivers/staging/lustre/lustre/include/lustre_eacl.h
+++ b/drivers/staging/lustre/lustre/include/lustre_eacl.h
@@ -76,8 +76,6 @@ extern int
 lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, size_t size,
  posix_acl_xattr_header **out);
 extern void
-lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
-extern void
 lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
 extern ext_acl_xattr_header *
 lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
diff --git a/drivers/staging/lustre/lustre/llite/xattr.c 
b/drivers/staging/lustre/lustre/llite/xattr.c
index 4b7eb33..f9b1dee 100644
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -193,7 +193,10 @@ int ll_setxattr_common(struct inode *inode, const char 
*name,
 ll_i2suppgid(inode), );
 #ifdef CONFIG_FS_POSIX_ACL
if (new_value != NULL)
-   lustre_posix_acl_xattr_free(new_value, size);
+   /*
+* Release the posix ACL space.
+*/
+   kfree(new_value);
if (acl != NULL)
lustre_ext_acl_xattr_free(acl);
 #endif
diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c 
b/drivers/staging/lustre/lustre/obdclass/acl.c
index 2e20cf6..49ba885 100644
--- a/drivers/staging/lustre/lustre/obdclass/acl.c
+++ b/drivers/staging/lustre/lustre/obdclass/acl.c
@@ -236,15 +236,6 @@ _out:
 EXPORT_SYMBOL(lustre_posix_acl_xattr_filter);
 
 /*
- * Release the posix ACL space.
- */
-void lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size)
-{
-   kfree(header);
-}
-EXPORT_SYMBOL(lustre_posix_acl_xattr_free);
-
-/*
  * Release the extended ACL space.
  */
 void lustre_ext_acl_xattr_free(ext_acl_xattr_header *header)
-- 
2.1.0

--
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 8/9] Staging: lustre: llite_lib: Remove wrapper function

2015-11-09 Thread Shivani Bhardwaj
On Mon, Nov 9, 2015 at 7:07 PM, Michał Kępień  wrote:
>> Remove the function ll_finish_md_op_data() and replace all its calls
>> with the standrd function ll_finish_md_op_data().
>
> I believe you meant to write "standard function kfree()".
>

Yes. I am so sorry. Should I be sending the whole series again?
Thank you
Shivani

> --
> Best regards,
> Michał Kępień
--
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 v2 0/8] Remove wrapper function and clean up the code

2015-11-09 Thread Shivani Bhardwaj
This patchset removes an unnecessary wrapper function, its prototype and
replaces all its calls in different files with the standard function
that it wraps.
After applying this patch, code becomes cleaner.

Changes in v2:
Fix commit message and merge a patch

Shivani Bhardwaj (8):
  Staging: lustre: dir: Replace function calls
  Staging: lustre: file: Replace function calls with standard function
  Staging: lustre: namei: Replace calls with kfree
  Staging: lustre: xattr_cache: Change function calls to kfree
  Staging: lustre: symlink: Substitute standard function
  Staging: lustre: llite_nfs: Replace function calls with kfree
  Staging: lustre: llite_close: Substitute function calls
  Staging: lustre: llite: Remove ll_finish_md_op_data wrapper

 drivers/staging/lustre/lustre/llite/dir.c  | 14 ++---
 drivers/staging/lustre/lustre/llite/file.c | 24 +++---
 drivers/staging/lustre/lustre/llite/llite_close.c  |  2 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  1 -
 drivers/staging/lustre/lustre/llite/llite_lib.c| 13 
 drivers/staging/lustre/lustre/llite/llite_nfs.c|  2 +-
 drivers/staging/lustre/lustre/llite/namei.c| 12 +--
 drivers/staging/lustre/lustre/llite/symlink.c  |  2 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  2 +-
 9 files changed, 33 insertions(+), 39 deletions(-)

-- 
2.1.0

--
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 v2 3/8] Staging: lustre: namei: Replace calls with kfree

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 2ca2200..f058ebe2 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -531,7 +531,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, 
struct dentry *dentry,
 
rc = md_intent_lock(ll_i2mdexp(parent), op_data, NULL, 0, it,
lookup_flags, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
retval = ERR_PTR(rc);
goto out;
@@ -786,7 +786,7 @@ static int ll_new_node(struct inode *dir, struct dentry 
*dentry,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), rdev, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 
@@ -961,7 +961,7 @@ static int ll_unlink(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc)
goto out;
 
@@ -1011,7 +1011,7 @@ static int ll_rmdir(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == 0) {
ll_update_times(request, dir);
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1);
@@ -1060,7 +1060,7 @@ static int ll_link(struct dentry *old_dentry, struct 
inode *dir,
return PTR_ERR(op_data);
 
err = md_link(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto out;
 
@@ -1096,7 +1096,7 @@ static int ll_rename(struct inode *old_dir, struct dentry 
*old_dentry,
old_dentry->d_name.len,
new_dentry->d_name.name,
new_dentry->d_name.len, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (!err) {
ll_update_times(request, old_dir);
ll_update_times(request, new_dir);
-- 
2.1.0

--
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 v2 2/8] Staging: lustre: file: Replace function calls with standard function

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

 drivers/staging/lustre/lustre/llite/file.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 02f2759..186b5af 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -202,7 +202,7 @@ static int ll_close_inode_openhandle(struct obd_export 
*md_exp,
rc = -EBUSY;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 out:
if (exp_connect_som(exp) && !epoch_close &&
@@ -420,7 +420,7 @@ static int ll_intent_file_open(struct dentry *dentry, void 
*lmm,
itp->it_flags |= MDS_OPEN_BY_FID;
rc = md_intent_lock(sbi->ll_md_exp, op_data, lmm, lmmsize, itp,
0 /*unused */, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == -ESTALE) {
/* reason for keep own exit path - don`t flood log
* with messages with -ESTALE errors.
@@ -819,7 +819,7 @@ ll_lease_open(struct inode *inode, struct file *file, 
fmode_t fmode,
 * open in ll_md_blocking_ast(). Otherwise as ll_md_blocking_lease_ast
 * doesn't deal with openhandle, so normal openhandle will be leaked. */
LDLM_FL_NO_LRU | LDLM_FL_EXCL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc < 0)
goto out_release_it;
@@ -1393,7 +1393,7 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const 
char *filename,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name failed on %s: rc %d\n",
   filename, rc);
@@ -2056,7 +2056,7 @@ static int ll_swap_layouts(struct file *file1, struct 
file *file2,
 
rc = obd_iocontrol(LL_IOC_LOV_SWAP_LAYOUTS, ll_i2mdexp(llss->inode1),
   sizeof(*op_data), op_data, NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 putgl:
if (gid != 0) {
@@ -2131,7 +2131,7 @@ static int ll_hsm_state_set(struct inode *inode, struct 
hsm_state_set *hss)
rc = obd_iocontrol(LL_IOC_HSM_STATE_SET, ll_i2mdexp(inode),
   sizeof(*op_data), op_data, NULL);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((void *)arg, hus, sizeof(*hus)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hus);
return rc;
}
@@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((char *)arg, hca, sizeof(*hca)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hca);
return rc;
}
@@ -2761,7 +2761,7 @@ ll_file_flock(struct file *file, int cmd, struct 
file_lock *file_lock)
rc = rc2;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2896,7 +2896,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
   based lookup */
, 0, ,
ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
oit.it_create_mode &= ~M_CHECK_STALE;
if (rc < 0) {
rc = ll_inode_revalidate_fini(inode, rc);
@@ -2938,7 +2938,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
 
op_data->op_valid = valid;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
rc = ll_inode_revalidate_fini(inode, rc);
return rc;
@@ -3533,7 +3533,7 @@ again:
ptlrpc_req_finished(it.d.lustre.it_data);
it.d.lustre.it_data = NULL;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
mode = it.d.lustre.it_lock_mode;
it.d.lustre.it_lock_mode = 0;
-- 
2.1.0

--
To unsubscribe fr

[PATCH v2 1/8] Staging: lustre: dir: Replace function calls

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

 drivers/staging/lustre/lustre/llite/dir.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index 5c2ef92..ba3f469 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -182,7 +182,7 @@ static int ll_dir_filler(void *_hash, struct page *page0)
op_data->op_npages = npages;
op_data->op_offset = hash;
rc = md_readpage(exp, op_data, page_pool, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
/* page0 is special, which was added into page cache early */
delete_from_page_cache(page0);
@@ -363,7 +363,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
rc = md_enqueue(ll_i2sbi(dir)->ll_md_exp, , ,
op_data, , NULL, 0, NULL, 0);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
request = (struct ptlrpc_request *)it.d.lustre.it_data;
if (request)
@@ -669,7 +669,7 @@ static int ll_dir_setdirstripe(struct inode *dir, struct 
lmv_user_md *lump,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), 0, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 err_exit:
@@ -730,7 +730,7 @@ int ll_dir_setstripe(struct inode *inode, struct 
lov_user_md *lump,
/* swabbing is done in lov_setstripe() on server side */
rc = md_setattr(sbi->ll_md_exp, op_data, lump, lum_size,
NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc) {
if (rc != -EPERM && rc != -EACCES)
@@ -802,7 +802,7 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md 
**lmmp,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr failed on inode %lu/%u: rc %d\n",
   inode->i_ino,
@@ -868,7 +868,7 @@ int ll_get_mdt_idx(struct inode *inode)
op_data->op_flags |= MF_GET_MDT_IDX;
rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
mdtidx = op_data->op_mds;
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
return rc;
@@ -1301,7 +1301,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 
op_data->op_valid = OBD_MD_FLID;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
goto out_free;
-- 
2.1.0

--
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 v2 4/8] Staging: lustre: xattr_cache: Change function calls to kfree

2015-11-09 Thread Shivani Bhardwaj
Change the calls of the function ll_finish_md_op_data() to the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c 
b/drivers/staging/lustre/lustre/llite/xattr_cache.c
index e1e599c..b7f3efc 100644
--- a/drivers/staging/lustre/lustre/llite/xattr_cache.c
+++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c
@@ -306,7 +306,7 @@ static int ll_xattr_find_get_lock(struct inode *inode,
op_data->op_valid = OBD_MD_FLXATTR | OBD_MD_FLXATTRLS;
 
rc = md_enqueue(exp, , oit, op_data, , NULL, 0, NULL, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (rc < 0) {
CDEBUG(D_CACHE,
-- 
2.1.0

--
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 v2 5/8] Staging: lustre: symlink: Substitute standard function

2015-11-09 Thread Shivani Bhardwaj
Substitute the standard function kfree() for the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/symlink.c 
b/drivers/staging/lustre/lustre/llite/symlink.c
index 69b2036..6b0d1cc 100644
--- a/drivers/staging/lustre/lustre/llite/symlink.c
+++ b/drivers/staging/lustre/lustre/llite/symlink.c
@@ -73,7 +73,7 @@ static int ll_readlink_internal(struct inode *inode,
 
op_data->op_valid = OBD_MD_LINKNAME;
rc = md_getattr(sbi->ll_md_exp, op_data, request);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
if (rc != -ENOENT)
CERROR("inode %lu: rc = %d\n", inode->i_ino, rc);
-- 
2.1.0

--
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 v2 6/8] Staging: lustre: llite_nfs: Replace function calls with kfree

2015-11-09 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index e578a11..a3a89a7 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -306,7 +306,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
return (void *)op_data;
 
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino);
return ERR_PTR(rc);
-- 
2.1.0

--
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 v2 8/8] Staging: lustre: llite: Remove ll_finish_md_op_data wrapper

2015-11-09 Thread Shivani Bhardwaj
Remove the wrapper function ll_finish_md_op_data() and replace all
its calls with the standard function kfree() that it wraps. Also,
prototype of the function is removed as it is no longer of any use.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

 drivers/staging/lustre/lustre/llite/llite_internal.h |  1 -
 drivers/staging/lustre/lustre/llite/llite_lib.c  | 13 -
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 157c3284..d12d483 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -792,7 +792,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
  struct inode *i1, struct inode *i2,
  const char *name, int namelen,
  int mode, __u32 opc, void *data);
-void ll_finish_md_op_data(struct md_op_data *op_data);
 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
 void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req);
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4a8c759..143be87 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1355,7 +1355,7 @@ out:
if (!rc)
rc = rc1;
}
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (!S_ISDIR(inode->i_mode)) {
mutex_lock(>i_mutex);
@@ -1732,7 +1732,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 
op_data->op_valid = OBD_MD_FLFLAGS;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu\n", rc, inode->i_ino);
return -abs(rc);
@@ -1763,7 +1763,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
rc = md_setattr(sbi->ll_md_exp, op_data,
NULL, 0, NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc)
return rc;
@@ -1934,7 +1934,7 @@ void ll_open_cleanup(struct super_block *sb, struct 
ptlrpc_request *open_req)
op_data->op_mod_time = get_seconds();
md_close(exp, op_data, NULL, _req);
ptlrpc_req_finished(close_req);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 }
 
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
@@ -2170,11 +2170,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
return op_data;
 }
 
-void ll_finish_md_op_data(struct md_op_data *op_data)
-{
-   kfree(op_data);
-}
-
 int ll_show_options(struct seq_file *seq, struct dentry *dentry)
 {
struct ll_sb_info *sbi;
-- 
2.1.0

--
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 v2 7/8] Staging: lustre: llite_close: Substitute function calls

2015-11-09 Thread Shivani Bhardwaj
Substitute standard function kfree() in place of the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
Changes in v2:
Fix commit message and merge a patch

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

diff --git a/drivers/staging/lustre/lustre/llite/llite_close.c 
b/drivers/staging/lustre/lustre/llite/llite_close.c
index 3f348a3..c4f22ec 100644
--- a/drivers/staging/lustre/lustre/llite/llite_close.c
+++ b/drivers/staging/lustre/lustre/llite/llite_close.c
@@ -301,7 +301,7 @@ static void ll_done_writing(struct inode *inode)
CERROR("inode %lu mdc done_writing failed: rc = %d\n",
   inode->i_ino, rc);
 out:
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (och) {
md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och);
kfree(och);
-- 
2.1.0

--
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] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper

2015-11-09 Thread Shivani Bhardwaj
Remove the wrapper function lustre_posix_acl_xattr_free() and replace its
call in the file xattr with the function kfree() that it wrapped. Also,
its prototype from the header lustre_eacl is removed as it is no longer
of any use.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/include/lustre_eacl.h | 2 --
 drivers/staging/lustre/lustre/llite/xattr.c | 5 -
 drivers/staging/lustre/lustre/obdclass/acl.c| 9 -
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_eacl.h 
b/drivers/staging/lustre/lustre/include/lustre_eacl.h
index fee4d2c..0b66593 100644
--- a/drivers/staging/lustre/lustre/include/lustre_eacl.h
+++ b/drivers/staging/lustre/lustre/include/lustre_eacl.h
@@ -76,8 +76,6 @@ extern int
 lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, size_t size,
  posix_acl_xattr_header **out);
 extern void
-lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
-extern void
 lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
 extern ext_acl_xattr_header *
 lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
diff --git a/drivers/staging/lustre/lustre/llite/xattr.c 
b/drivers/staging/lustre/lustre/llite/xattr.c
index 4b7eb33..f9b1dee 100644
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -193,7 +193,10 @@ int ll_setxattr_common(struct inode *inode, const char 
*name,
 ll_i2suppgid(inode), );
 #ifdef CONFIG_FS_POSIX_ACL
if (new_value != NULL)
-   lustre_posix_acl_xattr_free(new_value, size);
+   /*
+* Release the posix ACL space.
+*/
+   kfree(new_value);
if (acl != NULL)
lustre_ext_acl_xattr_free(acl);
 #endif
diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c 
b/drivers/staging/lustre/lustre/obdclass/acl.c
index 2e20cf6..49ba885 100644
--- a/drivers/staging/lustre/lustre/obdclass/acl.c
+++ b/drivers/staging/lustre/lustre/obdclass/acl.c
@@ -236,15 +236,6 @@ _out:
 EXPORT_SYMBOL(lustre_posix_acl_xattr_filter);
 
 /*
- * Release the posix ACL space.
- */
-void lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size)
-{
-   kfree(header);
-}
-EXPORT_SYMBOL(lustre_posix_acl_xattr_free);
-
-/*
  * Release the extended ACL space.
  */
 void lustre_ext_acl_xattr_free(ext_acl_xattr_header *header)
-- 
2.1.0

--
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 8/9] Staging: lustre: llite_lib: Remove wrapper function

2015-11-09 Thread Shivani Bhardwaj
On Mon, Nov 9, 2015 at 7:07 PM, Michał Kępień  wrote:
>> Remove the function ll_finish_md_op_data() and replace all its calls
>> with the standrd function ll_finish_md_op_data().
>
> I believe you meant to write "standard function kfree()".
>

Yes. I am so sorry. Should I be sending the whole series again?
Thank you
Shivani

> --
> Best regards,
> Michał Kępień
--
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 8/9] Staging: lustre: llite_lib: Remove wrapper function

2015-11-09 Thread Shivani Bhardwaj
On Tue, Nov 10, 2015 at 12:48 AM, Simmons, James A.  wrote:
>>On Mon, Nov 9, 2015 at 7:07 PM, Michał Kępień  wrote:
 Remove the function ll_finish_md_op_data() and replace all its calls
 with the standrd function ll_finish_md_op_data().
>>>
>>> I believe you meant to write "standard function kfree()".
>>>
>>
>>Yes. I am so sorry. Should I be sending the whole series again?
>>Thank you
>>Shivani
>
> Yes please redo the series. I saw Oleg's concern and I would recommend that
> besides the conversion to kfree that you add comments about what is being 
> deleted.
> I.E
>
> /* Free struct md_op_data  data*/
> kfree(...)

I'll do that.
Thank you
--
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] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread Shivani Bhardwaj
On Sun, Nov 8, 2015 at 10:33 PM, Shivani Bhardwaj  wrote:
> Remove the function mgc_ir_state_seq_show() as it is not
> referenced/called anywhere.
>
> Signed-off-by: Shivani Bhardwaj 
> ---
>  drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 -
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c 
> b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> index 8d5bc5a..ad6a7d9 100644
> --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> @@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
>
>  LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
>
> -static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
> -{
> -   return lprocfs_mgc_rd_ir_state(m, m->private);
> -}
> -
>  LPROC_SEQ_FOPS_RO(mgc_ir_state);
>
>  static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
> --
> 2.1.0
>

I just found out that this is producing errors. Please do not consider this.
Thank you
Shivani
--
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] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread Shivani Bhardwaj
Remove the function mgc_ir_state_seq_show() as it is not
referenced/called anywhere.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c 
b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
index 8d5bc5a..ad6a7d9 100644
--- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
+++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
@@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
 
 LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
 
-static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
-{
-   return lprocfs_mgc_rd_ir_state(m, m->private);
-}
-
 LPROC_SEQ_FOPS_RO(mgc_ir_state);
 
 static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
-- 
2.1.0

--
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] staging: lustre: mdc_request: Remove mdc_kuc_reregister wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function mdc_kuc_reregister() and replace its call
with the function it wrapped. Also, comment has been added for clarity.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 294c050..e172be1 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -2037,17 +2037,6 @@ static int mdc_hsm_ct_reregister(__u32 data, void 
*cb_arg)
return ((rc != 0) && (rc != -EEXIST)) ? rc : 0;
 }
 
-/**
- * Re-establish all kuc contexts with MDT
- * after MDT shutdown/recovery.
- */
-static int mdc_kuc_reregister(struct obd_import *imp)
-{
-   /* re-register HSM agents */
-   return libcfs_kkuc_group_foreach(KUC_GRP_HSM, mdc_hsm_ct_reregister,
-(void *)imp);
-}
-
 static int mdc_set_info_async(const struct lu_env *env,
  struct obd_export *exp,
  u32 keylen, void *key,
@@ -2210,7 +2199,10 @@ static int mdc_import_event(struct obd_device *obd, 
struct obd_import *imp,
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE, NULL);
/* redo the kuc registration after reconnecting */
if (rc == 0)
-   rc = mdc_kuc_reregister(imp);
+   /* re-register HSM agents */
+   rc = libcfs_kkuc_group_foreach(KUC_GRP_HSM,
+  mdc_hsm_ct_reregister,
+  (void *)imp);
break;
case IMP_EVENT_OCD:
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD, NULL);
-- 
2.1.0

--
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 2/2] staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function cfs_wi_sched_unlock() and replace all its
calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/libcfs/workitem.c | 26 ++---
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c 
b/drivers/staging/lustre/lustre/libcfs/workitem.c
index e8bac9b..60bb88a 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -86,26 +86,20 @@ static struct cfs_workitem_data {
int wi_stopping;
 } cfs_wi_data;
 
-static inline void
-cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
-{
-   spin_unlock(>ws_lock);
-}
-
 static inline int
 cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
spin_lock(>ws_lock);
if (sched->ws_stopping) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return 0;
}
 
if (!list_empty(>ws_runq)) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return 0;
}
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return 1;
 }
 
@@ -133,7 +127,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
LASSERT(list_empty(>wi_list));
 
wi->wi_scheduled = 1; /* LBUG future schedule attempts */
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
 
return;
 }
@@ -171,7 +165,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, 
cfs_workitem_t *wi)
 
LASSERT (list_empty(>wi_list));
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return rc;
 }
 EXPORT_SYMBOL(cfs_wi_deschedule);
@@ -205,7 +199,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t 
*wi)
}
 
LASSERT (!list_empty(>wi_list));
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return;
 }
 EXPORT_SYMBOL(cfs_wi_schedule);
@@ -252,7 +246,7 @@ cfs_wi_scheduler (void *arg)
wi->wi_running   = 1;
wi->wi_scheduled = 0;
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
nloops++;
 
rc = (*wi->wi_action) (wi);
@@ -272,7 +266,7 @@ cfs_wi_scheduler (void *arg)
}
 
if (!list_empty(>ws_runq)) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
/* don't sleep because some workitems still
 * expect me to come back soon */
cond_resched();
@@ -280,13 +274,13 @@ cfs_wi_scheduler (void *arg)
continue;
}
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched));
spin_lock(>ws_lock);
}
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
 
spin_lock(_wi_data.wi_glock);
sched->ws_nthreads--;
-- 
2.1.0

--
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 0/2] Remove wrapper functions from workitem

2015-11-08 Thread Shivani Bhardwaj
This patchset removes unnecessary wrapper functions from the file workitem
and replace all their calls with the function that they wrap.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (2):
  staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper
  staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper

 drivers/staging/lustre/lustre/libcfs/workitem.c | 48 ++---
 1 file changed, 18 insertions(+), 30 deletions(-)

-- 
2.1.0

--
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 1/2] staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function cfs_wi_sched_lock() and replace all its
calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/libcfs/workitem.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c 
b/drivers/staging/lustre/lustre/libcfs/workitem.c
index b57acbf..e8bac9b 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -87,12 +87,6 @@ static struct cfs_workitem_data {
 } cfs_wi_data;
 
 static inline void
-cfs_wi_sched_lock(struct cfs_wi_sched *sched)
-{
-   spin_lock(>ws_lock);
-}
-
-static inline void
 cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 {
spin_unlock(>ws_lock);
@@ -101,7 +95,7 @@ cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 static inline int
 cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
if (sched->ws_stopping) {
cfs_wi_sched_unlock(sched);
return 0;
@@ -125,7 +119,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
LASSERT(!in_interrupt()); /* because we use plain spinlock */
LASSERT(!sched->ws_stopping);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
LASSERT(wi->wi_running);
if (wi->wi_scheduled) { /* cancel pending schedules */
@@ -161,7 +155,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, 
cfs_workitem_t *wi)
 * means the workitem will not be scheduled and will not have
 * any race with wi_action.
 */
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
rc = !(wi->wi_running);
 
@@ -195,7 +189,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t 
*wi)
LASSERT(!in_interrupt()); /* because we use plain spinlock */
LASSERT(!sched->ws_stopping);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
if (!wi->wi_scheduled) {
LASSERT (list_empty(>wi_list));
@@ -237,7 +231,7 @@ cfs_wi_scheduler (void *arg)
 
spin_unlock(_wi_data.wi_glock);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
while (!sched->ws_stopping) {
int  nloops = 0;
@@ -263,7 +257,7 @@ cfs_wi_scheduler (void *arg)
 
rc = (*wi->wi_action) (wi);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
if (rc != 0) /* WI should be dead, even be freed! */
continue;
 
@@ -282,14 +276,14 @@ cfs_wi_scheduler (void *arg)
/* don't sleep because some workitems still
 * expect me to come back soon */
cond_resched();
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
continue;
}
 
cfs_wi_sched_unlock(sched);
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched));
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
}
 
cfs_wi_sched_unlock(sched);
-- 
2.1.0

--
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 9/9] Staging: lustre: llite_internal: Remove function prototype

2015-11-08 Thread Shivani Bhardwaj
On Sun, Nov 8, 2015 at 2:17 AM, Dan Carpenter  wrote:
> Don't resend, it's fine.  I don't like re-reviewing patches and you
> don't like sending them.  It's not like it introduces a bug or generate
> a warning with our current tools.
>
> But it's still important to understand how the one thing per patch rule
> works (don't do half a thing per patch) so I wanted you to be aware of
> it for future patches as you said.
>

I'll take care next time.

Thank you
Shivani

> regards,
> dan carpenter
>
--
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] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread Shivani Bhardwaj
Remove the function mgc_ir_state_seq_show() as it is not
referenced/called anywhere.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c 
b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
index 8d5bc5a..ad6a7d9 100644
--- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
+++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
@@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
 
 LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
 
-static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
-{
-   return lprocfs_mgc_rd_ir_state(m, m->private);
-}
-
 LPROC_SEQ_FOPS_RO(mgc_ir_state);
 
 static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
-- 
2.1.0

--
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 0/2] Remove wrapper functions from workitem

2015-11-08 Thread Shivani Bhardwaj
This patchset removes unnecessary wrapper functions from the file workitem
and replace all their calls with the function that they wrap.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (2):
  staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper
  staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper

 drivers/staging/lustre/lustre/libcfs/workitem.c | 48 ++---
 1 file changed, 18 insertions(+), 30 deletions(-)

-- 
2.1.0

--
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 1/2] staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function cfs_wi_sched_lock() and replace all its
calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/workitem.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c 
b/drivers/staging/lustre/lustre/libcfs/workitem.c
index b57acbf..e8bac9b 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -87,12 +87,6 @@ static struct cfs_workitem_data {
 } cfs_wi_data;
 
 static inline void
-cfs_wi_sched_lock(struct cfs_wi_sched *sched)
-{
-   spin_lock(>ws_lock);
-}
-
-static inline void
 cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 {
spin_unlock(>ws_lock);
@@ -101,7 +95,7 @@ cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 static inline int
 cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
if (sched->ws_stopping) {
cfs_wi_sched_unlock(sched);
return 0;
@@ -125,7 +119,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
LASSERT(!in_interrupt()); /* because we use plain spinlock */
LASSERT(!sched->ws_stopping);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
LASSERT(wi->wi_running);
if (wi->wi_scheduled) { /* cancel pending schedules */
@@ -161,7 +155,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, 
cfs_workitem_t *wi)
 * means the workitem will not be scheduled and will not have
 * any race with wi_action.
 */
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
rc = !(wi->wi_running);
 
@@ -195,7 +189,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t 
*wi)
LASSERT(!in_interrupt()); /* because we use plain spinlock */
LASSERT(!sched->ws_stopping);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
if (!wi->wi_scheduled) {
LASSERT (list_empty(>wi_list));
@@ -237,7 +231,7 @@ cfs_wi_scheduler (void *arg)
 
spin_unlock(_wi_data.wi_glock);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
 
while (!sched->ws_stopping) {
int  nloops = 0;
@@ -263,7 +257,7 @@ cfs_wi_scheduler (void *arg)
 
rc = (*wi->wi_action) (wi);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
if (rc != 0) /* WI should be dead, even be freed! */
continue;
 
@@ -282,14 +276,14 @@ cfs_wi_scheduler (void *arg)
/* don't sleep because some workitems still
 * expect me to come back soon */
cond_resched();
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
continue;
}
 
cfs_wi_sched_unlock(sched);
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched));
-   cfs_wi_sched_lock(sched);
+   spin_lock(>ws_lock);
}
 
cfs_wi_sched_unlock(sched);
-- 
2.1.0

--
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 2/2] staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function cfs_wi_sched_unlock() and replace all its
calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/workitem.c | 26 ++---
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c 
b/drivers/staging/lustre/lustre/libcfs/workitem.c
index e8bac9b..60bb88a 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -86,26 +86,20 @@ static struct cfs_workitem_data {
int wi_stopping;
 } cfs_wi_data;
 
-static inline void
-cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
-{
-   spin_unlock(>ws_lock);
-}
-
 static inline int
 cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
spin_lock(>ws_lock);
if (sched->ws_stopping) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return 0;
}
 
if (!list_empty(>ws_runq)) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return 0;
}
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return 1;
 }
 
@@ -133,7 +127,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
LASSERT(list_empty(>wi_list));
 
wi->wi_scheduled = 1; /* LBUG future schedule attempts */
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
 
return;
 }
@@ -171,7 +165,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, 
cfs_workitem_t *wi)
 
LASSERT (list_empty(>wi_list));
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return rc;
 }
 EXPORT_SYMBOL(cfs_wi_deschedule);
@@ -205,7 +199,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t 
*wi)
}
 
LASSERT (!list_empty(>wi_list));
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
return;
 }
 EXPORT_SYMBOL(cfs_wi_schedule);
@@ -252,7 +246,7 @@ cfs_wi_scheduler (void *arg)
wi->wi_running   = 1;
wi->wi_scheduled = 0;
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
nloops++;
 
rc = (*wi->wi_action) (wi);
@@ -272,7 +266,7 @@ cfs_wi_scheduler (void *arg)
}
 
if (!list_empty(>ws_runq)) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
/* don't sleep because some workitems still
 * expect me to come back soon */
cond_resched();
@@ -280,13 +274,13 @@ cfs_wi_scheduler (void *arg)
continue;
}
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched));
spin_lock(>ws_lock);
}
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(>ws_lock);
 
spin_lock(_wi_data.wi_glock);
sched->ws_nthreads--;
-- 
2.1.0

--
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] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread Shivani Bhardwaj
On Sun, Nov 8, 2015 at 10:33 PM, Shivani Bhardwaj <shivanib...@gmail.com> wrote:
> Remove the function mgc_ir_state_seq_show() as it is not
> referenced/called anywhere.
>
> Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
> ---
>  drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 -
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c 
> b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> index 8d5bc5a..ad6a7d9 100644
> --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> @@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
>
>  LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
>
> -static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
> -{
> -   return lprocfs_mgc_rd_ir_state(m, m->private);
> -}
> -
>  LPROC_SEQ_FOPS_RO(mgc_ir_state);
>
>  static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
> --
> 2.1.0
>

I just found out that this is producing errors. Please do not consider this.
Thank you
Shivani
--
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] staging: lustre: mdc_request: Remove mdc_kuc_reregister wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function mdc_kuc_reregister() and replace its call
with the function it wrapped. Also, comment has been added for clarity.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 294c050..e172be1 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -2037,17 +2037,6 @@ static int mdc_hsm_ct_reregister(__u32 data, void 
*cb_arg)
return ((rc != 0) && (rc != -EEXIST)) ? rc : 0;
 }
 
-/**
- * Re-establish all kuc contexts with MDT
- * after MDT shutdown/recovery.
- */
-static int mdc_kuc_reregister(struct obd_import *imp)
-{
-   /* re-register HSM agents */
-   return libcfs_kkuc_group_foreach(KUC_GRP_HSM, mdc_hsm_ct_reregister,
-(void *)imp);
-}
-
 static int mdc_set_info_async(const struct lu_env *env,
  struct obd_export *exp,
  u32 keylen, void *key,
@@ -2210,7 +2199,10 @@ static int mdc_import_event(struct obd_device *obd, 
struct obd_import *imp,
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE, NULL);
/* redo the kuc registration after reconnecting */
if (rc == 0)
-   rc = mdc_kuc_reregister(imp);
+   /* re-register HSM agents */
+   rc = libcfs_kkuc_group_foreach(KUC_GRP_HSM,
+  mdc_hsm_ct_reregister,
+  (void *)imp);
break;
case IMP_EVENT_OCD:
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD, NULL);
-- 
2.1.0

--
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 9/9] Staging: lustre: llite_internal: Remove function prototype

2015-11-08 Thread Shivani Bhardwaj
On Sun, Nov 8, 2015 at 2:17 AM, Dan Carpenter  wrote:
> Don't resend, it's fine.  I don't like re-reviewing patches and you
> don't like sending them.  It's not like it introduces a bug or generate
> a warning with our current tools.
>
> But it's still important to understand how the one thing per patch rule
> works (don't do half a thing per patch) so I wanted you to be aware of
> it for future patches as you said.
>

I'll take care next time.

Thank you
Shivani

> regards,
> dan carpenter
>
--
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 9/9] Staging: lustre: llite_internal: Remove function prototype

2015-11-07 Thread Shivani Bhardwaj
On Sat, Nov 7, 2015 at 4:15 PM, Dan Carpenter  wrote:
> This one should have been folded in with the last one.  Really the whole
> series could have been sent as one patch, but especially the last two
> should have been folded together.
>
> regards,
> dan carpenter
>

Thanks Dan! Could you please suggest whether I should be resending the
complete series?
I'll take care for future patches.

Thank you
Shivani
--
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 5/5] Staging: lustre: statahead: Remove agl_list_empty wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the function agl_list_empty() and replace its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 3a1d294..caee0a6 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -428,7 +428,7 @@ static void ll_agl_add(struct ll_statahead_info *sai,
 
igrab(inode);
spin_lock(>lli_agl_lock);
-   if (agl_list_empty(sai))
+   if (list_empty(>sai_entries_agl))
added = 1;
list_add_tail(>lli_agl_list, >sai_entries_agl);
spin_unlock(>lli_agl_lock);
@@ -522,7 +522,7 @@ static void ll_sai_put(struct ll_statahead_info *sai)
LASSERT(list_empty(>sai_entries_stated));
 
LASSERT(atomic_read(>sai_cache_count) == 0);
-   LASSERT(agl_list_empty(sai));
+   LASSERT(list_empty(>sai_entries_agl));
 
iput(inode);
kfree(sai);
@@ -955,7 +955,7 @@ static int ll_agl_thread(void *arg)
 
while (1) {
l_wait_event(thread->t_ctl_waitq,
-!agl_list_empty(sai) ||
+!list_empty(>sai_entries_agl) ||
 !thread_is_running(thread),
 );
 
@@ -965,7 +965,7 @@ static int ll_agl_thread(void *arg)
spin_lock(>lli_agl_lock);
/* The statahead thread maybe help to process AGL entries,
 * so check whether list empty again. */
-   if (!agl_list_empty(sai)) {
+   if (!list_empty(>sai_entries_agl)) {
clli = list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
@@ -978,7 +978,7 @@ static int ll_agl_thread(void *arg)
 
spin_lock(>lli_agl_lock);
sai->sai_agl_valid = 0;
-   while (!agl_list_empty(sai)) {
+   while (!list_empty(>sai_entries_agl)) {
clli = list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
@@ -1121,7 +1121,7 @@ keep_it:
l_wait_event(thread->t_ctl_waitq,
 !sa_sent_full(sai) ||
 !list_empty(>sai_entries_received) ||
-!agl_list_empty(sai) ||
+!list_empty(>sai_entries_agl) ||
 !thread_is_running(thread),
 );
 
@@ -1140,7 +1140,7 @@ interpret_it:
 * to process the AGL entries. */
if (sa_sent_full(sai)) {
spin_lock(>lli_agl_lock);
-   while (!agl_list_empty(sai)) {
+   while (!list_empty(>sai_entries_agl)) {
clli = 
list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, 
lli_agl_list);
list_del_init(>lli_agl_list);
@@ -1198,7 +1198,7 @@ do_it:
}
 
spin_lock(>lli_agl_lock);
-   while (!agl_list_empty(sai) &&
+   while (!list_empty(>sai_entries_agl) &&
   thread_is_running(thread)) {
clli = list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, 
lli_agl_list);
-- 
2.1.0

--
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 4/5] Staging: lustre: statahead: Remove sa_received_empty wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the wrapper sa_received_empty() and replace its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index fbc34af..3a1d294 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -518,7 +518,7 @@ static void ll_sai_put(struct ll_statahead_info *sai)
do_sa_entry_fini(sai, entry);
 
LASSERT(list_empty(>sai_entries));
-   LASSERT(sa_received_empty(sai));
+   LASSERT(list_empty(>sai_entries_received));
LASSERT(list_empty(>sai_entries_stated));
 
LASSERT(atomic_read(>sai_cache_count) == 0);
@@ -602,7 +602,7 @@ static void ll_post_statahead(struct ll_statahead_info *sai)
int  rc= 0;
 
spin_lock(>lli_sa_lock);
-   if (unlikely(sa_received_empty(sai))) {
+   if (unlikely(list_empty(>sai_entries_received))) {
spin_unlock(>lli_sa_lock);
return;
}
@@ -738,7 +738,7 @@ static int ll_statahead_interpret(struct ptlrpc_request 
*req,
 * for readpage and other tries to enqueue lock on child
 * with parent's lock held, for example: unlink. */
entry->se_handle = handle;
-   wakeup = sa_received_empty(sai);
+   wakeup = list_empty(>sai_entries_received);
list_add_tail(>se_list,
  >sai_entries_received);
}
@@ -1120,13 +1120,13 @@ static int ll_statahead_thread(void *arg)
 keep_it:
l_wait_event(thread->t_ctl_waitq,
 !sa_sent_full(sai) ||
-!sa_received_empty(sai) ||
+!list_empty(>sai_entries_received) ||
 !agl_list_empty(sai) ||
 !thread_is_running(thread),
 );
 
 interpret_it:
-   while (!sa_received_empty(sai))
+   while (!list_empty(>sai_entries_received))
ll_post_statahead(sai);
 
if (unlikely(!thread_is_running(thread))) {
@@ -1148,7 +1148,7 @@ interpret_it:
ll_agl_trigger(>lli_vfs_inode,
   sai);
 
-   if (!sa_received_empty(sai))
+   if 
(!list_empty(>sai_entries_received))
goto interpret_it;
 
if (unlikely(
@@ -1179,12 +1179,12 @@ do_it:
ll_release_page(page, 0);
while (1) {
l_wait_event(thread->t_ctl_waitq,
-!sa_received_empty(sai) ||
+
!list_empty(>sai_entries_received) ||
 sai->sai_sent == sai->sai_replied 
||
 !thread_is_running(thread),
 );
 
-   while (!sa_received_empty(sai))
+   while (!list_empty(>sai_entries_received))
ll_post_statahead(sai);
 
if (unlikely(!thread_is_running(thread))) {
@@ -1193,7 +1193,7 @@ do_it:
}
 
if (sai->sai_sent == sai->sai_replied &&
-   sa_received_empty(sai))
+   list_empty(>sai_entries_received))
break;
}
 
@@ -1246,12 +1246,12 @@ out:
}
ll_dir_chain_fini();
spin_lock(>lli_sa_lock);
-   if (!sa_received_empty(sai)) {
+   if (!list_empty(>sai_entries_received)) {
thread_set_flags(thread, SVC_STOPPING);
spin_unlock(>lli_sa_lock);
 
/* To release the resources held by received entries. */
-   while (!sa_received_empty(sai))
+   while (!list_empty(>sai_entries_received))
ll_post_statahead(sai);
 
spin_lock(>lli_sa_lock);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More

[PATCH 3/5] Staging: lustre: statahead: Remove agl_first_entry wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the wrapper function agl_first_entry() and replace its calls with
the function list_entry() that it wraps.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index d80ca93..fbc34af 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -133,13 +133,6 @@ static inline int agl_should_run(struct ll_statahead_info 
*sai,
return (inode != NULL && S_ISREG(inode->i_mode) && sai->sai_agl_valid);
 }
 
-static inline struct ll_inode_info *
-agl_first_entry(struct ll_statahead_info *sai)
-{
-   return list_entry(sai->sai_entries_agl.next,
- struct ll_inode_info, lli_agl_list);
-}
-
 static inline int sa_sent_full(struct ll_statahead_info *sai)
 {
return atomic_read(>sai_cache_count) >= sai->sai_max;
@@ -973,7 +966,8 @@ static int ll_agl_thread(void *arg)
/* The statahead thread maybe help to process AGL entries,
 * so check whether list empty again. */
if (!agl_list_empty(sai)) {
-   clli = agl_first_entry(sai);
+   clli = list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
ll_agl_trigger(>lli_vfs_inode, sai);
@@ -985,7 +979,8 @@ static int ll_agl_thread(void *arg)
spin_lock(>lli_agl_lock);
sai->sai_agl_valid = 0;
while (!agl_list_empty(sai)) {
-   clli = agl_first_entry(sai);
+   clli = list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
clli->lli_agl_index = 0;
@@ -1146,7 +1141,8 @@ interpret_it:
if (sa_sent_full(sai)) {
spin_lock(>lli_agl_lock);
while (!agl_list_empty(sai)) {
-   clli = agl_first_entry(sai);
+   clli = 
list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, 
lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
ll_agl_trigger(>lli_vfs_inode,
@@ -1204,7 +1200,8 @@ do_it:
spin_lock(>lli_agl_lock);
while (!agl_list_empty(sai) &&
   thread_is_running(thread)) {
-   clli = agl_first_entry(sai);
+   clli = list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, 
lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
ll_agl_trigger(>lli_vfs_inode, sai);
-- 
2.1.0

--
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 2/5] Staging: lustre: statahead: Remove sa_first_received_entry wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the function sa_first_received_entry() and replace all its calls
with the function list_entry() that it wraps.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 8085557..d80ca93 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -133,13 +133,6 @@ static inline int agl_should_run(struct ll_statahead_info 
*sai,
return (inode != NULL && S_ISREG(inode->i_mode) && sai->sai_agl_valid);
 }
 
-static inline struct ll_sa_entry *
-sa_first_received_entry(struct ll_statahead_info *sai)
-{
-   return list_entry(sai->sai_entries_received.next,
- struct ll_sa_entry, se_list);
-}
-
 static inline struct ll_inode_info *
 agl_first_entry(struct ll_statahead_info *sai)
 {
@@ -620,7 +613,8 @@ static void ll_post_statahead(struct ll_statahead_info *sai)
spin_unlock(>lli_sa_lock);
return;
}
-   entry = sa_first_received_entry(sai);
+   entry = list_entry(sai->sai_entries_received.next,
+  struct ll_sa_entry, se_list);
atomic_inc(>se_refcount);
list_del_init(>se_list);
spin_unlock(>lli_sa_lock);
-- 
2.1.0

--
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 1/5] Staging: lustre: statahead: Remove ll_sa_entry_unhashed wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the function ll_sa_entry_unhashed() and replace all its calls
with the function list_empty() that it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 18f5f2b..8085557 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -87,11 +87,6 @@ struct ll_sa_entry {
 static unsigned int sai_generation;
 static DEFINE_SPINLOCK(sai_generation_lock);
 
-static inline int ll_sa_entry_unhashed(struct ll_sa_entry *entry)
-{
-   return list_empty(>se_hash);
-}
-
 /*
  * The entry only can be released by the caller, it is necessary to hold lock.
  */
@@ -331,7 +326,7 @@ static void ll_sa_entry_put(struct ll_statahead_info *sai,
 
LASSERT(list_empty(>se_link));
LASSERT(list_empty(>se_list));
-   LASSERT(ll_sa_entry_unhashed(entry));
+   LASSERT(list_empty(>se_hash));
 
ll_sa_entry_cleanup(sai, entry);
iput(entry->se_inode);
@@ -346,7 +341,7 @@ do_sa_entry_fini(struct ll_statahead_info *sai, struct 
ll_sa_entry *entry)
 {
struct ll_inode_info *lli = ll_i2info(sai->sai_inode);
 
-   LASSERT(!ll_sa_entry_unhashed(entry));
+   LASSERT(!list_empty(>se_hash));
LASSERT(!list_empty(>se_link));
 
ll_sa_entry_unhash(sai, entry);
-- 
2.1.0

--
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 0/5] Remove wrappers from statahead

2015-11-07 Thread Shivani Bhardwaj
This patchset removes unnecessary wrapper functions as the purpose of
clarifying the job of function is still served by the arguments in wrapped
functions. Hence, all the calls to wrapper functions are replaced by the
standard function they wrapped.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (5):
  Staging: lustre: statahead: Remove ll_sa_entry_unhashed wrapper
  Staging: lustre: statahead: Remove sa_first_received_entry wrapper
  Staging: lustre: statahead: Remove agl_first_entry wrapper
  Staging: lustre: statahead: Remove sa_received_empty wrapper
  Staging: lustre: statahead: Remove agl_list_empty wrapper

 drivers/staging/lustre/lustre/llite/statahead.c | 76 ++---
 1 file changed, 31 insertions(+), 45 deletions(-)

-- 
2.1.0

--
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] Staging: lustre: rw: Remove wrapper stride_page_count

2015-11-07 Thread Shivani Bhardwaj
Remove the function stride_page_count() and replace its calls with the
function stride_pg_count() that it wraps.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/rw.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index f79193f..8184d9d 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -880,14 +880,6 @@ static void ras_update_stride_detector(struct 
ll_readahead_state *ras,
return;
 }
 
-static unsigned long
-stride_page_count(struct ll_readahead_state *ras, unsigned long len)
-{
-   return stride_pg_count(ras->ras_stride_offset, ras->ras_stride_length,
-  ras->ras_stride_pages, ras->ras_stride_offset,
-  len);
-}
-
 /* Stride Read-ahead window will be increased inc_len according to
  * stride I/O pattern */
 static void ras_stride_increase_window(struct ll_readahead_state *ras,
@@ -921,7 +913,9 @@ static void ras_stride_increase_window(struct 
ll_readahead_state *ras,
 
window_len += step * ras->ras_stride_length + left;
 
-   if (stride_page_count(ras, window_len) <= ra->ra_max_pages_per_file)
+   if (stride_pg_count(ras->ras_stride_offset, ras->ras_stride_length,
+   ras->ras_stride_pages, ras->ras_stride_offset,
+   window_len) <= ra->ra_max_pages_per_file)
ras->ras_window_len = window_len;
 
RAS_CDEBUG(ras);
-- 
2.1.0

--
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 9/9] Staging: lustre: llite_internal: Remove function prototype

2015-11-07 Thread Shivani Bhardwaj
On Sat, Nov 7, 2015 at 4:15 PM, Dan Carpenter  wrote:
> This one should have been folded in with the last one.  Really the whole
> series could have been sent as one patch, but especially the last two
> should have been folded together.
>
> regards,
> dan carpenter
>

Thanks Dan! Could you please suggest whether I should be resending the
complete series?
I'll take care for future patches.

Thank you
Shivani
--
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 2/5] Staging: lustre: statahead: Remove sa_first_received_entry wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the function sa_first_received_entry() and replace all its calls
with the function list_entry() that it wraps.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/statahead.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 8085557..d80ca93 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -133,13 +133,6 @@ static inline int agl_should_run(struct ll_statahead_info 
*sai,
return (inode != NULL && S_ISREG(inode->i_mode) && sai->sai_agl_valid);
 }
 
-static inline struct ll_sa_entry *
-sa_first_received_entry(struct ll_statahead_info *sai)
-{
-   return list_entry(sai->sai_entries_received.next,
- struct ll_sa_entry, se_list);
-}
-
 static inline struct ll_inode_info *
 agl_first_entry(struct ll_statahead_info *sai)
 {
@@ -620,7 +613,8 @@ static void ll_post_statahead(struct ll_statahead_info *sai)
spin_unlock(>lli_sa_lock);
return;
}
-   entry = sa_first_received_entry(sai);
+   entry = list_entry(sai->sai_entries_received.next,
+  struct ll_sa_entry, se_list);
atomic_inc(>se_refcount);
list_del_init(>se_list);
spin_unlock(>lli_sa_lock);
-- 
2.1.0

--
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 1/5] Staging: lustre: statahead: Remove ll_sa_entry_unhashed wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the function ll_sa_entry_unhashed() and replace all its calls
with the function list_empty() that it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/statahead.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 18f5f2b..8085557 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -87,11 +87,6 @@ struct ll_sa_entry {
 static unsigned int sai_generation;
 static DEFINE_SPINLOCK(sai_generation_lock);
 
-static inline int ll_sa_entry_unhashed(struct ll_sa_entry *entry)
-{
-   return list_empty(>se_hash);
-}
-
 /*
  * The entry only can be released by the caller, it is necessary to hold lock.
  */
@@ -331,7 +326,7 @@ static void ll_sa_entry_put(struct ll_statahead_info *sai,
 
LASSERT(list_empty(>se_link));
LASSERT(list_empty(>se_list));
-   LASSERT(ll_sa_entry_unhashed(entry));
+   LASSERT(list_empty(>se_hash));
 
ll_sa_entry_cleanup(sai, entry);
iput(entry->se_inode);
@@ -346,7 +341,7 @@ do_sa_entry_fini(struct ll_statahead_info *sai, struct 
ll_sa_entry *entry)
 {
struct ll_inode_info *lli = ll_i2info(sai->sai_inode);
 
-   LASSERT(!ll_sa_entry_unhashed(entry));
+   LASSERT(!list_empty(>se_hash));
LASSERT(!list_empty(>se_link));
 
ll_sa_entry_unhash(sai, entry);
-- 
2.1.0

--
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 3/5] Staging: lustre: statahead: Remove agl_first_entry wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the wrapper function agl_first_entry() and replace its calls with
the function list_entry() that it wraps.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/statahead.c | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index d80ca93..fbc34af 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -133,13 +133,6 @@ static inline int agl_should_run(struct ll_statahead_info 
*sai,
return (inode != NULL && S_ISREG(inode->i_mode) && sai->sai_agl_valid);
 }
 
-static inline struct ll_inode_info *
-agl_first_entry(struct ll_statahead_info *sai)
-{
-   return list_entry(sai->sai_entries_agl.next,
- struct ll_inode_info, lli_agl_list);
-}
-
 static inline int sa_sent_full(struct ll_statahead_info *sai)
 {
return atomic_read(>sai_cache_count) >= sai->sai_max;
@@ -973,7 +966,8 @@ static int ll_agl_thread(void *arg)
/* The statahead thread maybe help to process AGL entries,
 * so check whether list empty again. */
if (!agl_list_empty(sai)) {
-   clli = agl_first_entry(sai);
+   clli = list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
ll_agl_trigger(>lli_vfs_inode, sai);
@@ -985,7 +979,8 @@ static int ll_agl_thread(void *arg)
spin_lock(>lli_agl_lock);
sai->sai_agl_valid = 0;
while (!agl_list_empty(sai)) {
-   clli = agl_first_entry(sai);
+   clli = list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
clli->lli_agl_index = 0;
@@ -1146,7 +1141,8 @@ interpret_it:
if (sa_sent_full(sai)) {
spin_lock(>lli_agl_lock);
while (!agl_list_empty(sai)) {
-   clli = agl_first_entry(sai);
+   clli = 
list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, 
lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
ll_agl_trigger(>lli_vfs_inode,
@@ -1204,7 +1200,8 @@ do_it:
spin_lock(>lli_agl_lock);
while (!agl_list_empty(sai) &&
   thread_is_running(thread)) {
-   clli = agl_first_entry(sai);
+   clli = list_entry(sai->sai_entries_agl.next,
+ struct ll_inode_info, 
lli_agl_list);
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
ll_agl_trigger(>lli_vfs_inode, sai);
-- 
2.1.0

--
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 0/5] Remove wrappers from statahead

2015-11-07 Thread Shivani Bhardwaj
This patchset removes unnecessary wrapper functions as the purpose of
clarifying the job of function is still served by the arguments in wrapped
functions. Hence, all the calls to wrapper functions are replaced by the
standard function they wrapped.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (5):
  Staging: lustre: statahead: Remove ll_sa_entry_unhashed wrapper
  Staging: lustre: statahead: Remove sa_first_received_entry wrapper
  Staging: lustre: statahead: Remove agl_first_entry wrapper
  Staging: lustre: statahead: Remove sa_received_empty wrapper
  Staging: lustre: statahead: Remove agl_list_empty wrapper

 drivers/staging/lustre/lustre/llite/statahead.c | 76 ++---
 1 file changed, 31 insertions(+), 45 deletions(-)

-- 
2.1.0

--
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] Staging: lustre: rw: Remove wrapper stride_page_count

2015-11-07 Thread Shivani Bhardwaj
Remove the function stride_page_count() and replace its calls with the
function stride_pg_count() that it wraps.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/rw.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index f79193f..8184d9d 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -880,14 +880,6 @@ static void ras_update_stride_detector(struct 
ll_readahead_state *ras,
return;
 }
 
-static unsigned long
-stride_page_count(struct ll_readahead_state *ras, unsigned long len)
-{
-   return stride_pg_count(ras->ras_stride_offset, ras->ras_stride_length,
-  ras->ras_stride_pages, ras->ras_stride_offset,
-  len);
-}
-
 /* Stride Read-ahead window will be increased inc_len according to
  * stride I/O pattern */
 static void ras_stride_increase_window(struct ll_readahead_state *ras,
@@ -921,7 +913,9 @@ static void ras_stride_increase_window(struct 
ll_readahead_state *ras,
 
window_len += step * ras->ras_stride_length + left;
 
-   if (stride_page_count(ras, window_len) <= ra->ra_max_pages_per_file)
+   if (stride_pg_count(ras->ras_stride_offset, ras->ras_stride_length,
+   ras->ras_stride_pages, ras->ras_stride_offset,
+   window_len) <= ra->ra_max_pages_per_file)
ras->ras_window_len = window_len;
 
RAS_CDEBUG(ras);
-- 
2.1.0

--
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 5/5] Staging: lustre: statahead: Remove agl_list_empty wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the function agl_list_empty() and replace its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/statahead.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 3a1d294..caee0a6 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -428,7 +428,7 @@ static void ll_agl_add(struct ll_statahead_info *sai,
 
igrab(inode);
spin_lock(>lli_agl_lock);
-   if (agl_list_empty(sai))
+   if (list_empty(>sai_entries_agl))
added = 1;
list_add_tail(>lli_agl_list, >sai_entries_agl);
spin_unlock(>lli_agl_lock);
@@ -522,7 +522,7 @@ static void ll_sai_put(struct ll_statahead_info *sai)
LASSERT(list_empty(>sai_entries_stated));
 
LASSERT(atomic_read(>sai_cache_count) == 0);
-   LASSERT(agl_list_empty(sai));
+   LASSERT(list_empty(>sai_entries_agl));
 
iput(inode);
kfree(sai);
@@ -955,7 +955,7 @@ static int ll_agl_thread(void *arg)
 
while (1) {
l_wait_event(thread->t_ctl_waitq,
-!agl_list_empty(sai) ||
+!list_empty(>sai_entries_agl) ||
 !thread_is_running(thread),
 );
 
@@ -965,7 +965,7 @@ static int ll_agl_thread(void *arg)
spin_lock(>lli_agl_lock);
/* The statahead thread maybe help to process AGL entries,
 * so check whether list empty again. */
-   if (!agl_list_empty(sai)) {
+   if (!list_empty(>sai_entries_agl)) {
clli = list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
@@ -978,7 +978,7 @@ static int ll_agl_thread(void *arg)
 
spin_lock(>lli_agl_lock);
sai->sai_agl_valid = 0;
-   while (!agl_list_empty(sai)) {
+   while (!list_empty(>sai_entries_agl)) {
clli = list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, lli_agl_list);
list_del_init(>lli_agl_list);
@@ -1121,7 +1121,7 @@ keep_it:
l_wait_event(thread->t_ctl_waitq,
 !sa_sent_full(sai) ||
 !list_empty(>sai_entries_received) ||
-!agl_list_empty(sai) ||
+!list_empty(>sai_entries_agl) ||
 !thread_is_running(thread),
 );
 
@@ -1140,7 +1140,7 @@ interpret_it:
 * to process the AGL entries. */
if (sa_sent_full(sai)) {
spin_lock(>lli_agl_lock);
-   while (!agl_list_empty(sai)) {
+   while (!list_empty(>sai_entries_agl)) {
clli = 
list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, 
lli_agl_list);
list_del_init(>lli_agl_list);
@@ -1198,7 +1198,7 @@ do_it:
}
 
spin_lock(>lli_agl_lock);
-   while (!agl_list_empty(sai) &&
+   while (!list_empty(>sai_entries_agl) &&
   thread_is_running(thread)) {
clli = list_entry(sai->sai_entries_agl.next,
  struct ll_inode_info, 
lli_agl_list);
-- 
2.1.0

--
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 4/5] Staging: lustre: statahead: Remove sa_received_empty wrapper

2015-11-07 Thread Shivani Bhardwaj
Remove the wrapper sa_received_empty() and replace its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/statahead.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index fbc34af..3a1d294 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -518,7 +518,7 @@ static void ll_sai_put(struct ll_statahead_info *sai)
do_sa_entry_fini(sai, entry);
 
LASSERT(list_empty(>sai_entries));
-   LASSERT(sa_received_empty(sai));
+   LASSERT(list_empty(>sai_entries_received));
LASSERT(list_empty(>sai_entries_stated));
 
LASSERT(atomic_read(>sai_cache_count) == 0);
@@ -602,7 +602,7 @@ static void ll_post_statahead(struct ll_statahead_info *sai)
int  rc= 0;
 
spin_lock(>lli_sa_lock);
-   if (unlikely(sa_received_empty(sai))) {
+   if (unlikely(list_empty(>sai_entries_received))) {
spin_unlock(>lli_sa_lock);
return;
}
@@ -738,7 +738,7 @@ static int ll_statahead_interpret(struct ptlrpc_request 
*req,
 * for readpage and other tries to enqueue lock on child
 * with parent's lock held, for example: unlink. */
entry->se_handle = handle;
-   wakeup = sa_received_empty(sai);
+   wakeup = list_empty(>sai_entries_received);
list_add_tail(>se_list,
  >sai_entries_received);
}
@@ -1120,13 +1120,13 @@ static int ll_statahead_thread(void *arg)
 keep_it:
l_wait_event(thread->t_ctl_waitq,
 !sa_sent_full(sai) ||
-!sa_received_empty(sai) ||
+!list_empty(>sai_entries_received) ||
 !agl_list_empty(sai) ||
 !thread_is_running(thread),
 );
 
 interpret_it:
-   while (!sa_received_empty(sai))
+   while (!list_empty(>sai_entries_received))
ll_post_statahead(sai);
 
if (unlikely(!thread_is_running(thread))) {
@@ -1148,7 +1148,7 @@ interpret_it:
ll_agl_trigger(>lli_vfs_inode,
   sai);
 
-   if (!sa_received_empty(sai))
+   if 
(!list_empty(>sai_entries_received))
goto interpret_it;
 
if (unlikely(
@@ -1179,12 +1179,12 @@ do_it:
ll_release_page(page, 0);
while (1) {
l_wait_event(thread->t_ctl_waitq,
-!sa_received_empty(sai) ||
+
!list_empty(>sai_entries_received) ||
 sai->sai_sent == sai->sai_replied 
||
 !thread_is_running(thread),
 );
 
-   while (!sa_received_empty(sai))
+   while (!list_empty(>sai_entries_received))
ll_post_statahead(sai);
 
if (unlikely(!thread_is_running(thread))) {
@@ -1193,7 +1193,7 @@ do_it:
}
 
if (sai->sai_sent == sai->sai_replied &&
-   sa_received_empty(sai))
+   list_empty(>sai_entries_received))
break;
}
 
@@ -1246,12 +1246,12 @@ out:
}
ll_dir_chain_fini();
spin_lock(>lli_sa_lock);
-   if (!sa_received_empty(sai)) {
+   if (!list_empty(>sai_entries_received)) {
thread_set_flags(thread, SVC_STOPPING);
spin_unlock(>lli_sa_lock);
 
/* To release the resources held by received entries. */
-   while (!sa_received_empty(sai))
+   while (!list_empty(>sai_entries_received))
ll_post_statahead(sai);
 
spin_lock(>lli_sa_lock);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to m

Re: [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype

2015-11-06 Thread Shivani Bhardwaj
On Sat, Nov 7, 2015 at 1:02 PM, Dilger, Andreas
 wrote:
> On 2015/11/06, 10:19, "Shivani Bhardwaj"  wrote:
>
>>Remove the prototype of function cfs_trace_free_string_buffer() as it is
>>no longer needed.
>
> These patches would be a lot more useful if the summary contained the name
> of the function being removed, rather than "remove function prototype" and
> variations of that.  Something like:
>
>staging: lustre: remove cfs_trace_free_string_buffer prototype
>staging: lustre: remove ldlm_pool_set_limit wrapper
>staging: lustre: remove ldlm_pool_get_limit wrapper
>
> Not sure if that is grounds for rejection of this patch series (I'll leave
> that up to Dan and Greg), but definitely something for future patches.
>
> Cheers, Andreas
>

I'll definitely take care of this for future patches that I submit.

Thank you
Shivani

>>Signed-off-by: Shivani Bhardwaj 
>>---
>> drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 -
>> 1 file changed, 1 deletion(-)
>>
>>diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>b/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>index 73d60e0..ba62005 100644
>>--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>@@ -70,7 +70,6 @@ int cfs_trace_copyin_string(char *knl_buffer, int
>>knl_buffer_nob,
>> int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob,
>>const char *knl_str, char *append);
>> int cfs_trace_allocate_string_buffer(char **str, int nob);
>>-void cfs_trace_free_string_buffer(char *str, int nob);
>> int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int
>>usr_str_nob);
>> int cfs_trace_daemon_command(char *str);
>> int cfs_trace_daemon_command_usrstr(void __user *usr_str, int
>>usr_str_nob);
>>--
>>2.1.0
>>
>>
>
>
> Cheers, Andreas
> --
> Andreas Dilger
>
> Lustre Software Architect
> Intel High Performance Data Division
>
>
--
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 9/9] Staging: lustre: llite_internal: Remove function prototype

2015-11-06 Thread Shivani Bhardwaj
Remove the prototype of the function ll_finish_md_op_data() as it is no
longer needed.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 157c3284..d12d483 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -792,7 +792,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
  struct inode *i1, struct inode *i2,
  const char *name, int namelen,
  int mode, __u32 opc, void *data);
-void ll_finish_md_op_data(struct md_op_data *op_data);
 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
 void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req);
-- 
2.1.0

--
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 7/9] Staging: lustre: llite_close: Substitute function calls

2015-11-06 Thread Shivani Bhardwaj
Substitute standard function kfree() in place of the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/llite_close.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_close.c 
b/drivers/staging/lustre/lustre/llite/llite_close.c
index 3f348a3..c4f22ec 100644
--- a/drivers/staging/lustre/lustre/llite/llite_close.c
+++ b/drivers/staging/lustre/lustre/llite/llite_close.c
@@ -301,7 +301,7 @@ static void ll_done_writing(struct inode *inode)
CERROR("inode %lu mdc done_writing failed: rc = %d\n",
   inode->i_ino, rc);
 out:
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (och) {
md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och);
kfree(och);
-- 
2.1.0

--
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 8/9] Staging: lustre: llite_lib: Remove wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function ll_finish_md_op_data() and replace all its calls
with the standrd function ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4a8c759..143be87 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1355,7 +1355,7 @@ out:
if (!rc)
rc = rc1;
}
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (!S_ISDIR(inode->i_mode)) {
mutex_lock(>i_mutex);
@@ -1732,7 +1732,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 
op_data->op_valid = OBD_MD_FLFLAGS;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu\n", rc, inode->i_ino);
return -abs(rc);
@@ -1763,7 +1763,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
rc = md_setattr(sbi->ll_md_exp, op_data,
NULL, 0, NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc)
return rc;
@@ -1934,7 +1934,7 @@ void ll_open_cleanup(struct super_block *sb, struct 
ptlrpc_request *open_req)
op_data->op_mod_time = get_seconds();
md_close(exp, op_data, NULL, _req);
ptlrpc_req_finished(close_req);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 }
 
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
@@ -2170,11 +2170,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
return op_data;
 }
 
-void ll_finish_md_op_data(struct md_op_data *op_data)
-{
-   kfree(op_data);
-}
-
 int ll_show_options(struct seq_file *seq, struct dentry *dentry)
 {
struct ll_sb_info *sbi;
-- 
2.1.0

--
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 6/9] Staging: lustre: llite_nfs: Replace with standard function

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/llite_nfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index e578a11..a3a89a7 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -306,7 +306,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
return (void *)op_data;
 
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino);
return ERR_PTR(rc);
-- 
2.1.0

--
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 5/9] Staging: lustre: symlink: Substitute standard function

2015-11-06 Thread Shivani Bhardwaj
Substitute the standard function kfree() for the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/symlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/symlink.c 
b/drivers/staging/lustre/lustre/llite/symlink.c
index 69b2036..6b0d1cc 100644
--- a/drivers/staging/lustre/lustre/llite/symlink.c
+++ b/drivers/staging/lustre/lustre/llite/symlink.c
@@ -73,7 +73,7 @@ static int ll_readlink_internal(struct inode *inode,
 
op_data->op_valid = OBD_MD_LINKNAME;
rc = md_getattr(sbi->ll_md_exp, op_data, request);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
if (rc != -ENOENT)
CERROR("inode %lu: rc = %d\n", inode->i_ino, rc);
-- 
2.1.0

--
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 4/9] Staging: lustre: xattr_cache: Change function calls

2015-11-06 Thread Shivani Bhardwaj
Change the calls of the function ll_finish_md_op_data() to the standard
function kfree().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/xattr_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c 
b/drivers/staging/lustre/lustre/llite/xattr_cache.c
index e1e599c..b7f3efc 100644
--- a/drivers/staging/lustre/lustre/llite/xattr_cache.c
+++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c
@@ -306,7 +306,7 @@ static int ll_xattr_find_get_lock(struct inode *inode,
op_data->op_valid = OBD_MD_FLXATTR | OBD_MD_FLXATTRLS;
 
rc = md_enqueue(exp, , oit, op_data, , NULL, 0, NULL, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (rc < 0) {
CDEBUG(D_CACHE,
-- 
2.1.0

--
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 3/9] Staging: lustre: namei: Replace calls with kfree

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with thr
stndard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/namei.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 2ca2200..f058ebe2 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -531,7 +531,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, 
struct dentry *dentry,
 
rc = md_intent_lock(ll_i2mdexp(parent), op_data, NULL, 0, it,
lookup_flags, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
retval = ERR_PTR(rc);
goto out;
@@ -786,7 +786,7 @@ static int ll_new_node(struct inode *dir, struct dentry 
*dentry,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), rdev, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 
@@ -961,7 +961,7 @@ static int ll_unlink(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc)
goto out;
 
@@ -1011,7 +1011,7 @@ static int ll_rmdir(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == 0) {
ll_update_times(request, dir);
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1);
@@ -1060,7 +1060,7 @@ static int ll_link(struct dentry *old_dentry, struct 
inode *dir,
return PTR_ERR(op_data);
 
err = md_link(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto out;
 
@@ -1096,7 +1096,7 @@ static int ll_rename(struct inode *old_dir, struct dentry 
*old_dentry,
old_dentry->d_name.len,
new_dentry->d_name.name,
new_dentry->d_name.len, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (!err) {
ll_update_times(request, old_dir);
ll_update_times(request, new_dir);
-- 
2.1.0

--
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 2/9] Staging: lustre: file: Replace function calls with standard function

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/file.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 02f2759..186b5af 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -202,7 +202,7 @@ static int ll_close_inode_openhandle(struct obd_export 
*md_exp,
rc = -EBUSY;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 out:
if (exp_connect_som(exp) && !epoch_close &&
@@ -420,7 +420,7 @@ static int ll_intent_file_open(struct dentry *dentry, void 
*lmm,
itp->it_flags |= MDS_OPEN_BY_FID;
rc = md_intent_lock(sbi->ll_md_exp, op_data, lmm, lmmsize, itp,
0 /*unused */, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == -ESTALE) {
/* reason for keep own exit path - don`t flood log
* with messages with -ESTALE errors.
@@ -819,7 +819,7 @@ ll_lease_open(struct inode *inode, struct file *file, 
fmode_t fmode,
 * open in ll_md_blocking_ast(). Otherwise as ll_md_blocking_lease_ast
 * doesn't deal with openhandle, so normal openhandle will be leaked. */
LDLM_FL_NO_LRU | LDLM_FL_EXCL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc < 0)
goto out_release_it;
@@ -1393,7 +1393,7 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const 
char *filename,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name failed on %s: rc %d\n",
   filename, rc);
@@ -2056,7 +2056,7 @@ static int ll_swap_layouts(struct file *file1, struct 
file *file2,
 
rc = obd_iocontrol(LL_IOC_LOV_SWAP_LAYOUTS, ll_i2mdexp(llss->inode1),
   sizeof(*op_data), op_data, NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 putgl:
if (gid != 0) {
@@ -2131,7 +2131,7 @@ static int ll_hsm_state_set(struct inode *inode, struct 
hsm_state_set *hss)
rc = obd_iocontrol(LL_IOC_HSM_STATE_SET, ll_i2mdexp(inode),
   sizeof(*op_data), op_data, NULL);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((void *)arg, hus, sizeof(*hus)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hus);
return rc;
}
@@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((char *)arg, hca, sizeof(*hca)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hca);
return rc;
}
@@ -2761,7 +2761,7 @@ ll_file_flock(struct file *file, int cmd, struct 
file_lock *file_lock)
rc = rc2;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2896,7 +2896,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
   based lookup */
, 0, ,
ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
oit.it_create_mode &= ~M_CHECK_STALE;
if (rc < 0) {
rc = ll_inode_revalidate_fini(inode, rc);
@@ -2938,7 +2938,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
 
op_data->op_valid = valid;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
rc = ll_inode_revalidate_fini(inode, rc);
return rc;
@@ -3533,7 +3533,7 @@ again:
ptlrpc_req_finished(it.d.lustre.it_data);
it.d.lustre.it_data = NULL;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
mode = it.d.lustre.it_lock_mode;
it.d.lustre.it_lock_mode = 0;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ma

[PATCH 1/9] Staging: lustre: dir: Replace function calls

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/dir.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index 5c2ef92..ba3f469 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -182,7 +182,7 @@ static int ll_dir_filler(void *_hash, struct page *page0)
op_data->op_npages = npages;
op_data->op_offset = hash;
rc = md_readpage(exp, op_data, page_pool, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
/* page0 is special, which was added into page cache early */
delete_from_page_cache(page0);
@@ -363,7 +363,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
rc = md_enqueue(ll_i2sbi(dir)->ll_md_exp, , ,
op_data, , NULL, 0, NULL, 0);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
request = (struct ptlrpc_request *)it.d.lustre.it_data;
if (request)
@@ -669,7 +669,7 @@ static int ll_dir_setdirstripe(struct inode *dir, struct 
lmv_user_md *lump,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), 0, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 err_exit:
@@ -730,7 +730,7 @@ int ll_dir_setstripe(struct inode *inode, struct 
lov_user_md *lump,
/* swabbing is done in lov_setstripe() on server side */
rc = md_setattr(sbi->ll_md_exp, op_data, lump, lum_size,
NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc) {
if (rc != -EPERM && rc != -EACCES)
@@ -802,7 +802,7 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md 
**lmmp,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr failed on inode %lu/%u: rc %d\n",
   inode->i_ino,
@@ -868,7 +868,7 @@ int ll_get_mdt_idx(struct inode *inode)
op_data->op_flags |= MF_GET_MDT_IDX;
rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
mdtidx = op_data->op_mds;
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
return rc;
@@ -1301,7 +1301,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 
op_data->op_valid = OBD_MD_FLID;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
goto out_free;
-- 
2.1.0

--
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 0/9] Remove wrapper function and tidy up the code

2015-11-06 Thread Shivani Bhardwaj
This patchset removes an unnecessary wrapper function and replaces all
its calls in different files with the standard function that it wrapped.
Also, one patch removes its prototype.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (9):
  Staging: lustre: dir: Replace function calls
  Staging: lustre: file: Replace function calls with standard function
  Staging: lustre: namei: Replace calls with kfree
  Staging: lustre: xattr_cache: Change function calls
  Staging: lustre: symlink: Substitute standard function
  Staging: lustre: llite_nfs: Replace with standard function
  Staging: lustre: llite_close: Substitute function calls
  Staging: lustre: llite_lib: Remove wrapper function
  Staging: lustre: llite_internal: Remove function prototype

 drivers/staging/lustre/lustre/llite/dir.c  | 14 ++---
 drivers/staging/lustre/lustre/llite/file.c | 24 +++---
 drivers/staging/lustre/lustre/llite/llite_close.c  |  2 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  1 -
 drivers/staging/lustre/lustre/llite/llite_lib.c| 13 
 drivers/staging/lustre/lustre/llite/llite_nfs.c|  2 +-
 drivers/staging/lustre/lustre/llite/namei.c| 12 +--
 drivers/staging/lustre/lustre/llite/symlink.c  |  2 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  2 +-
 9 files changed, 33 insertions(+), 39 deletions(-)

-- 
2.1.0

--
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 3/3] Staging: lustre: ldlm_pool: Drop unneeded wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function ldlm_pool_set_limit() and replace its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 20cf389..e59b286 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -208,14 +208,6 @@ static inline int ldlm_pool_t2gsp(unsigned int t)
 }
 
 /**
- * Sets passed \a limit to \a pl.
- */
-static void ldlm_pool_set_limit(struct ldlm_pool *pl, __u32 limit)
-{
-   atomic_set(>pl_limit, limit);
-}
-
-/**
  * Recalculates next stats on passed \a pl.
  *
  * \pre ->pl_lock is locked.
@@ -257,7 +249,7 @@ static void ldlm_cli_pool_pop_slv(struct ldlm_pool *pl)
LASSERT(obd != NULL);
read_lock(>obd_pool_lock);
pl->pl_server_lock_volume = obd->obd_pool_slv;
-   ldlm_pool_set_limit(pl, obd->obd_pool_limit);
+   atomic_set(>pl_limit, obd->obd_pool_limit);
read_unlock(>obd_pool_lock);
 }
 
@@ -678,7 +670,7 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct 
ldlm_namespace *ns,
snprintf(pl->pl_name, sizeof(pl->pl_name), "ldlm-pool-%s-%d",
 ldlm_ns_name(ns), idx);
 
-   ldlm_pool_set_limit(pl, 1);
+   atomic_set(>pl_limit, 1);
pl->pl_server_lock_volume = 0;
pl->pl_ops = _cli_pool_ops;
pl->pl_recalc_period = LDLM_POOL_CLI_DEF_RECALC_PERIOD;
-- 
2.1.0

--
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 2/3] Staging: lustre: ldlm_pool: Drop wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function ldlm_pool_get_limit() and replace its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 2beb36b..20cf389 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -208,14 +208,6 @@ static inline int ldlm_pool_t2gsp(unsigned int t)
 }
 
 /**
- * Returns current \a pl limit.
- */
-static __u32 ldlm_pool_get_limit(struct ldlm_pool *pl)
-{
-   return atomic_read(>pl_limit);
-}
-
-/**
  * Sets passed \a limit to \a pl.
  */
 static void ldlm_pool_set_limit(struct ldlm_pool *pl, __u32 limit)
@@ -452,7 +444,7 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, 
void *unused)
spin_lock(>pl_lock);
slv = pl->pl_server_lock_volume;
clv = pl->pl_client_lock_volume;
-   limit = ldlm_pool_get_limit(pl);
+   limit = atomic_read(>pl_limit);
granted = atomic_read(>pl_granted);
grant_rate = atomic_read(>pl_grant_rate);
cancel_rate = atomic_read(>pl_cancel_rate);
-- 
2.1.0

--
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 1/3] Staging: lustre: ldlm_pool: Remove unneeded wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function ldlm_pl2ns() and replace its calls with the function
it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 1a4eef6..2beb36b 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -176,11 +176,6 @@ enum {
LDLM_POOL_LAST_STAT
 };
 
-static inline struct ldlm_namespace *ldlm_pl2ns(struct ldlm_pool *pl)
-{
-   return container_of(pl, struct ldlm_namespace, ns_pool);
-}
-
 /**
  * Calculates suggested grant_step in % of available locks for passed
  * \a period. This is later used in grant_plan calculations.
@@ -254,7 +249,8 @@ static void ldlm_pool_recalc_stats(struct ldlm_pool *pl)
 }
 
 /**
- * Sets SLV and Limit from ldlm_pl2ns(pl)->ns_obd tp passed \a pl.
+ * Sets SLV and Limit from container_of(pl, struct ldlm_namespace,
+ * ns_pool)->ns_obd tp passed \a pl.
  */
 static void ldlm_cli_pool_pop_slv(struct ldlm_pool *pl)
 {
@@ -264,7 +260,8 @@ static void ldlm_cli_pool_pop_slv(struct ldlm_pool *pl)
 * Get new SLV and Limit from obd which is updated with coming
 * RPCs.
 */
-   obd = ldlm_pl2ns(pl)->ns_obd;
+   obd = container_of(pl, struct ldlm_namespace,
+  ns_pool)->ns_obd;
LASSERT(obd != NULL);
read_lock(>obd_pool_lock);
pl->pl_server_lock_volume = obd->obd_pool_slv;
@@ -304,7 +301,8 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
/*
 * Do not cancel locks in case lru resize is disabled for this ns.
 */
-   if (!ns_connect_lru_resize(ldlm_pl2ns(pl))) {
+   if (!ns_connect_lru_resize(container_of(pl, struct ldlm_namespace,
+   ns_pool))) {
ret = 0;
goto out;
}
@@ -315,7 +313,8 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
 * It may be called when SLV has changed much, this is why we do not
 * take into account pl->pl_recalc_time here.
 */
-   ret = ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC, LDLM_CANCEL_LRUR);
+   ret = ldlm_cancel_lru(container_of(pl, struct ldlm_namespace, ns_pool),
+ 0, LCF_ASYNC, LDLM_CANCEL_LRUR);
 
 out:
spin_lock(>pl_lock);
@@ -341,7 +340,7 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl,
struct ldlm_namespace *ns;
int unused;
 
-   ns = ldlm_pl2ns(pl);
+   ns = container_of(pl, struct ldlm_namespace, ns_pool);
 
/*
 * Do not cancel locks in case lru resize is disabled for this ns.
@@ -558,7 +557,8 @@ static struct kobj_type ldlm_pl_ktype = {
 
 static int ldlm_pool_sysfs_init(struct ldlm_pool *pl)
 {
-   struct ldlm_namespace *ns = ldlm_pl2ns(pl);
+   struct ldlm_namespace *ns = container_of(pl, struct ldlm_namespace,
+ns_pool);
int err;
 
init_completion(>pl_kobj_unregister);
@@ -570,7 +570,8 @@ static int ldlm_pool_sysfs_init(struct ldlm_pool *pl)
 
 static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
 {
-   struct ldlm_namespace *ns = ldlm_pl2ns(pl);
+   struct ldlm_namespace *ns = container_of(pl, struct ldlm_namespace,
+ns_pool);
struct dentry *debugfs_ns_parent;
struct lprocfs_vars pool_vars[2];
char *var_name = NULL;
-- 
2.1.0

--
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 0/3] Remove wrapper functions from ldlm_pool

2015-11-06 Thread Shivani Bhardwaj
This patchset removes different wrapper functions from the file ldlm_pool
and replaces their calls with the function they wrapped.
After applying this patchset, code becomes cleaner.

Shivani Bhardwaj (3):
  Staging: lustre: ldlm_pool: Remove unneeded wrapper function
  Staging: lustre: ldlm_pool: Drop wrapper function
  Staging: lustre: ldlm_pool: Drop unneeded wrapper function

 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 47 +-
 1 file changed, 16 insertions(+), 31 deletions(-)

-- 
2.1.0

--
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 2/3] Staging: lustre: tracefile: Remove wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function cfs_trace_free_string_buffer() as it can be replaced
with the standard function kfree().

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/libcfs/tracefile.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c 
b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index d55dda8..211047f 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -817,11 +817,6 @@ int cfs_trace_allocate_string_buffer(char **str, int nob)
return 0;
 }
 
-void cfs_trace_free_string_buffer(char *str, int nob)
-{
-   kfree(str);
-}
-
 int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob)
 {
char *str;
@@ -842,7 +837,7 @@ int cfs_trace_dump_debug_buffer_usrstr(void __user 
*usr_str, int usr_str_nob)
}
rc = cfs_tracefile_dump_all_pages(str);
 out:
-   cfs_trace_free_string_buffer(str, usr_str_nob + 1);
+   kfree(str);
return rc;
 }
 
@@ -898,7 +893,7 @@ int cfs_trace_daemon_command_usrstr(void __user *usr_str, 
int usr_str_nob)
if (rc == 0)
rc = cfs_trace_daemon_command(str);
 
-   cfs_trace_free_string_buffer(str, usr_str_nob + 1);
+   kfree(str);
return rc;
 }
 
-- 
2.1.0

--
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 3/3] Staging: lustre: tracefile: Remove function prototype

2015-11-06 Thread Shivani Bhardwaj
Remove the prototype of function cfs_trace_free_string_buffer() as it is
no longer needed.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h 
b/drivers/staging/lustre/lustre/libcfs/tracefile.h
index 73d60e0..ba62005 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
@@ -70,7 +70,6 @@ int cfs_trace_copyin_string(char *knl_buffer, int 
knl_buffer_nob,
 int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob,
 const char *knl_str, char *append);
 int cfs_trace_allocate_string_buffer(char **str, int nob);
-void cfs_trace_free_string_buffer(char *str, int nob);
 int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob);
 int cfs_trace_daemon_command(char *str);
 int cfs_trace_daemon_command_usrstr(void __user *usr_str, int usr_str_nob);
-- 
2.1.0

--
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 1/3] Staging: lustre: module: Replace function calls

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of function cfs_trace_free_string_buffer() with
kfree() as the former function is not required.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/libcfs/module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 50e8fd2..516a9e7 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -392,7 +392,7 @@ static int __proc_dobitmasks(void *data, int write,
} else {
rc = cfs_trace_copyin_string(tmpstr, tmpstrlen, buffer, nob);
if (rc < 0) {
-   cfs_trace_free_string_buffer(tmpstr, tmpstrlen);
+   kfree(tmpstr);
return rc;
}
 
@@ -402,7 +402,7 @@ static int __proc_dobitmasks(void *data, int write,
*mask |= D_EMERG;
}
 
-   cfs_trace_free_string_buffer(tmpstr, tmpstrlen);
+   kfree(tmpstr);
return rc;
 }
 
-- 
2.1.0

--
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 0/3] Remove wrapper function and clean up the code

2015-11-06 Thread Shivani Bhardwaj
This patchset removes a wrapper function, its prototype and replace its calls
in different files with a standard function.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (3):
  Staging: lustre: module: Replace function calls
  Staging: lustre: tracefile: Remove wrapper function
  Staging: lustre: tracefile: Remove function prototype

 drivers/staging/lustre/lustre/libcfs/module.c| 4 ++--
 drivers/staging/lustre/lustre/libcfs/tracefile.c | 9 ++---
 drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 -
 3 files changed, 4 insertions(+), 10 deletions(-)

-- 
2.1.0

--
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] Staging: lustre: dir: Remove wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function ll_check_page() and replace all its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/llite/dir.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index 5c9502b..842e6d6 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -239,12 +239,6 @@ static int ll_dir_filler(void *_hash, struct page *page0)
return rc;
 }
 
-static void ll_check_page(struct inode *dir, struct page *page)
-{
-   /* XXX: check page format later */
-   SetPageChecked(page);
-}
-
 void ll_release_page(struct page *page, int remove)
 {
kunmap(page);
@@ -432,7 +426,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
goto fail;
}
if (!PageChecked(page))
-   ll_check_page(dir, page);
+   /* XXX: check page format later */
+   SetPageChecked(page);
if (PageError(page)) {
CERROR("page error: "DFID" at %llu: rc %d\n",
   PFID(ll_inode2fid(dir)), hash, -5);
-- 
2.1.0

--
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 3/3] Staging: lustre: tracefile: Remove function prototype

2015-11-06 Thread Shivani Bhardwaj
On Sat, Nov 7, 2015 at 1:02 PM, Dilger, Andreas
<andreas.dil...@intel.com> wrote:
> On 2015/11/06, 10:19, "Shivani Bhardwaj" <shivanib...@gmail.com> wrote:
>
>>Remove the prototype of function cfs_trace_free_string_buffer() as it is
>>no longer needed.
>
> These patches would be a lot more useful if the summary contained the name
> of the function being removed, rather than "remove function prototype" and
> variations of that.  Something like:
>
>staging: lustre: remove cfs_trace_free_string_buffer prototype
>staging: lustre: remove ldlm_pool_set_limit wrapper
>staging: lustre: remove ldlm_pool_get_limit wrapper
>
> Not sure if that is grounds for rejection of this patch series (I'll leave
> that up to Dan and Greg), but definitely something for future patches.
>
> Cheers, Andreas
>

I'll definitely take care of this for future patches that I submit.

Thank you
Shivani

>>Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
>>---
>> drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 -
>> 1 file changed, 1 deletion(-)
>>
>>diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>b/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>index 73d60e0..ba62005 100644
>>--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
>>@@ -70,7 +70,6 @@ int cfs_trace_copyin_string(char *knl_buffer, int
>>knl_buffer_nob,
>> int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob,
>>const char *knl_str, char *append);
>> int cfs_trace_allocate_string_buffer(char **str, int nob);
>>-void cfs_trace_free_string_buffer(char *str, int nob);
>> int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int
>>usr_str_nob);
>> int cfs_trace_daemon_command(char *str);
>> int cfs_trace_daemon_command_usrstr(void __user *usr_str, int
>>usr_str_nob);
>>--
>>2.1.0
>>
>>
>
>
> Cheers, Andreas
> --
> Andreas Dilger
>
> Lustre Software Architect
> Intel High Performance Data Division
>
>
--
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 0/9] Remove wrapper function and tidy up the code

2015-11-06 Thread Shivani Bhardwaj
This patchset removes an unnecessary wrapper function and replaces all
its calls in different files with the standard function that it wrapped.
Also, one patch removes its prototype.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (9):
  Staging: lustre: dir: Replace function calls
  Staging: lustre: file: Replace function calls with standard function
  Staging: lustre: namei: Replace calls with kfree
  Staging: lustre: xattr_cache: Change function calls
  Staging: lustre: symlink: Substitute standard function
  Staging: lustre: llite_nfs: Replace with standard function
  Staging: lustre: llite_close: Substitute function calls
  Staging: lustre: llite_lib: Remove wrapper function
  Staging: lustre: llite_internal: Remove function prototype

 drivers/staging/lustre/lustre/llite/dir.c  | 14 ++---
 drivers/staging/lustre/lustre/llite/file.c | 24 +++---
 drivers/staging/lustre/lustre/llite/llite_close.c  |  2 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  1 -
 drivers/staging/lustre/lustre/llite/llite_lib.c| 13 
 drivers/staging/lustre/lustre/llite/llite_nfs.c|  2 +-
 drivers/staging/lustre/lustre/llite/namei.c| 12 +--
 drivers/staging/lustre/lustre/llite/symlink.c  |  2 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  2 +-
 9 files changed, 33 insertions(+), 39 deletions(-)

-- 
2.1.0

--
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 1/9] Staging: lustre: dir: Replace function calls

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/dir.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index 5c2ef92..ba3f469 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -182,7 +182,7 @@ static int ll_dir_filler(void *_hash, struct page *page0)
op_data->op_npages = npages;
op_data->op_offset = hash;
rc = md_readpage(exp, op_data, page_pool, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
/* page0 is special, which was added into page cache early */
delete_from_page_cache(page0);
@@ -363,7 +363,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
rc = md_enqueue(ll_i2sbi(dir)->ll_md_exp, , ,
op_data, , NULL, 0, NULL, 0);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
request = (struct ptlrpc_request *)it.d.lustre.it_data;
if (request)
@@ -669,7 +669,7 @@ static int ll_dir_setdirstripe(struct inode *dir, struct 
lmv_user_md *lump,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), 0, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 err_exit:
@@ -730,7 +730,7 @@ int ll_dir_setstripe(struct inode *inode, struct 
lov_user_md *lump,
/* swabbing is done in lov_setstripe() on server side */
rc = md_setattr(sbi->ll_md_exp, op_data, lump, lum_size,
NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc) {
if (rc != -EPERM && rc != -EACCES)
@@ -802,7 +802,7 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md 
**lmmp,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr failed on inode %lu/%u: rc %d\n",
   inode->i_ino,
@@ -868,7 +868,7 @@ int ll_get_mdt_idx(struct inode *inode)
op_data->op_flags |= MF_GET_MDT_IDX;
rc = md_getattr(sbi->ll_md_exp, op_data, NULL);
mdtidx = op_data->op_mds;
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
return rc;
@@ -1301,7 +1301,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 
op_data->op_valid = OBD_MD_FLID;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name: %d\n", rc);
goto out_free;
-- 
2.1.0

--
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 2/9] Staging: lustre: file: Replace function calls with standard function

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/file.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 02f2759..186b5af 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -202,7 +202,7 @@ static int ll_close_inode_openhandle(struct obd_export 
*md_exp,
rc = -EBUSY;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 out:
if (exp_connect_som(exp) && !epoch_close &&
@@ -420,7 +420,7 @@ static int ll_intent_file_open(struct dentry *dentry, void 
*lmm,
itp->it_flags |= MDS_OPEN_BY_FID;
rc = md_intent_lock(sbi->ll_md_exp, op_data, lmm, lmmsize, itp,
0 /*unused */, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == -ESTALE) {
/* reason for keep own exit path - don`t flood log
* with messages with -ESTALE errors.
@@ -819,7 +819,7 @@ ll_lease_open(struct inode *inode, struct file *file, 
fmode_t fmode,
 * open in ll_md_blocking_ast(). Otherwise as ll_md_blocking_lease_ast
 * doesn't deal with openhandle, so normal openhandle will be leaked. */
LDLM_FL_NO_LRU | LDLM_FL_EXCL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc < 0)
goto out_release_it;
@@ -1393,7 +1393,7 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const 
char *filename,
 
op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
CDEBUG(D_INFO, "md_getattr_name failed on %s: rc %d\n",
   filename, rc);
@@ -2056,7 +2056,7 @@ static int ll_swap_layouts(struct file *file1, struct 
file *file2,
 
rc = obd_iocontrol(LL_IOC_LOV_SWAP_LAYOUTS, ll_i2mdexp(llss->inode1),
   sizeof(*op_data), op_data, NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
 putgl:
if (gid != 0) {
@@ -2131,7 +2131,7 @@ static int ll_hsm_state_set(struct inode *inode, struct 
hsm_state_set *hss)
rc = obd_iocontrol(LL_IOC_HSM_STATE_SET, ll_i2mdexp(inode),
   sizeof(*op_data), op_data, NULL);
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((void *)arg, hus, sizeof(*hus)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hus);
return rc;
}
@@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
if (copy_to_user((char *)arg, hca, sizeof(*hca)))
rc = -EFAULT;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
kfree(hca);
return rc;
}
@@ -2761,7 +2761,7 @@ ll_file_flock(struct file *file, int cmd, struct 
file_lock *file_lock)
rc = rc2;
}
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
return rc;
 }
@@ -2896,7 +2896,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
   based lookup */
, 0, ,
ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
oit.it_create_mode &= ~M_CHECK_STALE;
if (rc < 0) {
rc = ll_inode_revalidate_fini(inode, rc);
@@ -2938,7 +2938,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
 
op_data->op_valid = valid;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
rc = ll_inode_revalidate_fini(inode, rc);
return rc;
@@ -3533,7 +3533,7 @@ again:
ptlrpc_req_finished(it.d.lustre.it_data);
it.d.lustre.it_data = NULL;
 
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
mode = it.d.lustre.it_lock_mode;
it.d.lustre.it_lock_mode = 0;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the

[PATCH 3/9] Staging: lustre: namei: Replace calls with kfree

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with thr
stndard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/namei.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 2ca2200..f058ebe2 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -531,7 +531,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, 
struct dentry *dentry,
 
rc = md_intent_lock(ll_i2mdexp(parent), op_data, NULL, 0, it,
lookup_flags, , ll_md_blocking_ast, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc < 0) {
retval = ERR_PTR(rc);
goto out;
@@ -786,7 +786,7 @@ static int ll_new_node(struct inode *dir, struct dentry 
*dentry,
from_kuid(_user_ns, current_fsuid()),
from_kgid(_user_ns, current_fsgid()),
cfs_curproc_cap_pack(), rdev, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto err_exit;
 
@@ -961,7 +961,7 @@ static int ll_unlink(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc)
goto out;
 
@@ -1011,7 +1011,7 @@ static int ll_rmdir(struct inode *dir, struct dentry 
*dentry)
ll_get_child_fid(dentry, _data->op_fid3);
op_data->op_fid2 = op_data->op_fid3;
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc == 0) {
ll_update_times(request, dir);
ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1);
@@ -1060,7 +1060,7 @@ static int ll_link(struct dentry *old_dentry, struct 
inode *dir,
return PTR_ERR(op_data);
 
err = md_link(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (err)
goto out;
 
@@ -1096,7 +1096,7 @@ static int ll_rename(struct inode *old_dir, struct dentry 
*old_dentry,
old_dentry->d_name.len,
new_dentry->d_name.name,
new_dentry->d_name.len, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (!err) {
ll_update_times(request, old_dir);
ll_update_times(request, new_dir);
-- 
2.1.0

--
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 4/9] Staging: lustre: xattr_cache: Change function calls

2015-11-06 Thread Shivani Bhardwaj
Change the calls of the function ll_finish_md_op_data() to the standard
function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/xattr_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c 
b/drivers/staging/lustre/lustre/llite/xattr_cache.c
index e1e599c..b7f3efc 100644
--- a/drivers/staging/lustre/lustre/llite/xattr_cache.c
+++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c
@@ -306,7 +306,7 @@ static int ll_xattr_find_get_lock(struct inode *inode,
op_data->op_valid = OBD_MD_FLXATTR | OBD_MD_FLXATTRLS;
 
rc = md_enqueue(exp, , oit, op_data, , NULL, 0, NULL, 0);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (rc < 0) {
CDEBUG(D_CACHE,
-- 
2.1.0

--
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 6/9] Staging: lustre: llite_nfs: Replace with standard function

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of the function ll_finish_md_op_data() with the
standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_nfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index e578a11..a3a89a7 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -306,7 +306,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
return (void *)op_data;
 
rc = md_getattr_name(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino);
return ERR_PTR(rc);
-- 
2.1.0

--
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 5/9] Staging: lustre: symlink: Substitute standard function

2015-11-06 Thread Shivani Bhardwaj
Substitute the standard function kfree() for the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/symlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/symlink.c 
b/drivers/staging/lustre/lustre/llite/symlink.c
index 69b2036..6b0d1cc 100644
--- a/drivers/staging/lustre/lustre/llite/symlink.c
+++ b/drivers/staging/lustre/lustre/llite/symlink.c
@@ -73,7 +73,7 @@ static int ll_readlink_internal(struct inode *inode,
 
op_data->op_valid = OBD_MD_LINKNAME;
rc = md_getattr(sbi->ll_md_exp, op_data, request);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
if (rc != -ENOENT)
CERROR("inode %lu: rc = %d\n", inode->i_ino, rc);
-- 
2.1.0

--
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 7/9] Staging: lustre: llite_close: Substitute function calls

2015-11-06 Thread Shivani Bhardwaj
Substitute standard function kfree() in place of the function
ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_close.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_close.c 
b/drivers/staging/lustre/lustre/llite/llite_close.c
index 3f348a3..c4f22ec 100644
--- a/drivers/staging/lustre/lustre/llite/llite_close.c
+++ b/drivers/staging/lustre/lustre/llite/llite_close.c
@@ -301,7 +301,7 @@ static void ll_done_writing(struct inode *inode)
CERROR("inode %lu mdc done_writing failed: rc = %d\n",
   inode->i_ino, rc);
 out:
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (och) {
md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och);
kfree(och);
-- 
2.1.0

--
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 8/9] Staging: lustre: llite_lib: Remove wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function ll_finish_md_op_data() and replace all its calls
with the standrd function ll_finish_md_op_data().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4a8c759..143be87 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1355,7 +1355,7 @@ out:
if (!rc)
rc = rc1;
}
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 
if (!S_ISDIR(inode->i_mode)) {
mutex_lock(>i_mutex);
@@ -1732,7 +1732,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 
op_data->op_valid = OBD_MD_FLFLAGS;
rc = md_getattr(sbi->ll_md_exp, op_data, );
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
if (rc) {
CERROR("failure %d inode %lu\n", rc, inode->i_ino);
return -abs(rc);
@@ -1763,7 +1763,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG;
rc = md_setattr(sbi->ll_md_exp, op_data,
NULL, 0, NULL, 0, , NULL);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
ptlrpc_req_finished(req);
if (rc)
return rc;
@@ -1934,7 +1934,7 @@ void ll_open_cleanup(struct super_block *sb, struct 
ptlrpc_request *open_req)
op_data->op_mod_time = get_seconds();
md_close(exp, op_data, NULL, _req);
ptlrpc_req_finished(close_req);
-   ll_finish_md_op_data(op_data);
+   kfree(op_data);
 }
 
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
@@ -2170,11 +2170,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
return op_data;
 }
 
-void ll_finish_md_op_data(struct md_op_data *op_data)
-{
-   kfree(op_data);
-}
-
 int ll_show_options(struct seq_file *seq, struct dentry *dentry)
 {
struct ll_sb_info *sbi;
-- 
2.1.0

--
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 9/9] Staging: lustre: llite_internal: Remove function prototype

2015-11-06 Thread Shivani Bhardwaj
Remove the prototype of the function ll_finish_md_op_data() as it is no
longer needed.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 157c3284..d12d483 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -792,7 +792,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data 
*op_data,
  struct inode *i1, struct inode *i2,
  const char *name, int namelen,
  int mode, __u32 opc, void *data);
-void ll_finish_md_op_data(struct md_op_data *op_data);
 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
 void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req);
-- 
2.1.0

--
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 2/3] Staging: lustre: tracefile: Remove wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function cfs_trace_free_string_buffer() as it can be replaced
with the standard function kfree().

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/tracefile.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c 
b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index d55dda8..211047f 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -817,11 +817,6 @@ int cfs_trace_allocate_string_buffer(char **str, int nob)
return 0;
 }
 
-void cfs_trace_free_string_buffer(char *str, int nob)
-{
-   kfree(str);
-}
-
 int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob)
 {
char *str;
@@ -842,7 +837,7 @@ int cfs_trace_dump_debug_buffer_usrstr(void __user 
*usr_str, int usr_str_nob)
}
rc = cfs_tracefile_dump_all_pages(str);
 out:
-   cfs_trace_free_string_buffer(str, usr_str_nob + 1);
+   kfree(str);
return rc;
 }
 
@@ -898,7 +893,7 @@ int cfs_trace_daemon_command_usrstr(void __user *usr_str, 
int usr_str_nob)
if (rc == 0)
rc = cfs_trace_daemon_command(str);
 
-   cfs_trace_free_string_buffer(str, usr_str_nob + 1);
+   kfree(str);
return rc;
 }
 
-- 
2.1.0

--
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] Staging: lustre: dir: Remove wrapper function

2015-11-06 Thread Shivani Bhardwaj
Remove the function ll_check_page() and replace all its calls with the
function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/llite/dir.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index 5c9502b..842e6d6 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -239,12 +239,6 @@ static int ll_dir_filler(void *_hash, struct page *page0)
return rc;
 }
 
-static void ll_check_page(struct inode *dir, struct page *page)
-{
-   /* XXX: check page format later */
-   SetPageChecked(page);
-}
-
 void ll_release_page(struct page *page, int remove)
 {
kunmap(page);
@@ -432,7 +426,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
goto fail;
}
if (!PageChecked(page))
-   ll_check_page(dir, page);
+   /* XXX: check page format later */
+   SetPageChecked(page);
if (PageError(page)) {
CERROR("page error: "DFID" at %llu: rc %d\n",
   PFID(ll_inode2fid(dir)), hash, -5);
-- 
2.1.0

--
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 1/3] Staging: lustre: module: Replace function calls

2015-11-06 Thread Shivani Bhardwaj
Replace the calls of function cfs_trace_free_string_buffer() with
kfree() as the former function is not required.

Signed-off-by: Shivani Bhardwaj <shivanib...@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 50e8fd2..516a9e7 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -392,7 +392,7 @@ static int __proc_dobitmasks(void *data, int write,
} else {
rc = cfs_trace_copyin_string(tmpstr, tmpstrlen, buffer, nob);
if (rc < 0) {
-   cfs_trace_free_string_buffer(tmpstr, tmpstrlen);
+   kfree(tmpstr);
return rc;
}
 
@@ -402,7 +402,7 @@ static int __proc_dobitmasks(void *data, int write,
*mask |= D_EMERG;
}
 
-   cfs_trace_free_string_buffer(tmpstr, tmpstrlen);
+   kfree(tmpstr);
return rc;
 }
 
-- 
2.1.0

--
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/


  1   2   >