hpfs_fn.h (03351ff4d897098a590cb247b6eebc470b8ecb5a) hpfs_fn.h (7dd29d8d865efdb00c0542a5d2c87af8c52ea6c7)
1/*
2 * linux/fs/hpfs/hpfs_fn.h
3 *
4 * Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz), 1998-1999
5 *
6 * function headers
7 */
8

--- 49 unchanged lines hidden (view full) ---

58 unsigned i_dirty : 1;
59 struct mutex i_mutex;
60 struct mutex i_parent_mutex;
61 loff_t **i_rddir_off;
62 struct inode vfs_inode;
63};
64
65struct hpfs_sb_info {
1/*
2 * linux/fs/hpfs/hpfs_fn.h
3 *
4 * Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz), 1998-1999
5 *
6 * function headers
7 */
8

--- 49 unchanged lines hidden (view full) ---

58 unsigned i_dirty : 1;
59 struct mutex i_mutex;
60 struct mutex i_parent_mutex;
61 loff_t **i_rddir_off;
62 struct inode vfs_inode;
63};
64
65struct hpfs_sb_info {
66 struct mutex hpfs_mutex; /* global hpfs lock */
66 ino_t sb_root; /* inode number of root dir */
67 unsigned sb_fs_size; /* file system size, sectors */
68 unsigned sb_bitmaps; /* sector number of bitmap list */
69 unsigned sb_dirband_start; /* directory band start sector */
70 unsigned sb_dirband_size; /* directory band size, dnodes */
71 unsigned sb_dmap; /* sector number of dnode bit map */
72 unsigned sb_n_free; /* free blocks for statfs, or -1 */
73 unsigned sb_n_free_dnodes; /* free dnodes for statfs, or -1 */

--- 267 unchanged lines hidden (view full) ---

341{
342 extern struct timezone sys_tz;
343 return t - sys_tz.tz_minuteswest * 60 - hpfs_sb(s)->sb_timeshift;
344}
345
346/*
347 * Locking:
348 *
67 ino_t sb_root; /* inode number of root dir */
68 unsigned sb_fs_size; /* file system size, sectors */
69 unsigned sb_bitmaps; /* sector number of bitmap list */
70 unsigned sb_dirband_start; /* directory band start sector */
71 unsigned sb_dirband_size; /* directory band size, dnodes */
72 unsigned sb_dmap; /* sector number of dnode bit map */
73 unsigned sb_n_free; /* free blocks for statfs, or -1 */
74 unsigned sb_n_free_dnodes; /* free dnodes for statfs, or -1 */

--- 267 unchanged lines hidden (view full) ---

342{
343 extern struct timezone sys_tz;
344 return t - sys_tz.tz_minuteswest * 60 - hpfs_sb(s)->sb_timeshift;
345}
346
347/*
348 * Locking:
349 *
349 * hpfs_lock() is a leftover from the big kernel lock.
350 * Right now, these functions are empty and only left
351 * for documentation purposes. The file system no longer
352 * works on SMP systems, so the lock is not needed
353 * any more.
350 * hpfs_lock() locks the whole filesystem. It must be taken
351 * on any method called by the VFS.
354 *
352 *
355 * If someone is interested in making it work again, this
356 * would be the place to start by adding a per-superblock
357 * mutex and fixing all the bugs and performance issues
358 * caused by that.
353 * We don't do any per-file locking anymore, it is hard to
354 * review and HPFS is not performance-sensitive anyway.
359 */
360static inline void hpfs_lock(struct super_block *s)
361{
355 */
356static inline void hpfs_lock(struct super_block *s)
357{
358 struct hpfs_sb_info *sbi = hpfs_sb(s);
359 mutex_lock(&sbi->hpfs_mutex);
362}
363
364static inline void hpfs_unlock(struct super_block *s)
365{
360}
361
362static inline void hpfs_unlock(struct super_block *s)
363{
364 struct hpfs_sb_info *sbi = hpfs_sb(s);
365 mutex_unlock(&sbi->hpfs_mutex);
366}
366}
367
368static inline void hpfs_lock_assert(struct super_block *s)
369{
370 struct hpfs_sb_info *sbi = hpfs_sb(s);
371 WARN_ON(!mutex_is_locked(&sbi->hpfs_mutex));
372}