patch] inotify: use bitmap.h functions
From: Robert Love (rml_at_novell.com)
Date: 09/27/04
- Previous message: Wolfgang Walter: "Re: mlock(1)"
- In reply to: Paul Jackson: "Re: [RFC][PATCH] inotify 0.10.0"
- Next in thread: Paul Jackson: "Re: patch] inotify: use bitmap.h functions"
- Reply: Paul Jackson: "Re: patch] inotify: use bitmap.h functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Paul Jackson <pj@sgi.com> Date: Mon, 27 Sep 2004 16:22:15 -0400
On Mon, 2004-09-27 at 12:48 -0700, Paul Jackson wrote:
> > unsigned long bitmask[MAX_INOTIFY_DEV_WATCHERS/BITS_PER_LONG];
>
> This assumes that MAX_INOTIFY_DEV_WATCHERS is an integral multiple
> of BITS_PER_LONG, otherwise, the last word will be missing.
Yah. Since we defined MAX_INOTIFY_DEV_WATCHERS, I presumed to be able
to ensure it was a multiple (e.g. just keep it a power of two) ...
> Perhaps this would this better be written as:
>
> DECLARE_BITMAP(bitmask, MAX_INOTIFY_DEV_WATCHERS);
... but this is indeed cleaner.
> and the clearing of it in the original patch:
>
> > + memset(dev->bitmask, 0,
> > + sizeof(unsigned long) * MAX_INOTIFY_DEV_WATCHERS / BITS_PER_LONG);
>
> might better be written as:
>
> CLEAR_BITMAP(dev->bitmask, MAX_INOTIFY_DEV_WATCHERS);
I think you mean bitmap_zero(), but yah. Agreed.
John, here is a patch to use the bitmap.h functions to manipulate the
bitmap.
Robert Love
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- text/x-patch attachment: inotify-rml-use-bitmaps-1.patch__charset_UTF-8
- Previous message: Wolfgang Walter: "Re: mlock(1)"
- In reply to: Paul Jackson: "Re: [RFC][PATCH] inotify 0.10.0"
- Next in thread: Paul Jackson: "Re: patch] inotify: use bitmap.h functions"
- Reply: Paul Jackson: "Re: patch] inotify: use bitmap.h functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|