[Click] [PATCH 08/12] clickfs: typecast f_count to const

Eddie Kohler kohler at cs.ucla.edu
Wed Sep 29 19:41:41 EDT 2010


Hi,

This is an incorrect patch.  If atomic_t and atomic_long_t are different 
sizes, aotmic_read will return the wrong result.  I've checked in  adifferent 
version.

E


On 09/25/2010 10:30 PM, Joonwoo Park wrote:
> Signed-off-by: Joonwoo Park<joonwpark81 at gmail.com>
> ---
>   linuxmodule/clickfs.cc |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/linuxmodule/clickfs.cc b/linuxmodule/clickfs.cc
> index 5981a4f..ffdd5a9 100644
> --- a/linuxmodule/clickfs.cc
> +++ b/linuxmodule/clickfs.cc
> @@ -787,7 +787,7 @@ handler_flush(struct file *filp
>       int stringno = FILP_WRITE_STRINGNO(filp);
>       int retval = 0;
>
> -    int f_count = atomic_read(&filp->f_count);
> +    int f_count = atomic_read((const atomic_t*)&filp->f_count);
>
>       if (writing&&  f_count == 1
>   	&&  stringno>= 0&&  stringno<  handler_strings_cap


More information about the click mailing list