Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[pandora-kernel.git] / fs / jfs / jfs_incore.h
index c0fd7b3..cb8f309 100644 (file)
@@ -4,21 +4,22 @@
  *
  *   This program is free software;  you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or 
+ *   the Free Software Foundation; either version 2 of the License, or
  *   (at your option) any later version.
- * 
+ *
  *   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 for more details.
  *
  *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software 
+ *   along with this program;  if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */ 
+ */
 #ifndef _H_JFS_INCORE
 #define _H_JFS_INCORE
 
+#include <linux/mutex.h>
 #include <linux/rwsem.h>
 #include <linux/slab.h>
 #include <linux/bitops.h>
@@ -37,7 +38,9 @@
 struct jfs_inode_info {
        int     fileset;        /* fileset number (always 16)*/
        uint    mode2;          /* jfs-specific mode            */
-       pxd_t   ixpxd;          /* inode extent descriptor      */
+       uint    saved_uid;      /* saved for uid mount option */
+       uint    saved_gid;      /* saved for gid mount option */
+       pxd_t   ixpxd;          /* inode extent descriptor      */
        dxd_t   acl;            /* dxd describing acl   */
        dxd_t   ea;             /* dxd describing ea    */
        time_t  otime;          /* time created */
@@ -58,17 +61,17 @@ struct jfs_inode_info {
        /*
         * rdwrlock serializes xtree between reads & writes and synchronizes
         * changes to special inodes.  It's use would be redundant on
-        * directories since the i_sem taken in the VFS is sufficient.
+        * directories since the i_mutex taken in the VFS is sufficient.
         */
        struct rw_semaphore rdwrlock;
        /*
-        * commit_sem serializes transaction processing on an inode.
+        * commit_mutex serializes transaction processing on an inode.
         * It must be taken after beginning a transaction (txBegin), since
         * dirty inodes may be committed while a new transaction on the
         * inode is blocked in txBegin or TxBeginAnon
         */
-       struct semaphore commit_sem;
-       /* xattr_sem allows us to access the xattrs without taking i_sem */
+       struct mutex commit_mutex;
+       /* xattr_sem allows us to access the xattrs without taking i_mutex */
        struct rw_semaphore xattr_sem;
        lid_t   xtlid;          /* lid of xtree lock on directory */
 #ifdef CONFIG_JFS_POSIX_ACL
@@ -106,9 +109,11 @@ struct jfs_inode_info {
 
 #define JFS_ACL_NOT_CACHED ((void *)-1)
 
-#define IREAD_LOCK(ip)         down_read(&JFS_IP(ip)->rdwrlock)
+#define IREAD_LOCK(ip, subclass) \
+       down_read_nested(&JFS_IP(ip)->rdwrlock, subclass)
 #define IREAD_UNLOCK(ip)       up_read(&JFS_IP(ip)->rdwrlock)
-#define IWRITE_LOCK(ip)                down_write(&JFS_IP(ip)->rdwrlock)
+#define IWRITE_LOCK(ip, subclass) \
+       down_write_nested(&JFS_IP(ip)->rdwrlock, subclass)
 #define IWRITE_UNLOCK(ip)      up_write(&JFS_IP(ip)->rdwrlock)
 
 /*
@@ -124,6 +129,29 @@ enum cflags {
        COMMIT_Synclist,        /* metadata pages on group commit synclist */
 };
 
+/*
+ * commit_mutex nesting subclasses:
+ */
+enum commit_mutex_class
+{
+       COMMIT_MUTEX_PARENT,
+       COMMIT_MUTEX_CHILD,
+       COMMIT_MUTEX_SECOND_PARENT,     /* Renaming */
+       COMMIT_MUTEX_VICTIM             /* Inode being unlinked due to rename */
+};
+
+/*
+ * rdwrlock subclasses:
+ * The dmap inode may be locked while a normal inode or the imap inode are
+ * locked.
+ */
+enum rdwrlock_class
+{
+       RDWRLOCK_NORMAL,
+       RDWRLOCK_IMAP,
+       RDWRLOCK_DMAP
+};
+
 #define set_cflag(flag, ip)    set_bit(flag, &(JFS_IP(ip)->cflag))
 #define clear_cflag(flag, ip)  clear_bit(flag, &(JFS_IP(ip)->cflag))
 #define test_cflag(flag, ip)   test_bit(flag, &(JFS_IP(ip)->cflag))
@@ -162,13 +190,16 @@ struct jfs_sb_info {
        uint            gengen;         /* inode generation generator*/
        uint            inostamp;       /* shows inode belongs to fileset*/
 
-        /* Formerly in ipbmap */
+       /* Formerly in ipbmap */
        struct bmap     *bmap;          /* incore bmap descriptor       */
        struct nls_table *nls_tab;      /* current codepage             */
        struct inode *direct_inode;     /* metadata inode */
        uint            state;          /* mount/recovery state */
        unsigned long   flag;           /* mount time flags */
        uint            p_state;        /* state prior to going no integrity */
+       uint            uid;            /* uid to override on-disk uid */
+       uint            gid;            /* gid to override on-disk gid */
+       uint            umask;          /* umask to override on-disk umask */
 };
 
 /* jfs_sb_info commit_state */