Re: lock_kernel() usage and sync_*() functions

Ingo Oeser (ingo.oeser@informatik.tu-chemnitz.de)
Thu, 22 Mar 2001 15:45:44 +0100


On Thu, Mar 22, 2001 at 12:18:27AM -0500, Alexander Viro wrote:
>
> I started with adding
> void invalidate_dev(kdev_t dev, int sync_flag)
> {
> struct super_block *sb = get_super(dev);
> if (sync_flag == 1)
> sync_dev(dev);
> else if (sync_flag == 2)
> fsync_dev(dev);
> if (sb) {
> invalidate_inodes(sb);
> /* drop_super(sb); here */
> }
> invalidate_buffers(dev);
> }

Could we remove the "magic" sync_flag from the exported interface?

Do sth. like renaming your invalidate_dev() to
_invalidate_dev() and adding 3 defines:

#define invalidate_dev(dev) _invalidate_dev(dev,0)
#define invalidate_dev_sync(dev) _invalidate_dev(dev,1)
#define invalidate_dev_fsync(dev) _invalidate_dev(dev,2)

This would make it quite clear, what will be done.

AFAIR Linus dosn't like these magic numers either, right?

Regards

Ingo Oeser

-- 
10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag>
         <<<<<<<<<<<<     been there and had much fun   >>>>>>>>>>>>
-
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/