Re: [PATCH v3] staging: lustre: libcfs: Remove new typedef in bitmap.h

2013-10-20 Thread Greg KH
On Sat, Oct 19, 2013 at 04:15:25PM -0700, Lisa Nguyen wrote:
 On Sat, Oct 19, 2013 at 2:39 PM, Dan Carpenter dan.carpen...@oracle.com 
 wrote:
  Your patch is great, but actually, are any of the functions in this
  header used?  `grep cfs_bitmap drivers/staging/lustre/ -Rl` only shows
  this header file.
 
  Perhaps we can delete the whole thing?
 
  regards,
  dan carpenter
 
 Ah, good point. I didn't think about that. I ran your grep command and
 got the same results.
 
 Since that is the case, is there a specific protocol I have to follow
 and suggest for this particular header file to be deleted? It's my
 first time running into this situation.

Just email saying, Ignore this patch, please replace it with this newer
one, or just do a v4 that does this as well.

thanks,

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


Re: [PATCH v2 1/3] imx-drm: Add mx6 hdmi transmitter support

2013-10-20 Thread Russell King - ARM Linux
Another problem.

After performing several modesets, the IPU seems to lock up and produce
no syncs or output data.

I've seen this many times over the last week while testing out various
aspects of imx-drm, and had put it down to problems with the clocking
arrangement getting its settings wrong.  Now that I've sorted all that
though, and I still have the problem, there's something else going on.

What I see is:
- the HDMI clock is running correctly (right frequency and unmodulated)
- the TMDS data lines show signs of there being some data (probably
  control, guard bands and data islands from the frame composer in the
  HDMI interface).  The data lines are definitely lacking image data though.
- reading the various status registers indicates that all FIFOs within
  the IPU are empty.
- the attached TV says that there is no HDMI signal.

One of my tests has been to cycle through all display resolutions from the
smallest width to the largest, leaving each one set for 30 seconds.  This
will occasionally provoke the problem, but obviously is rather slow to do
so.

I tried this with a less demanding test last night as far as a change in
the settings: switching between 720p at 50 and 60Hz.  The clocks for these
two modes are the same at 74.25MHz, and the vertical timing parameters are
identical.  The only timing difference is with the horizontal parameters:

  1280x720 (0x41)   74.2MHz +HSync +VSync +preferred
h: width  1280 start 1390 end 1430 total 1650 skew0 clock   45.0KHz
v: height  720 start  725 end  730 total  750   clock   60.0Hz
  1280x720 (0x4f)   74.2MHz +HSync +VSync
h: width  1280 start 1720 end 1760 total 1980 skew0 clock   37.5KHz
v: height  720 start  725 end  730 total  750   clock   50.0Hz

This dies within a couple of minutes.  I haven't gathered enough
information to tell whether it always dies when switching from 50 - 60Hz
or whether it's any switch.

My test for this is basically:

while :; do
  xrandr -s 1280x720 -r 50
  sleep 5
  xrandr -s 1280x720 -r 60
  sleep 5
done
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [OPW kernel] Re: [PATCH v2] Staging: zram: Fix variable dereferenced before check

2013-10-20 Thread Josh Triplett
On Sat, Oct 19, 2013 at 01:59:05PM -0700, Greg KH wrote:
 On Sat, Oct 19, 2013 at 10:01:42PM +0530, Rashika Kheria wrote:
  This patch fixes the following Smatch warning in zram_drv.c-
  ~/git/kernels/linux/drivers/staging/zram/zram_drv.c:663
  reset_store() warn: variable dereferenced before check 'bdev' (see line 652)
  ~/git/kernels/linux/drivers/staging/zram/zram_drv.c:899
  destroy_device() warn: variable dereferenced before check 'zram-disk' (see 
  line 896)
  
  Signed-off-by: Rashika Kheria rashika.khe...@gmail.com
 
 zram is messy, tricky, and I hate it.  Seriously, I which I had never
 taken it into the staging tree...
 
 Anyway, I want the existing zram developers/maintainers to review this
 patch before I can accept it, as I don't trust anything that is ever
 done in that code, especially as I don't test it :)
 
 Minchan, Jiang, Nitin, what do you think of the patch below?  Can I get
 your ack on it so that I can apply it?

I think you actually want to review v3 of this patch, not v2.

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


Re: [PATCH v3] staging: lustre: libcfs: Remove new typedef in bitmap.h

2013-10-20 Thread Lisa Nguyen
On Sun, Oct 20, 2013 at 12:43 AM, Greg KH gre...@linuxfoundation.org wrote:
 On Sat, Oct 19, 2013 at 04:15:25PM -0700, Lisa Nguyen wrote:
 On Sat, Oct 19, 2013 at 2:39 PM, Dan Carpenter dan.carpen...@oracle.com 
 wrote:
  Your patch is great, but actually, are any of the functions in this
  header used?  `grep cfs_bitmap drivers/staging/lustre/ -Rl` only shows
  this header file.
 
  Perhaps we can delete the whole thing?
 
  regards,
  dan carpenter

 Ah, good point. I didn't think about that. I ran your grep command and
 got the same results.

 Since that is the case, is there a specific protocol I have to follow
 and suggest for this particular header file to be deleted? It's my
 first time running into this situation.

 Just email saying, Ignore this patch, please replace it with this newer
 one, or just do a v4 that does this as well.

 thanks,

 greg k-h

Greg, please ignore this patch as I have submitted a new one to be
applied. The new patch title should say, Remove bitmap.h file.

Dan, thank you for your suggestion.

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


[PATCH] staging: lustre: libcfs: Remove bitmap.h file

2013-10-20 Thread Lisa Nguyen
The functions in the bitmap.h header file are not being used by
any source file in the lustre driver.

Unless there are any objections, please remove the bitmap.h
header file as it contains unused code in the kernel.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 .../staging/lustre/include/linux/libcfs/bitmap.h   | 110 -
 1 file changed, 110 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/bitmap.h 
b/drivers/staging/lustre/include/linux/libcfs/bitmap.h
index f3d4a89..8b13789 100644
--- a/drivers/staging/lustre/include/linux/libcfs/bitmap.h
+++ b/drivers/staging/lustre/include/linux/libcfs/bitmap.h
@@ -1,111 +1 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-#ifndef _LIBCFS_BITMAP_H_
-#define _LIBCFS_BITMAP_H_
 
-
-typedef struct {
-   int  size;
-   unsigned long   data[0];
-} cfs_bitmap_t;
-
-#define CFS_BITMAP_SIZE(nbits) \
- (((nbits/BITS_PER_LONG)+1)*sizeof(long)+sizeof(cfs_bitmap_t))
-
-static inline
-cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
-{
-   cfs_bitmap_t *ptr;
-
-   OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size));
-   if (ptr == NULL)
-   return ptr;
-
-   ptr-size = size;
-
-   return ptr;
-}
-
-#define CFS_FREE_BITMAP(ptr)   OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr-size))
-
-static inline
-void cfs_bitmap_set(cfs_bitmap_t *bitmap, int nbit)
-{
-   set_bit(nbit, bitmap-data);
-}
-
-static inline
-void cfs_bitmap_clear(cfs_bitmap_t *bitmap, int nbit)
-{
-   test_and_clear_bit(nbit, bitmap-data);
-}
-
-static inline
-int cfs_bitmap_check(cfs_bitmap_t *bitmap, int nbit)
-{
-   return test_bit(nbit, bitmap-data);
-}
-
-static inline
-int cfs_bitmap_test_and_clear(cfs_bitmap_t *bitmap, int nbit)
-{
-   return test_and_clear_bit(nbit, bitmap-data);
-}
-
-/* return 0 is bitmap has none set bits */
-static inline
-int cfs_bitmap_check_empty(cfs_bitmap_t *bitmap)
-{
-   return find_first_bit(bitmap-data, bitmap-size) == bitmap-size;
-}
-
-static inline
-void cfs_bitmap_copy(cfs_bitmap_t *new, cfs_bitmap_t *old)
-{
-   int newsize;
-
-   LASSERT(new-size = old-size);
-   newsize = new-size;
-   memcpy(new, old, CFS_BITMAP_SIZE(old-size));
-   new-size = newsize;
-}
-
-#define cfs_foreach_bit(bitmap, pos)   \
-   for ((pos) = find_first_bit((bitmap)-data, bitmap-size);  \
-(pos)  (bitmap)-size;\
-(pos) = find_next_bit((bitmap)-data, (bitmap)-size, (pos) + 1))
-
-#endif
-- 
1.8.1.2

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


Re: [PATCH v2 1/3] imx-drm: Add mx6 hdmi transmitter support

2013-10-20 Thread Russell King - ARM Linux
On Sun, Oct 20, 2013 at 02:00:57PM +0100, Russell King - ARM Linux wrote:
 As for imx-drm, there was a warning which preceded that oops.  Here's the
 full log, below the - marker - this is from unbinding the imx-drm
 module, and then trying to reboot.
 
 imx-drm is really very broken in the way it tries to bend DRM to be
 used in DT - it doesn't consider the lifetime for anything like the
 CRTCs, connectors or encoders.  All these have empty .destroy functions
 to them. If we unbind imx-drm, the top level drm_device tries to be
 destroyed, but it leaves behind all the CRTCs, connectors and encoders,
 causing the first warning because none of the framebuffers got cleaned
 up through that destruction (because the functions did nothing.)
 
 The second one is through trying to clean up the framebuffer, which is
 still in use.
 
 The third one is caused because there's still allocated memory objects
 against the DRM memory manager - again, because nothing has been cleaned
 up.

Right, so how imx-drm works as far as DRM initialization is by a wing
and a prayer at the moment.

It works like this - the driver relies heavily upon this sequence:

- imx_drm_init()
  - creates an imx_drm_device structure to contain references to other
parts.
  - registers the imx-drm platform device and an associated structure.
- the platform device is immediately probed, causing it to be registered
  with the DRM subsystem.
- the DRM subsystem creates the drm_device structure, and calls the
  drivers -load method.
- the driver initialises some basic data, places a pointer to the
  drm_device into the imx_drm_device and returns
- imx_pd_driver_init()
  - registers the imx_pd_driver platform device driver for DT devices
with a compatible string of fsl,imx-parallel-display
  - such devices will be immediately probed
- these allocate an imx_parallel_display structure, which contains
  a drm_connector and drm_encoder structure embedded within.
- these structures are registered into the core of imx_drm, and
  via the imx_drm_device structure, are both attached to the
  drm_device immediately.
- imx_tve_driver_init()
  essentially the same as imx_pd_driver_init()
- imx_ldb_driver_init()
  essentially the same as imx_pd_driver_init()
- imx_ipu_driver_init()
  - registers a platform driver fot DT devices with a compatible string
of fsl,imx51-ipu, fsl,imx53-ipu, or fsl,imx6q-ipu.
  - initialises such devices, and creates two new platform devices
called imx-ipuv3-crtc, one for each display interface.
- ipu_drm_driver_init()
  - registers a platform driver for imx-ipuv3-crtc devices.
- for each device found
  - it allocates a ipu_crtc device structure, which embeds a drm_crtc
structure.
  - it registers a CRTC via imx_drm_add_crtc().
- this allocates an imx_drm_crtc structure, and eventually registers
  the drm_crtc structure against the drm_device
- imx_hdmi_driver_init
  similar to imx_pd_driver_init

All that sequence is in init level 6.  The last bit comes in init level 7
(the late_initcall):

- imx_fb_helper_init()
  - this grabs the drm_device, and calls drm_fbdev_cma_init() on it
hoping that we know the number of CRTCs at this point.  This is
held indefinitely.
  - the resulting drm_fbdev_cma is saved into the imx_drm_device.

Now, if the imx-drm device is unbound from its driver, all hell breaks
loose - none of these crtc/connector/encoder structures have a meaningful
destroy function - their destruction is all in their individual driver
remove functions.  This causes some warnings to be spat out from DRM.

Amongst this is the last_close callback which looks at the imx_drm_device,
sees that drm_fbdev_cma is registered against it, and calls
drm_fbdev_cma_restore_mode() on it.  drm_fbdev_cma contains objects which
store a pointer to the drm_device structure that it was registered against,
which exists at this point, so everything is fine.

The unload proceeds, and eventually the drm_device is freed.

Now, if we rebind the imx-drm device, causing the probe actions above to
be repeated.  imx_drm_device still contains a pointer to the drm_fbdev_cma
object that was allocated...  Let's ignore the fact that none of the
sub-modules have re-initialised anything against this new drm_device.

The real fun comes when you try and unbind it again.  This time, the
drm_device which is being torn down isn't the one in drm_fbdev_cma,
but we still call drm_fbdev_cma_restore_mode().  This tries to get a
mutex on the _original_ drm_device-mode_config.mutex, which has been
freed.  The result is a kernel oops.

Now, several things stand out here: piece-meal construction of a
drm_device in this manner is unsafe:
- it relies heavily on all devices already being present at the time that
  the above sequence starts, and it assumes that the drivers will probe
  immediately, as soon as they are registered.
- the late_initcall() is really a barrier on the 

Re: [PATCH v2 1/3] imx-drm: Add mx6 hdmi transmitter support

2013-10-20 Thread Russell King - ARM Linux
On Sun, Oct 20, 2013 at 05:31:56PM +0100, Russell King - ARM Linux wrote:
 On Sun, Oct 20, 2013 at 02:00:57PM +0100, Russell King - ARM Linux wrote:
  As for imx-drm, there was a warning which preceded that oops.  Here's the
  full log, below the - marker - this is from unbinding the imx-drm
  module, and then trying to reboot.
  
  imx-drm is really very broken in the way it tries to bend DRM to be
  used in DT - it doesn't consider the lifetime for anything like the
  CRTCs, connectors or encoders.  All these have empty .destroy functions
  to them. If we unbind imx-drm, the top level drm_device tries to be
  destroyed, but it leaves behind all the CRTCs, connectors and encoders,
  causing the first warning because none of the framebuffers got cleaned
  up through that destruction (because the functions did nothing.)
  
  The second one is through trying to clean up the framebuffer, which is
  still in use.
  
  The third one is caused because there's still allocated memory objects
  against the DRM memory manager - again, because nothing has been cleaned
  up.
 
 Right, so how imx-drm works as far as DRM initialization is by a wing
 and a prayer at the moment.
 
 It works like this - the driver relies heavily upon this sequence:
 
 - imx_drm_init()
   - creates an imx_drm_device structure to contain references to other
 parts.
   - registers the imx-drm platform device and an associated structure.
 - the platform device is immediately probed, causing it to be registered
   with the DRM subsystem.
 - the DRM subsystem creates the drm_device structure, and calls the
   drivers -load method.
 - the driver initialises some basic data, places a pointer to the
   drm_device into the imx_drm_device and returns
 - imx_pd_driver_init()
   - registers the imx_pd_driver platform device driver for DT devices
 with a compatible string of fsl,imx-parallel-display
   - such devices will be immediately probed
 - these allocate an imx_parallel_display structure, which contains
   a drm_connector and drm_encoder structure embedded within.
 - these structures are registered into the core of imx_drm, and
   via the imx_drm_device structure, are both attached to the
   drm_device immediately.
 - imx_tve_driver_init()
   essentially the same as imx_pd_driver_init()
 - imx_ldb_driver_init()
   essentially the same as imx_pd_driver_init()
 - imx_ipu_driver_init()
   - registers a platform driver fot DT devices with a compatible string
 of fsl,imx51-ipu, fsl,imx53-ipu, or fsl,imx6q-ipu.
   - initialises such devices, and creates two new platform devices
 called imx-ipuv3-crtc, one for each display interface.
 - ipu_drm_driver_init()
   - registers a platform driver for imx-ipuv3-crtc devices.
 - for each device found
   - it allocates a ipu_crtc device structure, which embeds a drm_crtc
 structure.
   - it registers a CRTC via imx_drm_add_crtc().
 - this allocates an imx_drm_crtc structure, and eventually registers
   the drm_crtc structure against the drm_device
 - imx_hdmi_driver_init
   similar to imx_pd_driver_init
 
 All that sequence is in init level 6.  The last bit comes in init level 7
 (the late_initcall):
 
 - imx_fb_helper_init()
   - this grabs the drm_device, and calls drm_fbdev_cma_init() on it
 hoping that we know the number of CRTCs at this point.  This is
 held indefinitely.
   - the resulting drm_fbdev_cma is saved into the imx_drm_device.
 
 Now, if the imx-drm device is unbound from its driver, all hell breaks
 loose - none of these crtc/connector/encoder structures have a meaningful
 destroy function - their destruction is all in their individual driver
 remove functions.  This causes some warnings to be spat out from DRM.
 
 Amongst this is the last_close callback which looks at the imx_drm_device,
 sees that drm_fbdev_cma is registered against it, and calls
 drm_fbdev_cma_restore_mode() on it.  drm_fbdev_cma contains objects which
 store a pointer to the drm_device structure that it was registered against,
 which exists at this point, so everything is fine.
 
 The unload proceeds, and eventually the drm_device is freed.
 
 Now, if we rebind the imx-drm device, causing the probe actions above to
 be repeated.  imx_drm_device still contains a pointer to the drm_fbdev_cma
 object that was allocated...  Let's ignore the fact that none of the
 sub-modules have re-initialised anything against this new drm_device.
 
 The real fun comes when you try and unbind it again.  This time, the
 drm_device which is being torn down isn't the one in drm_fbdev_cma,
 but we still call drm_fbdev_cma_restore_mode().  This tries to get a
 mutex on the _original_ drm_device-mode_config.mutex, which has been
 freed.  The result is a kernel oops.
 
 Now, several things stand out here: piece-meal construction of a
 drm_device in this manner is unsafe:
 - it relies heavily on all devices already being present at the time 

[PATCH 00/22] staging: lustre: Update structs

2013-10-20 Thread Lisa Nguyen
This patchset includes all the changes needed to update
the structs defined in libcfs_hash.h. Doing this will 
eliminate the Do not add new typedefs warning
generated by checkpatch.pl and the updated format of 
those structs will meet kernel coding style.

Other header files and certain source files that use 
functions and structs defined in libcfs_hash.h have updated
struct variables.

I have CC'ed the lustre driver authors to keep them 
informed of this update.

Questions and comments are welcomed.

Lisa Nguyen (22):
  staging: lustre: Remove all new typedefs in libcfs_hash.h
  staging: lustre: Update struct variables in lu_object.h
  staging: lustre: Update struct variables in lustre_dlm.h
  staging: lustre: Update struct variables in lustre_export.h
  staging: lustre: Update struct variables in lustre_net.h
  staging: lustre: Update struct variables in obd.h
  staging: lustre: Update struct variables in lov_internal.h
  staging: lustre: Update struct variables in hash.c
  staging: lustre: Update struct variables in ldlm_flock.c
  staging: lustre: Update struct variables in ldlm_lock.c
  staging: lustre: Update struct variables in ldlm_request.c
  staging: lustre: Update struct variables in ldlm_resource.c
  staging: lustre: Update struct variables in ldlm_lockd.c
  staging: lustre: Update struct variables in vvp_dev.c
  staging: lustre: Update struct variables in lov_pool.c
  staging: lustre: Update struct variables in cl_object.c
  staging: lustre: Update struct variables in genops.c
  staging: lustre: Update struct variables in lprocfs_status.c
  staging: lustre: Update struct variables in lu_object.c
  staging: lustre: Update struct variables in obd_config.c
  staging: lustre: Update struct variables in osc_quota.c
  staging: lustre: Update struct variables in connection.c

 .../lustre/include/linux/libcfs/libcfs_hash.h  | 280 ++---
 drivers/staging/lustre/lustre/include/lu_object.h  |   4 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |   2 +-
 .../staging/lustre/lustre/include/lustre_export.h  |   4 +-
 drivers/staging/lustre/lustre/include/lustre_net.h |   4 +-
 drivers/staging/lustre/lustre/include/obd.h|  10 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c|   8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |   4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c|   8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  34 +--
 drivers/staging/lustre/lustre/libcfs/hash.c| 270 ++--
 drivers/staging/lustre/lustre/llite/vvp_dev.c  |   2 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |   2 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c   |   8 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c |   8 +-
 drivers/staging/lustre/lustre/obdclass/genops.c|   6 +-
 .../lustre/lustre/obdclass/lprocfs_status.c|   6 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  42 ++--
 .../staging/lustre/lustre/obdclass/obd_config.c|  28 +--
 drivers/staging/lustre/lustre/osc/osc_quota.c  |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/connection.c  |  14 +-
 22 files changed, 379 insertions(+), 379 deletions(-)

-- 
1.8.1.2

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


[PATCH 03/22] staging: lustre: Update struct variables in lustre_dlm.h

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in lustre_dlm.h to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 7020d9c..c552903 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -375,7 +375,7 @@ struct ldlm_namespace {
ldlm_side_t ns_client;
 
/** Resource hash table for namespace. */
-   cfs_hash_t  *ns_rs_hash;
+   struct cfs_hash *ns_rs_hash;
 
/** serialize */
spinlock_t  ns_lock;
-- 
1.8.1.2

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


[PATCH 01/22] staging: lustre: Remove all new typedefs in libcfs_hash.h

2013-10-20 Thread Lisa Nguyen
Modified all structs in libcfs_hash header file to eliminate
the Do not add new typedefs warning generated by checkpatch.pl
and meet kernel coding style.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 .../lustre/include/linux/libcfs/libcfs_hash.h  | 280 ++---
 1 file changed, 140 insertions(+), 140 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 98f5be2..1e1e0f5 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -81,10 +81,10 @@ struct cfs_hash_ops;
 struct cfs_hash_lock_ops;
 struct cfs_hash_hlist_ops;
 
-typedef union {
+union cfs_hash_lock {
rwlock_trw; /** rwlock */
spinlock_t  spin;   /** spinlock */
-} cfs_hash_lock_t;
+};
 
 /**
  * cfs_hash_bucket is a container of:
@@ -97,22 +97,22 @@ typedef union {
  *   which depends on requirement of user
  * - some extra bytes (caller can require it while creating hash)
  */
-typedef struct cfs_hash_bucket {
-   cfs_hash_lock_t hsb_lock;   /** bucket lock */
+struct cfs_hash_bucket {
+   union cfs_hash_lock hsb_lock;   /** bucket lock */
__u32   hsb_count;  /** current entries */
__u32   hsb_version;/** change version */
unsigned inthsb_index;  /** index of bucket */
int hsb_depmax; /** max depth on bucket */
longhsb_head[0];/** hash-head array */
-} cfs_hash_bucket_t;
+};
 
 /**
  * cfs_hash bucket descriptor, it's normally in stack of caller
  */
-typedef struct cfs_hash_bd {
-   cfs_hash_bucket_t *bd_bucket;  /** address of bucket */
+struct cfs_hash_bd {
+   struct cfs_hash_bucket *bd_bucket;  /** address of bucket */
unsigned intbd_offset;  /** offset in bucket */
-} cfs_hash_bd_t;
+};
 
 #define CFS_HASH_NAME_LEN 16  /** default name length */
 #define CFS_HASH_BIGNAME_LEN   64  /** bigname for param tree */
@@ -210,10 +210,10 @@ enum cfs_hash_tag {
  * locations; additions must take care to only insert into the new bucket.
  */
 
-typedef struct cfs_hash {
+struct cfs_hash {
/** serialize with rehash, or serialize all operations if
 * the hash-table has CFS_HASH_NO_BKTLOCK */
-   cfs_hash_lock_t  hs_lock;
+   union cfs_hash_lock  hs_lock;
/** hash operations */
struct cfs_hash_ops *hs_ops;
/** hash lock operations */
@@ -221,10 +221,10 @@ typedef struct cfs_hash {
/** hash list operations */
struct cfs_hash_hlist_ops  *hs_hops;
/** hash buckets-table */
-   cfs_hash_bucket_t**hs_buckets;
+   struct cfs_hash_bucket   **hs_buckets;
/** total number of items on this hash-table */
atomic_ths_count;
-   /** hash flags, see cfs_hash_tag for detail */
+   /** hash flags, see struct cfs_hashag for detail */
__u16  hs_flags;
/** # of extra-bytes for bucket, for user saving extended attributes */
__u16  hs_extra_bytes;
@@ -255,7 +255,7 @@ typedef struct cfs_hash {
/** refcount on this hash table */
atomic_ths_refcount;
/** rehash buckets-table */
-   cfs_hash_bucket_t**hs_rehash_buckets;
+   struct cfs_hash_bucket   **hs_rehash_buckets;
 #if CFS_HASH_DEBUG_LEVEL = CFS_HASH_DEBUG_1
/** serialize debug members */
spinlock_t  hs_dep_lock;
@@ -272,35 +272,35 @@ typedef struct cfs_hash {
 #endif
/** name of htable */
charhs_name[0];
-} cfs_hash_t;
+};
 
-typedef struct cfs_hash_lock_ops {
+struct cfs_hash_lock_ops {
/** lock the hash table */
-   void(*hs_lock)(cfs_hash_lock_t *lock, int exclusive);
+   void(*hs_lock)(union cfs_hash_lock *lock, int exclusive);
/** unlock the hash table */
-   void(*hs_unlock)(cfs_hash_lock_t *lock, int exclusive);
+   void(*hs_unlock)(union cfs_hash_lock *lock, int exclusive);
/** lock the hash bucket */
-   void(*hs_bkt_lock)(cfs_hash_lock_t *lock, int exclusive);
+   void(*hs_bkt_lock)(union cfs_hash_lock *lock, int exclusive);
/** unlock the hash bucket */
-   void(*hs_bkt_unlock)(cfs_hash_lock_t *lock, int exclusive);
-} cfs_hash_lock_ops_t;
+   void(*hs_bkt_unlock)(union cfs_hash_lock *lock, int exclusive);
+};
 
-typedef struct cfs_hash_hlist_ops {
+struct cfs_hash_hlist_ops {
/** return hlist_head of hash-head of @bd */
-   struct hlist_head *(*hop_hhead)(cfs_hash_t *hs, cfs_hash_bd_t *bd);
+   struct hlist_head *(*hop_hhead)(struct cfs_hash *hs, struct cfs_hash_bd 
*bd);
/** 

[PATCH 04/22] staging: lustre: Update struct variables in lustre_export.h

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this will update the struct variables
in lustre_export.h to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/include/lustre_export.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h 
b/drivers/staging/lustre/lustre/include/lustre_export.h
index d61c020..2feb38b 100644
--- a/drivers/staging/lustre/lustre/include/lustre_export.h
+++ b/drivers/staging/lustre/lustre/include/lustre_export.h
@@ -197,12 +197,12 @@ struct obd_export {
/** Connection count value from last succesful reconnect rpc */
__u32exp_conn_cnt;
/** Hash list of all ldlm locks granted on this export */
-   cfs_hash_t *exp_lock_hash;
+   struct cfs_hash*exp_lock_hash;
/**
 * Hash list for Posix lock deadlock detection, added with
 * ldlm_lock::l_exp_flock_hash.
 */
-   cfs_hash_t *exp_flock_hash;
+   struct cfs_hash*exp_flock_hash;
struct list_headexp_outstanding_replies;
struct list_headexp_uncommitted_replies;
spinlock_texp_uncommitted_replies_lock;
-- 
1.8.1.2

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


[PATCH 06/22] staging: lustre: Update struct variables in obd.h

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in obd.h to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/include/obd.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index 4fd4af9..d0aea15 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -429,7 +429,7 @@ struct client_obd {
/* ptlrpc work for writeback in ptlrpcd context */
void*cl_writeback_work;
/* hash tables for osc_quota_info */
-   cfs_hash_t*cl_quota_hash[MAXQUOTAS];
+   struct cfs_hash   *cl_quota_hash[MAXQUOTAS];
 };
 #define obd2cli_tgt(obd) ((char *)(obd)-u.cli.cl_target_uuid.uuid)
 
@@ -556,7 +556,7 @@ struct lov_obd {
__u32  lov_tgt_size;   /* size of tgts array */
int  lov_connects;
int  lov_pool_count;
-   cfs_hash_t   *lov_pools_hash_body; /* used for key access */
+   struct cfs_hash  *lov_pools_hash_body; /* used for key access */
struct list_head  lov_pool_list; /* used for sequential 
access */
struct proc_dir_entry   *lov_pool_proc_entry;
enum lustre_sec_partlov_sp_me;
@@ -855,11 +855,11 @@ struct obd_device {
 * protection of other bits using _bh lock */
unsigned long obd_recovery_expired:1;
/* uuid-export hash body */
-   cfs_hash_t   *obd_uuid_hash;
+   struct cfs_hash  *obd_uuid_hash;
/* nid-export hash body */
-   cfs_hash_t   *obd_nid_hash;
+   struct cfs_hash  *obd_nid_hash;
/* nid stats body */
-   cfs_hash_t   *obd_nid_stats_hash;
+   struct cfs_hash  *obd_nid_stats_hash;
struct list_head  obd_nid_stats;
atomic_tobd_refcount;
wait_queue_head_tobd_refcount_waitq;
-- 
1.8.1.2

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


[PATCH 07/22] staging: lustre: Update struct variables in lov_internal.h

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in lov_internal.h to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/lov/lov_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h 
b/drivers/staging/lustre/lustre/lov/lov_internal.h
index 9870d36..9ec6cb0 100644
--- a/drivers/staging/lustre/lustre/lov/lov_internal.h
+++ b/drivers/staging/lustre/lustre/lov/lov_internal.h
@@ -295,7 +295,7 @@ static inline void lprocfs_lov_init_vars(struct 
lprocfs_static_vars *lvars)
 extern struct lu_device_type lov_device_type;
 
 /* pools */
-extern cfs_hash_ops_t pool_hash_operations;
+extern struct cfs_hash_ops pool_hash_operations;
 /* ost_pool methods */
 int lov_ost_pool_init(struct ost_pool *op, unsigned int count);
 int lov_ost_pool_extend(struct ost_pool *op, unsigned int min_count);
-- 
1.8.1.2

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


[PATCH 09/22] staging: lustre: Update struct variables in ldlm_flock.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in ldlm_flock.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index c68ed27..3d881a0 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -745,7 +745,7 @@ void ldlm_flock_policy_local_to_wire(const 
ldlm_policy_data_t *lpolicy,
  * Export handle-flock hash operations.
  */
 static unsigned
-ldlm_export_flock_hash(cfs_hash_t *hs, const void *key, unsigned mask)
+ldlm_export_flock_hash(struct cfs_hash *hs, const void *key, unsigned mask)
 {
return cfs_hash_u64_hash(*(__u64 *)key, mask);
 }
@@ -772,7 +772,7 @@ ldlm_export_flock_object(struct hlist_node *hnode)
 }
 
 static void
-ldlm_export_flock_get(cfs_hash_t *hs, struct hlist_node *hnode)
+ldlm_export_flock_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct ldlm_lock *lock;
struct ldlm_flock *flock;
@@ -787,7 +787,7 @@ ldlm_export_flock_get(cfs_hash_t *hs, struct hlist_node 
*hnode)
 }
 
 static void
-ldlm_export_flock_put(cfs_hash_t *hs, struct hlist_node *hnode)
+ldlm_export_flock_put(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct ldlm_lock *lock;
struct ldlm_flock *flock;
@@ -804,7 +804,7 @@ ldlm_export_flock_put(cfs_hash_t *hs, struct hlist_node 
*hnode)
}
 }
 
-static cfs_hash_ops_t ldlm_export_flock_ops = {
+static struct cfs_hash_ops ldlm_export_flock_ops = {
.hs_hash= ldlm_export_flock_hash,
.hs_key  = ldlm_export_flock_key,
.hs_keycmp  = ldlm_export_flock_keycmp,
-- 
1.8.1.2

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


[PATCH 10/22] staging: lustre: Update struct variables in ldlm_lock.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in ldlm_lock.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 027617f..3900a69 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1891,7 +1891,7 @@ static int reprocess_one_queue(struct ldlm_resource *res, 
void *closure)
return LDLM_ITER_CONTINUE;
 }
 
-static int ldlm_reprocess_res(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+static int ldlm_reprocess_res(struct cfs_hash *hs, struct cfs_hash_bd *bd,
  struct hlist_node *hnode, void *arg)
 {
struct ldlm_resource *res = cfs_hash_object(hs, hnode);
@@ -2040,7 +2040,7 @@ struct export_cl_data {
  * Iterator function for ldlm_cancel_locks_for_export.
  * Cancels passed locks.
  */
-int ldlm_cancel_locks_for_export_cb(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+int ldlm_cancel_locks_for_export_cb(struct cfs_hash *hs, struct cfs_hash_bd 
*bd,
struct hlist_node *hnode, void *data)
 
 {
-- 
1.8.1.2

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


[PATCH 11/22] staging: lustre: Update struct variables in ldlm_request.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in ldlm_request.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 21cb523..c3b6ad5 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -1925,7 +1925,7 @@ struct ldlm_cli_cancel_arg {
void   *lc_opaque;
 };
 
-static int ldlm_cli_hash_cancel_unused(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+static int ldlm_cli_hash_cancel_unused(struct cfs_hash *hs, struct cfs_hash_bd 
*bd,
   struct hlist_node *hnode, void *arg)
 {
struct ldlm_resource   *res = cfs_hash_object(hs, hnode);
@@ -2023,7 +2023,7 @@ static int ldlm_iter_helper(struct ldlm_lock *lock, void 
*closure)
return helper-iter(lock, helper-closure);
 }
 
-static int ldlm_res_iter_helper(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+static int ldlm_res_iter_helper(struct cfs_hash *hs, struct cfs_hash_bd *bd,
struct hlist_node *hnode, void *arg)
 
 {
-- 
1.8.1.2

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


[PATCH 12/22] staging: lustre: Update struct variables in ldlm_resource.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in ldlm_resource.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 34 +++---
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 8d3dd6d..c44c2f5 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -159,7 +159,7 @@ static int lprocfs_ns_resources_seq_show(struct seq_file 
*m, void *v)
 {
struct ldlm_namespace *ns  = m-private;
__u64 res = 0;
-   cfs_hash_bd_t bd;
+   struct cfs_hash_bdbd;
int i;
 
/* result is not strictly consistant */
@@ -389,7 +389,7 @@ int ldlm_namespace_proc_register(struct ldlm_namespace *ns)
 
 #endif /* LPROCFS */
 
-static unsigned ldlm_res_hop_hash(cfs_hash_t *hs,
+static unsigned ldlm_res_hop_hash(struct cfs_hash *hs,
  const void *key, unsigned mask)
 {
const struct ldlm_res_id *id  = key;
@@ -401,7 +401,7 @@ static unsigned ldlm_res_hop_hash(cfs_hash_t *hs,
return val  mask;
 }
 
-static unsigned ldlm_res_hop_fid_hash(cfs_hash_t *hs,
+static unsigned ldlm_res_hop_fid_hash(struct cfs_hash *hs,
  const void *key, unsigned mask)
 {
const struct ldlm_res_id *id = key;
@@ -453,7 +453,7 @@ static void *ldlm_res_hop_object(struct hlist_node *hnode)
return hlist_entry(hnode, struct ldlm_resource, lr_hash);
 }
 
-static void ldlm_res_hop_get_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+static void ldlm_res_hop_get_locked(struct cfs_hash *hs, struct hlist_node 
*hnode)
 {
struct ldlm_resource *res;
 
@@ -461,7 +461,7 @@ static void ldlm_res_hop_get_locked(cfs_hash_t *hs, struct 
hlist_node *hnode)
ldlm_resource_getref(res);
 }
 
-static void ldlm_res_hop_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+static void ldlm_res_hop_put_locked(struct cfs_hash *hs, struct hlist_node 
*hnode)
 {
struct ldlm_resource *res;
 
@@ -470,7 +470,7 @@ static void ldlm_res_hop_put_locked(cfs_hash_t *hs, struct 
hlist_node *hnode)
ldlm_resource_putref_locked(res);
 }
 
-static void ldlm_res_hop_put(cfs_hash_t *hs, struct hlist_node *hnode)
+static void ldlm_res_hop_put(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct ldlm_resource *res;
 
@@ -478,7 +478,7 @@ static void ldlm_res_hop_put(cfs_hash_t *hs, struct 
hlist_node *hnode)
ldlm_resource_putref(res);
 }
 
-cfs_hash_ops_t ldlm_ns_hash_ops = {
+struct cfs_hash_ops ldlm_ns_hash_ops = {
.hs_hash= ldlm_res_hop_hash,
.hs_key  = ldlm_res_hop_key,
.hs_keycmp  = ldlm_res_hop_keycmp,
@@ -489,7 +489,7 @@ cfs_hash_ops_t ldlm_ns_hash_ops = {
.hs_put  = ldlm_res_hop_put
 };
 
-cfs_hash_ops_t ldlm_ns_fid_hash_ops = {
+struct cfs_hash_ops ldlm_ns_fid_hash_ops = {
.hs_hash= ldlm_res_hop_fid_hash,
.hs_key  = ldlm_res_hop_key,
.hs_keycmp  = ldlm_res_hop_keycmp,
@@ -507,7 +507,7 @@ typedef struct {
/** hash bits */
unsignednsd_all_bits;
/** hash operations */
-   cfs_hash_ops_t *nsd_hops;
+   struct cfs_hash_ops *nsd_hops;
 } ldlm_ns_hash_def_t;
 
 ldlm_ns_hash_def_t ldlm_ns_hash_defs[] =
@@ -564,7 +564,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device 
*obd, char *name,
struct ldlm_namespace *ns = NULL;
struct ldlm_ns_bucket *nsb;
ldlm_ns_hash_def_t*nsd;
-   cfs_hash_bd_t bd;
+   struct cfs_hash_bdbd;
int idx;
int rc;
 
@@ -743,7 +743,7 @@ static void cleanup_resource(struct ldlm_resource *res, 
struct list_head *q,
} while (1);
 }
 
-static int ldlm_resource_clean(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+static int ldlm_resource_clean(struct cfs_hash *hs, struct cfs_hash_bd *bd,
   struct hlist_node *hnode, void *arg)
 {
struct ldlm_resource *res = cfs_hash_object(hs, hnode);
@@ -756,7 +756,7 @@ static int ldlm_resource_clean(cfs_hash_t *hs, 
cfs_hash_bd_t *bd,
return 0;
 }
 
-static int ldlm_resource_complain(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+static int ldlm_resource_complain(struct cfs_hash *hs, struct cfs_hash_bd *bd,
  struct hlist_node *hnode, void *arg)
 {
struct ldlm_resource  *res = cfs_hash_object(hs, hnode);
@@ -1060,7 +1060,7 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct 
ldlm_resource *parent,
 {
struct hlist_node *hnode;
struct ldlm_resource *res;
-   cfs_hash_bd_tbd;
+   struct cfs_hash_bd   bd;
__u64version;
 

[PATCH 14/22] staging: lustre: Update struct variables in vvp_dev.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in vvp_dev.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c 
b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index be125b9..c4d1580 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -297,7 +297,7 @@ static loff_t vvp_pgcache_id_pack(struct vvp_pgcache_id *id)
((__u64)id-vpi_bucket  PGC_OBJ_SHIFT);
 }
 
-static int vvp_pgcache_obj_get(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+static int vvp_pgcache_obj_get(struct cfs_hash *hs, struct cfs_hash_bd *bd,
   struct hlist_node *hnode, void *data)
 {
struct vvp_pgcache_id   *id  = data;
-- 
1.8.1.2

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


[PATCH 15/22] staging: lustre: Update struct variables in lov_pool.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in lov_pool.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/lov/lov_pool.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c 
b/drivers/staging/lustre/lustre/lov/lov_pool.c
index dd3c07d..a0d38ab 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pool.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pool.c
@@ -86,7 +86,7 @@ void lov_pool_putref_locked(struct pool_desc *pool)
  * Chapter 6.4.
  * Addison Wesley, 1973
  */
-static __u32 pool_hashfn(cfs_hash_t *hash_body, const void *key, unsigned mask)
+static __u32 pool_hashfn(struct cfs_hash *hash_body, const void *key, unsigned 
mask)
 {
int i;
__u32 result;
@@ -125,7 +125,7 @@ static void *pool_hashobject(struct hlist_node *hnode)
return hlist_entry(hnode, struct pool_desc, pool_hash);
 }
 
-static void pool_hashrefcount_get(cfs_hash_t *hs, struct hlist_node *hnode)
+static void pool_hashrefcount_get(struct cfs_hash *hs, struct hlist_node 
*hnode)
 {
struct pool_desc *pool;
 
@@ -133,7 +133,7 @@ static void pool_hashrefcount_get(cfs_hash_t *hs, struct 
hlist_node *hnode)
lov_pool_getref(pool);
 }
 
-static void pool_hashrefcount_put_locked(cfs_hash_t *hs,
+static void pool_hashrefcount_put_locked(struct cfs_hash *hs,
 struct hlist_node *hnode)
 {
struct pool_desc *pool;
@@ -142,7 +142,7 @@ static void pool_hashrefcount_put_locked(cfs_hash_t *hs,
lov_pool_putref_locked(pool);
 }
 
-cfs_hash_ops_t pool_hash_operations = {
+struct cfs_hash_ops pool_hash_operations = {
.hs_hash= pool_hashfn,
.hs_key  = pool_key,
.hs_keycmp  = pool_hashkey_keycmp,
-- 
1.8.1.2

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


[PATCH 16/22] staging: lustre: Update struct variables in cl_object.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in cl_object.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c 
b/drivers/staging/lustre/lustre/obdclass/cl_object.c
index 7b0e9d2..7ed8c86 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
@@ -577,9 +577,9 @@ static void cl_env_init0(struct cl_env *cle, void *debug)
  * The implementation of using hash table to connect cl_env and thread
  */
 
-static cfs_hash_t *cl_env_hash;
+static struct cfs_hash *cl_env_hash;
 
-static unsigned cl_env_hops_hash(cfs_hash_t *lh,
+static unsigned cl_env_hops_hash(struct cfs_hash *lh,
 const void *key, unsigned mask)
 {
 #if BITS_PER_LONG == 64
@@ -604,13 +604,13 @@ static int cl_env_hops_keycmp(const void *key, struct 
hlist_node *hn)
return (key == cle-ce_owner);
 }
 
-static void cl_env_hops_noop(cfs_hash_t *hs, struct hlist_node *hn)
+static void cl_env_hops_noop(struct cfs_hash *hs, struct hlist_node *hn)
 {
struct cl_env *cle = hlist_entry(hn, struct cl_env, ce_node);
LASSERT(cle-ce_magic == cl_env_init0);
 }
 
-static cfs_hash_ops_t cl_env_hops = {
+static struct cfs_hash_ops cl_env_hops = {
.hs_hash= cl_env_hops_hash,
.hs_key  = cl_env_hops_obj,
.hs_keycmp  = cl_env_hops_keycmp,
-- 
1.8.1.2

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


[PATCH 17/22] staging: lustre: Update struct variables in genops.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in genops.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/obdclass/genops.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c 
b/drivers/staging/lustre/lustre/obdclass/genops.c
index 68fe71c..f6fae16 100644
--- a/drivers/staging/lustre/lustre/obdclass/genops.c
+++ b/drivers/staging/lustre/lustre/obdclass/genops.c
@@ -816,7 +816,7 @@ struct obd_export *class_new_export(struct obd_device *obd,
struct obd_uuid *cluuid)
 {
struct obd_export *export;
-   cfs_hash_t *hash = NULL;
+   struct cfs_hash *hash = NULL;
int rc = 0;
 
OBD_ALLOC_PTR(export);
@@ -1384,7 +1384,7 @@ EXPORT_SYMBOL(obd_export_nid2str);
 
 int obd_export_evict_by_nid(struct obd_device *obd, const char *nid)
 {
-   cfs_hash_t *nid_hash;
+   struct cfs_hash *nid_hash;
struct obd_export *doomed_exp = NULL;
int exports_evicted = 0;
 
@@ -1432,7 +1432,7 @@ EXPORT_SYMBOL(obd_export_evict_by_nid);
 
 int obd_export_evict_by_uuid(struct obd_device *obd, const char *uuid)
 {
-   cfs_hash_t *uuid_hash;
+   struct cfs_hash *uuid_hash;
struct obd_export *doomed_exp = NULL;
struct obd_uuid doomed_uuid;
int exports_evicted = 0;
-- 
1.8.1.2

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


[PATCH 21/22] staging: lustre: Update struct variables in osc_quota.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in osc_quota.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/osc/osc_quota.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_quota.c 
b/drivers/staging/lustre/lustre/osc/osc_quota.c
index 9720c0e..43f0b2b 100644
--- a/drivers/staging/lustre/lustre/osc/osc_quota.c
+++ b/drivers/staging/lustre/lustre/osc/osc_quota.c
@@ -139,7 +139,7 @@ int osc_quota_setdq(struct client_obd *cli, const unsigned 
int qid[],
  * Hash operations for uid/gid - osc_quota_info
  */
 static unsigned
-oqi_hashfn(cfs_hash_t *hs, const void *key, unsigned mask)
+oqi_hashfn(struct cfs_hash *hs, const void *key, unsigned mask)
 {
return cfs_hash_u32_hash(*((__u32*)key), mask);
 }
@@ -172,17 +172,17 @@ oqi_object(struct hlist_node *hnode)
 }
 
 static void
-oqi_get(cfs_hash_t *hs, struct hlist_node *hnode)
+oqi_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
 }
 
 static void
-oqi_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+oqi_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)
 {
 }
 
 static void
-oqi_exit(cfs_hash_t *hs, struct hlist_node *hnode)
+oqi_exit(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct osc_quota_info *oqi;
 
@@ -195,7 +195,7 @@ oqi_exit(cfs_hash_t *hs, struct hlist_node *hnode)
 #define HASH_QUOTA_CUR_BITS 5
 #define HASH_QUOTA_MAX_BITS 15
 
-static cfs_hash_ops_t quota_hash_ops = {
+static struct cfs_hash_ops quota_hash_ops = {
.hs_hash= oqi_hashfn,
.hs_keycmp  = oqi_keycmp,
.hs_key = oqi_key,
-- 
1.8.1.2

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


[PATCH 19/22] staging: lustre: Update struct variables in lu_object.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in lu_object.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 42 +++---
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c 
b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index e8f2607..43c452e 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -71,7 +71,7 @@ void lu_object_put(const struct lu_env *env, struct lu_object 
*o)
struct lu_object_header *top;
struct lu_site*site;
struct lu_object*orig;
-   cfs_hash_bd_t   bd;
+   struct cfs_hash_bd  bd;
const struct lu_fid *fid;
 
top  = o-lo_header;
@@ -175,8 +175,8 @@ void lu_object_unhash(const struct lu_env *env, struct 
lu_object *o)
top = o-lo_header;
set_bit(LU_OBJECT_HEARD_BANSHEE, top-loh_flags);
if (!test_and_set_bit(LU_OBJECT_UNHASHED, top-loh_flags)) {
-   cfs_hash_t *obj_hash = o-lo_dev-ld_site-ls_obj_hash;
-   cfs_hash_bd_t bd;
+   struct cfs_hash *obj_hash = o-lo_dev-ld_site-ls_obj_hash;
+   struct cfs_hash_bd bd;
 
cfs_hash_bd_get_and_lock(obj_hash, top-loh_fid, bd, 1);
list_del_init(top-loh_lru);
@@ -306,8 +306,8 @@ int lu_site_purge(const struct lu_env *env, struct lu_site 
*s, int nr)
struct lu_object_header *h;
struct lu_object_header *temp;
struct lu_site_bkt_data *bkt;
-   cfs_hash_bd_t   bd;
-   cfs_hash_bd_t   bd2;
+   struct cfs_hash_bd  bd;
+   struct cfs_hash_bd  bd2;
struct list_head   dispose;
int   did_sth;
int   start;
@@ -526,7 +526,7 @@ int lu_object_invariant(const struct lu_object *o)
 EXPORT_SYMBOL(lu_object_invariant);
 
 static struct lu_object *htable_lookup(struct lu_site *s,
-  cfs_hash_bd_t *bd,
+  struct cfs_hash_bd *bd,
   const struct lu_fid *f,
   wait_queue_t *waiter,
   __u64 *version)
@@ -589,8 +589,8 @@ static struct lu_object *lu_object_new(const struct lu_env 
*env,
   const struct lu_object_conf *conf)
 {
struct lu_object*o;
-   cfs_hash_t*hs;
-   cfs_hash_bd_t   bd;
+   struct cfs_hash   *hs;
+   struct cfs_hash_bd  bd;
struct lu_site_bkt_data *bkt;
 
o = lu_object_alloc(env, dev, f, conf);
@@ -618,8 +618,8 @@ static struct lu_object *lu_object_find_try(const struct 
lu_env *env,
struct lu_object  *o;
struct lu_object  *shadow;
struct lu_site  *s;
-   cfs_hash_t  *hs;
-   cfs_hash_bd_t bd;
+   struct cfs_hash *hs;
+   struct cfs_hash_bdbd;
__u64 version = 0;
 
/*
@@ -788,7 +788,7 @@ struct lu_site_print_arg {
 };
 
 static int
-lu_site_obj_print(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+lu_site_obj_print(struct cfs_hash *hs, struct cfs_hash_bd *bd,
  struct hlist_node *hnode, void *data)
 {
struct lu_site_print_arg *arg = (struct lu_site_print_arg *)data;
@@ -874,7 +874,7 @@ static int lu_htable_order(void)
return bits;
 }
 
-static unsigned lu_obj_hop_hash(cfs_hash_t *hs,
+static unsigned lu_obj_hop_hash(struct cfs_hash *hs,
const void *key, unsigned mask)
 {
struct lu_fid  *fid = (struct lu_fid *)key;
@@ -914,14 +914,14 @@ static int lu_obj_hop_keycmp(const void *key, struct 
hlist_node *hnode)
return lu_fid_eq(h-loh_fid, (struct lu_fid *)key);
 }
 
-static void lu_obj_hop_get(cfs_hash_t *hs, struct hlist_node *hnode)
+static void lu_obj_hop_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct lu_object_header *h;
 
h = hlist_entry(hnode, struct lu_object_header, loh_hash);
if (atomic_add_return(1, h-loh_ref) == 1) {
struct lu_site_bkt_data *bkt;
-   cfs_hash_bd_t   bd;
+   struct cfs_hash_bd  bd;
 
cfs_hash_bd_get(hs, h-loh_fid, bd);
bkt = cfs_hash_bd_extra_get(hs, bd);
@@ -929,12 +929,12 @@ static void lu_obj_hop_get(cfs_hash_t *hs, struct 
hlist_node *hnode)
}
 }
 
-static void lu_obj_hop_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+static void lu_obj_hop_put_locked(struct cfs_hash *hs, struct hlist_node 
*hnode)
 {
LBUG(); /* we should never called it */
 }
 
-cfs_hash_ops_t lu_site_hash_ops = {
+struct cfs_hash_ops lu_site_hash_ops = 

[PATCH 20/22] staging: lustre: Update struct variables in obd_config.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in obd_config.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 .../staging/lustre/lustre/obdclass/obd_config.c| 28 +++---
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c 
b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index 73e2571..a5ff317 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -47,9 +47,9 @@
 
 #include llog_internal.h
 
-static cfs_hash_ops_t uuid_hash_ops;
-static cfs_hash_ops_t nid_hash_ops;
-static cfs_hash_ops_t nid_stat_hash_ops;
+static struct cfs_hash_ops uuid_hash_ops;
+static struct cfs_hash_ops nid_hash_ops;
+static struct cfs_hash_ops nid_stat_hash_ops;
 
 /*** string parsing utils */
 
@@ -1692,7 +1692,7 @@ EXPORT_SYMBOL(class_manual_cleanup);
  */
 
 static unsigned
-uuid_hash(cfs_hash_t *hs, const void *key, unsigned mask)
+uuid_hash(struct cfs_hash *hs, const void *key, unsigned mask)
 {
return cfs_hash_djb2_hash(((struct obd_uuid *)key)-uuid,
  sizeof(((struct obd_uuid *)key)-uuid), mask);
@@ -1731,7 +1731,7 @@ uuid_export_object(struct hlist_node *hnode)
 }
 
 static void
-uuid_export_get(cfs_hash_t *hs, struct hlist_node *hnode)
+uuid_export_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct obd_export *exp;
 
@@ -1740,7 +1740,7 @@ uuid_export_get(cfs_hash_t *hs, struct hlist_node *hnode)
 }
 
 static void
-uuid_export_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+uuid_export_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct obd_export *exp;
 
@@ -1748,7 +1748,7 @@ uuid_export_put_locked(cfs_hash_t *hs, struct hlist_node 
*hnode)
class_export_put(exp);
 }
 
-static cfs_hash_ops_t uuid_hash_ops = {
+static struct cfs_hash_ops uuid_hash_ops = {
.hs_hash= uuid_hash,
.hs_key  = uuid_key,
.hs_keycmp  = uuid_keycmp,
@@ -1763,7 +1763,7 @@ static cfs_hash_ops_t uuid_hash_ops = {
  */
 
 static unsigned
-nid_hash(cfs_hash_t *hs, const void *key, unsigned mask)
+nid_hash(struct cfs_hash *hs, const void *key, unsigned mask)
 {
return cfs_hash_djb2_hash(key, sizeof(lnet_nid_t), mask);
 }
@@ -1801,7 +1801,7 @@ nid_export_object(struct hlist_node *hnode)
 }
 
 static void
-nid_export_get(cfs_hash_t *hs, struct hlist_node *hnode)
+nid_export_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct obd_export *exp;
 
@@ -1810,7 +1810,7 @@ nid_export_get(cfs_hash_t *hs, struct hlist_node *hnode)
 }
 
 static void
-nid_export_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+nid_export_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct obd_export *exp;
 
@@ -1818,7 +1818,7 @@ nid_export_put_locked(cfs_hash_t *hs, struct hlist_node 
*hnode)
class_export_put(exp);
 }
 
-static cfs_hash_ops_t nid_hash_ops = {
+static struct cfs_hash_ops nid_hash_ops = {
.hs_hash= nid_hash,
.hs_key  = nid_key,
.hs_keycmp  = nid_kepcmp,
@@ -1855,7 +1855,7 @@ nidstats_object(struct hlist_node *hnode)
 }
 
 static void
-nidstats_get(cfs_hash_t *hs, struct hlist_node *hnode)
+nidstats_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct nid_stat *ns;
 
@@ -1864,7 +1864,7 @@ nidstats_get(cfs_hash_t *hs, struct hlist_node *hnode)
 }
 
 static void
-nidstats_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+nidstats_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct nid_stat *ns;
 
@@ -1872,7 +1872,7 @@ nidstats_put_locked(cfs_hash_t *hs, struct hlist_node 
*hnode)
nidstat_putref(ns);
 }
 
-static cfs_hash_ops_t nid_stat_hash_ops = {
+static struct cfs_hash_ops nid_stat_hash_ops = {
.hs_hash= nid_hash,
.hs_key  = nidstats_key,
.hs_keycmp  = nidstats_keycmp,
-- 
1.8.1.2

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


[PATCH 08/22] staging: lustre: Update struct variables in hash.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in hash.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/libcfs/hash.c | 270 ++--
 1 file changed, 135 insertions(+), 135 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c 
b/drivers/staging/lustre/lustre/libcfs/hash.c
index 29ce380..66cba5a 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -119,25 +119,25 @@ CFS_MODULE_PARM(warn_on_depth, i, uint, 0644,
 struct cfs_wi_sched *cfs_sched_rehash;
 
 static inline void
-cfs_hash_nl_lock(cfs_hash_lock_t *lock, int exclusive) {}
+cfs_hash_nl_lock(union cfs_hash_lock *lock, int exclusive) {}
 
 static inline void
-cfs_hash_nl_unlock(cfs_hash_lock_t *lock, int exclusive) {}
+cfs_hash_nl_unlock(union cfs_hash_lock *lock, int exclusive) {}
 
 static inline void
-cfs_hash_spin_lock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_spin_lock(union cfs_hash_lock *lock, int exclusive)
 {
spin_lock(lock-spin);
 }
 
 static inline void
-cfs_hash_spin_unlock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_spin_unlock(union cfs_hash_lock *lock, int exclusive)
 {
spin_unlock(lock-spin);
 }
 
 static inline void
-cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_rw_lock(union cfs_hash_lock *lock, int exclusive)
 {
if (!exclusive)
read_lock(lock-rw);
@@ -146,7 +146,7 @@ cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive)
 }
 
 static inline void
-cfs_hash_rw_unlock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_rw_unlock(union cfs_hash_lock *lock, int exclusive)
 {
if (!exclusive)
read_unlock(lock-rw);
@@ -155,7 +155,7 @@ cfs_hash_rw_unlock(cfs_hash_lock_t *lock, int exclusive)
 }
 
 /** No lock hash */
-static cfs_hash_lock_ops_t cfs_hash_nl_lops =
+static struct cfs_hash_lock_ops cfs_hash_nl_lops =
 {
.hs_lock= cfs_hash_nl_lock,
.hs_unlock  = cfs_hash_nl_unlock,
@@ -164,7 +164,7 @@ static cfs_hash_lock_ops_t cfs_hash_nl_lops =
 };
 
 /** no bucket lock, one spinlock to protect everything */
-static cfs_hash_lock_ops_t cfs_hash_nbl_lops =
+static struct cfs_hash_lock_ops cfs_hash_nbl_lops =
 {
.hs_lock= cfs_hash_spin_lock,
.hs_unlock  = cfs_hash_spin_unlock,
@@ -173,7 +173,7 @@ static cfs_hash_lock_ops_t cfs_hash_nbl_lops =
 };
 
 /** spin bucket lock, rehash is enabled */
-static cfs_hash_lock_ops_t cfs_hash_bkt_spin_lops =
+static struct cfs_hash_lock_ops cfs_hash_bkt_spin_lops =
 {
.hs_lock= cfs_hash_rw_lock,
.hs_unlock  = cfs_hash_rw_unlock,
@@ -182,7 +182,7 @@ static cfs_hash_lock_ops_t cfs_hash_bkt_spin_lops =
 };
 
 /** rw bucket lock, rehash is enabled */
-static cfs_hash_lock_ops_t cfs_hash_bkt_rw_lops =
+static struct cfs_hash_lock_ops cfs_hash_bkt_rw_lops =
 {
.hs_lock= cfs_hash_rw_lock,
.hs_unlock  = cfs_hash_rw_unlock,
@@ -191,7 +191,7 @@ static cfs_hash_lock_ops_t cfs_hash_bkt_rw_lops =
 };
 
 /** spin bucket lock, rehash is disabled */
-static cfs_hash_lock_ops_t cfs_hash_nr_bkt_spin_lops =
+static struct cfs_hash_lock_ops cfs_hash_nr_bkt_spin_lops =
 {
.hs_lock= cfs_hash_nl_lock,
.hs_unlock  = cfs_hash_nl_unlock,
@@ -200,7 +200,7 @@ static cfs_hash_lock_ops_t cfs_hash_nr_bkt_spin_lops =
 };
 
 /** rw bucket lock, rehash is disabled */
-static cfs_hash_lock_ops_t cfs_hash_nr_bkt_rw_lops =
+static struct cfs_hash_lock_ops cfs_hash_nr_bkt_rw_lops =
 {
.hs_lock= cfs_hash_nl_lock,
.hs_unlock  = cfs_hash_nl_unlock,
@@ -209,7 +209,7 @@ static cfs_hash_lock_ops_t cfs_hash_nr_bkt_rw_lops =
 };
 
 static void
-cfs_hash_lock_setup(cfs_hash_t *hs)
+cfs_hash_lock_setup(struct cfs_hash *hs)
 {
if (cfs_hash_with_no_lock(hs)) {
hs-hs_lops = cfs_hash_nl_lops;
@@ -246,13 +246,13 @@ typedef struct {
 } cfs_hash_head_t;
 
 static int
-cfs_hash_hh_hhead_size(cfs_hash_t *hs)
+cfs_hash_hh_hhead_size(struct cfs_hash *hs)
 {
return sizeof(cfs_hash_head_t);
 }
 
 static struct hlist_head *
-cfs_hash_hh_hhead(cfs_hash_t *hs, cfs_hash_bd_t *bd)
+cfs_hash_hh_hhead(struct cfs_hash *hs, struct cfs_hash_bd *bd)
 {
cfs_hash_head_t *head = (cfs_hash_head_t *)bd-bd_bucket-hsb_head[0];
 
@@ -260,7 +260,7 @@ cfs_hash_hh_hhead(cfs_hash_t *hs, cfs_hash_bd_t *bd)
 }
 
 static int
-cfs_hash_hh_hnode_add(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+cfs_hash_hh_hnode_add(struct cfs_hash *hs, struct cfs_hash_bd *bd,
  struct hlist_node *hnode)
 {
hlist_add_head(hnode, cfs_hash_hh_hhead(hs, bd));
@@ -268,7 +268,7 @@ cfs_hash_hh_hnode_add(cfs_hash_t *hs, cfs_hash_bd_t *bd,
 }
 
 static int
-cfs_hash_hh_hnode_del(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+cfs_hash_hh_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd,

[PATCH 18/22] staging: lustre: Update struct variables in lprocfs_status.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in lprocfs_status.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index a95f60a..4b2cb81 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -898,7 +898,7 @@ static void lprocfs_free_client_stats(struct nid_stat 
*client_stat)
 
 void lprocfs_free_per_client_stats(struct obd_device *obd)
 {
-   cfs_hash_t *hash = obd-obd_nid_stats_hash;
+   struct cfs_hash *hash = obd-obd_nid_stats_hash;
struct nid_stat *stat;
 
/* we need extra list - because hash_exit called to early */
@@ -1422,7 +1422,7 @@ void lprocfs_init_ldlm_stats(struct lprocfs_stats 
*ldlm_stats)
 }
 EXPORT_SYMBOL(lprocfs_init_ldlm_stats);
 
-int lprocfs_exp_print_uuid(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+int lprocfs_exp_print_uuid(struct cfs_hash *hs, struct cfs_hash_bd *bd,
   struct hlist_node *hnode, void *data)
 
 {
@@ -1453,7 +1453,7 @@ struct exp_hash_cb_data {
boolfirst;
 };
 
-int lprocfs_exp_print_hash(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+int lprocfs_exp_print_hash(struct cfs_hash *hs, struct cfs_hash_bd *bd,
   struct hlist_node *hnode, void *cb_data)
 
 {
-- 
1.8.1.2

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


[PATCH 13/22] staging: lustre: Update struct variables in ldlm_lockd.c

2013-10-20 Thread Lisa Nguyen
Assuming the patch to update the structs in libcfs_hash header
file has been applied, this patch will update the struct variables
in ldlm_lockd.c to avoid build errors.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index a100a0b..9c77e0a 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -937,7 +937,7 @@ EXPORT_SYMBOL(ldlm_put_ref);
  * Export handle-lock hash operations.
  */
 static unsigned
-ldlm_export_lock_hash(cfs_hash_t *hs, const void *key, unsigned mask)
+ldlm_export_lock_hash(struct cfs_hash *hs, const void *key, unsigned mask)
 {
return cfs_hash_u64_hash(((struct lustre_handle *)key)-cookie, mask);
 }
@@ -973,7 +973,7 @@ ldlm_export_lock_object(struct hlist_node *hnode)
 }
 
 static void
-ldlm_export_lock_get(cfs_hash_t *hs, struct hlist_node *hnode)
+ldlm_export_lock_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct ldlm_lock *lock;
 
@@ -982,7 +982,7 @@ ldlm_export_lock_get(cfs_hash_t *hs, struct hlist_node 
*hnode)
 }
 
 static void
-ldlm_export_lock_put(cfs_hash_t *hs, struct hlist_node *hnode)
+ldlm_export_lock_put(struct cfs_hash *hs, struct hlist_node *hnode)
 {
struct ldlm_lock *lock;
 
@@ -990,7 +990,7 @@ ldlm_export_lock_put(cfs_hash_t *hs, struct hlist_node 
*hnode)
LDLM_LOCK_RELEASE(lock);
 }
 
-static cfs_hash_ops_t ldlm_export_lock_ops = {
+static struct cfs_hash_ops ldlm_export_lock_ops = {
.hs_hash= ldlm_export_lock_hash,
.hs_key  = ldlm_export_lock_key,
.hs_keycmp  = ldlm_export_lock_keycmp,
-- 
1.8.1.2

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


Re: [PATCH] staging: lustre: libcfs: Remove bitmap.h file

2013-10-20 Thread Dan Carpenter
On Sun, Oct 20, 2013 at 09:06:18AM -0700, Lisa Nguyen wrote:
 The functions in the bitmap.h header file are not being used by
 any source file in the lustre driver.
 
 Unless there are any objections, please remove the bitmap.h
 header file as it contains unused code in the kernel.
 

I'm in an airport so I can't test this, but did you try to recompile the
driver afterward?  I think you need to delete an include as well.

regards,
dan carpenter

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


Re: [PATCH 01/22] staging: lustre: Remove all new typedefs in libcfs_hash.h

2013-10-20 Thread Greg KH
On Sun, Oct 20, 2013 at 03:45:46PM -0700, Lisa Nguyen wrote:
 Modified all structs in libcfs_hash header file to eliminate
 the Do not add new typedefs warning generated by checkpatch.pl
 and meet kernel coding style.
 
 Signed-off-by: Lisa Nguyen l...@xenapiadmin.com

This patch breaks the build so badly, I know you didn't test it alone :(

Your follow-on patches do fix up the build breakage, which is nice, but
you can never break the build with any individual patch, that's not how
kernel development works, sorry.

So, can you change this to just fix one typedef at a time, for the whole
chunk of code?  That should be managable, and reviewable, instead of
having to put all 22 patches here into one big patch (which isn't ok.)

thanks,

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


Re: [PATCH 01/22] staging: lustre: Remove all new typedefs in libcfs_hash.h

2013-10-20 Thread Dan Carpenter
On Sun, Oct 20, 2013 at 03:45:46PM -0700, Lisa Nguyen wrote:
 Modified all structs in libcfs_hash header file to eliminate
 the Do not add new typedefs warning generated by checkpatch.pl
 and meet kernel coding style.
 

Can you redo this whole series?

The driver needs to be able to recompiled after each patch.  Otherwise
it breaks git bisect. So for example, this patch should modify
drivers/staging/lustre/lustre/libcfs/hash.c as well as the .h file.

regards,
dan carpenter



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


Re: [PATCH 01/22] staging: lustre: Remove all new typedefs in libcfs_hash.h

2013-10-20 Thread Lisa Nguyen
On Sun, Oct 20, 2013 at 8:23 PM, Greg KH gre...@linuxfoundation.org wrote:
 On Sun, Oct 20, 2013 at 03:45:46PM -0700, Lisa Nguyen wrote:
 Modified all structs in libcfs_hash header file to eliminate
 the Do not add new typedefs warning generated by checkpatch.pl
 and meet kernel coding style.

 Signed-off-by: Lisa Nguyen l...@xenapiadmin.com

 This patch breaks the build so badly, I know you didn't test it alone :(

 Your follow-on patches do fix up the build breakage, which is nice, but
 you can never break the build with any individual patch, that's not how
 kernel development works, sorry.


Good to know. Something new I learned today and will know how to keep
maintainers happy :)

 So, can you change this to just fix one typedef at a time, for the whole
 chunk of code?  That should be managable, and reviewable, instead of
 having to put all 22 patches here into one big patch (which isn't ok.)

 thanks,

 greg k-h

I will do one typedef at a time and will resend for feedback.

Please ignore this patch series. I will create a new patchset to
modify one typedef at a time before I send more.

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


Re: [PATCH 00/22] staging: lustre: Update structs

2013-10-20 Thread Lisa Nguyen
On Sun, Oct 20, 2013 at 8:07 PM, Peng, Tao tao.p...@emc.com wrote:
 Hi Lisa,

 Thanks for the patch. I assume you were using coccinelle (or sed) to do the 
 conversion. Are there change done by hand other than scripting? Can you 
 please also put your scripts (such as in [PATCH 01/22]) in the commit message?

 Thanks,
 Tao


Hi Tao,

I didn't use any other script besides checkpatch.pl, which was
included in the kernel source code under the scripts directory. I used
sed to make replacements in vim for each file and relied on cscope and
grep to detect all the dependent files.

If there are other scripts I used, I will make a note of it in my
commit message(s).

After receiving feedback from Dan and Greg, I will respin a new patch
series to change one typedef at a time, rather than multiple ones for
one header file as I learned more about the building process.

Hope this answers your question and let me know if anything comes up.

Thanks,
Lisa

-Original Message-
From: Lisa Nguyen [mailto:l...@xenapiadmin.com]
Sent: Monday, October 21, 2013 6:45 AM
To: gre...@linuxfoundation.org
Cc: Peng, Tao; andreas.dil...@intel.com; de...@driverdev.osuosl.org
Subject: [PATCH 00/22] staging: lustre: Update structs

This patchset includes all the changes needed to update the structs defined in
libcfs_hash.h. Doing this will eliminate the Do not add new typedefs warning
generated by checkpatch.pl and the updated format of those structs will meet
kernel coding style.

Other header files and certain source files that use functions and structs
defined in libcfs_hash.h have updated struct variables.

I have CC'ed the lustre driver authors to keep them informed of this update.

Questions and comments are welcomed.

Lisa Nguyen (22):
  staging: lustre: Remove all new typedefs in libcfs_hash.h
  staging: lustre: Update struct variables in lu_object.h
  staging: lustre: Update struct variables in lustre_dlm.h
  staging: lustre: Update struct variables in lustre_export.h
  staging: lustre: Update struct variables in lustre_net.h
  staging: lustre: Update struct variables in obd.h
  staging: lustre: Update struct variables in lov_internal.h
  staging: lustre: Update struct variables in hash.c
  staging: lustre: Update struct variables in ldlm_flock.c
  staging: lustre: Update struct variables in ldlm_lock.c
  staging: lustre: Update struct variables in ldlm_request.c
  staging: lustre: Update struct variables in ldlm_resource.c
  staging: lustre: Update struct variables in ldlm_lockd.c
  staging: lustre: Update struct variables in vvp_dev.c
  staging: lustre: Update struct variables in lov_pool.c
  staging: lustre: Update struct variables in cl_object.c
  staging: lustre: Update struct variables in genops.c
  staging: lustre: Update struct variables in lprocfs_status.c
  staging: lustre: Update struct variables in lu_object.c
  staging: lustre: Update struct variables in obd_config.c
  staging: lustre: Update struct variables in osc_quota.c
  staging: lustre: Update struct variables in connection.c

 .../lustre/include/linux/libcfs/libcfs_hash.h  | 280 
 ++---
 drivers/staging/lustre/lustre/include/lu_object.h  |   4 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |   2 +-
 .../staging/lustre/lustre/include/lustre_export.h  |   4 +-
 drivers/staging/lustre/lustre/include/lustre_net.h |   4 +-
 drivers/staging/lustre/lustre/include/obd.h|  10 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c|   8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |   4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c|   8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  34 +--
 drivers/staging/lustre/lustre/libcfs/hash.c| 270 ++--
 drivers/staging/lustre/lustre/llite/vvp_dev.c  |   2 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |   2 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c   |   8 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c |   8 +-
 drivers/staging/lustre/lustre/obdclass/genops.c|   6 +-
 .../lustre/lustre/obdclass/lprocfs_status.c|   6 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  42 ++--
 .../staging/lustre/lustre/obdclass/obd_config.c|  28 +--
 drivers/staging/lustre/lustre/osc/osc_quota.c  |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/connection.c  |  14 +-
 22 files changed, 379 insertions(+), 379 deletions(-)

--
1.8.1.2


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


[PATCH] staging: lustre: Remove typedef and update cfs_hash_lock union

2013-10-20 Thread Lisa Nguyen
Remove typedef keyword and rename the cfs_hash_lock_t
union to cfs_hash_lock in libcfs_hash.h. These changes
resolve the Do not add new typedefs warning
generated by checkpatch.pl and meet kernel coding style.

The union variables in hash.c are updated to reflect this
change as well.

Signed-off-by: Lisa Nguyen l...@xenapiadmin.com
---
 .../staging/lustre/include/linux/libcfs/libcfs_hash.h| 16 
 drivers/staging/lustre/lustre/libcfs/hash.c  | 12 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 98f5be2..b06505d 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -81,10 +81,10 @@ struct cfs_hash_ops;
 struct cfs_hash_lock_ops;
 struct cfs_hash_hlist_ops;
 
-typedef union {
+union cfs_hash_lock {
rwlock_trw; /** rwlock */
spinlock_t  spin;   /** spinlock */
-} cfs_hash_lock_t;
+};
 
 /**
  * cfs_hash_bucket is a container of:
@@ -98,7 +98,7 @@ typedef union {
  * - some extra bytes (caller can require it while creating hash)
  */
 typedef struct cfs_hash_bucket {
-   cfs_hash_lock_t hsb_lock;   /** bucket lock */
+   union cfs_hash_lock hsb_lock;   /** bucket lock */
__u32   hsb_count;  /** current entries */
__u32   hsb_version;/** change version */
unsigned inthsb_index;  /** index of bucket */
@@ -213,7 +213,7 @@ enum cfs_hash_tag {
 typedef struct cfs_hash {
/** serialize with rehash, or serialize all operations if
 * the hash-table has CFS_HASH_NO_BKTLOCK */
-   cfs_hash_lock_t  hs_lock;
+   union cfs_hash_lock  hs_lock;
/** hash operations */
struct cfs_hash_ops *hs_ops;
/** hash lock operations */
@@ -276,13 +276,13 @@ typedef struct cfs_hash {
 
 typedef struct cfs_hash_lock_ops {
/** lock the hash table */
-   void(*hs_lock)(cfs_hash_lock_t *lock, int exclusive);
+   void(*hs_lock)(union cfs_hash_lock *lock, int exclusive);
/** unlock the hash table */
-   void(*hs_unlock)(cfs_hash_lock_t *lock, int exclusive);
+   void(*hs_unlock)(union cfs_hash_lock *lock, int exclusive);
/** lock the hash bucket */
-   void(*hs_bkt_lock)(cfs_hash_lock_t *lock, int exclusive);
+   void(*hs_bkt_lock)(union cfs_hash_lock *lock, int exclusive);
/** unlock the hash bucket */
-   void(*hs_bkt_unlock)(cfs_hash_lock_t *lock, int exclusive);
+   void(*hs_bkt_unlock)(union cfs_hash_lock *lock, int exclusive);
 } cfs_hash_lock_ops_t;
 
 typedef struct cfs_hash_hlist_ops {
diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c 
b/drivers/staging/lustre/lustre/libcfs/hash.c
index 29ce380..b0b8e3f 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -119,25 +119,25 @@ CFS_MODULE_PARM(warn_on_depth, i, uint, 0644,
 struct cfs_wi_sched *cfs_sched_rehash;
 
 static inline void
-cfs_hash_nl_lock(cfs_hash_lock_t *lock, int exclusive) {}
+cfs_hash_nl_lock(union cfs_hash_lock *lock, int exclusive) {}
 
 static inline void
-cfs_hash_nl_unlock(cfs_hash_lock_t *lock, int exclusive) {}
+cfs_hash_nl_unlock(union cfs_hash_lock *lock, int exclusive) {}
 
 static inline void
-cfs_hash_spin_lock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_spin_lock(union cfs_hash_lock *lock, int exclusive)
 {
spin_lock(lock-spin);
 }
 
 static inline void
-cfs_hash_spin_unlock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_spin_unlock(union cfs_hash_lock *lock, int exclusive)
 {
spin_unlock(lock-spin);
 }
 
 static inline void
-cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_rw_lock(union cfs_hash_lock *lock, int exclusive)
 {
if (!exclusive)
read_lock(lock-rw);
@@ -146,7 +146,7 @@ cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive)
 }
 
 static inline void
-cfs_hash_rw_unlock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_rw_unlock(union cfs_hash_lock *lock, int exclusive)
 {
if (!exclusive)
read_unlock(lock-rw);
-- 
1.8.1.2

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