The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/fs/jfs/jfs_incore.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  *   Copyright (c) International Business Machines Corp., 2000-2002
    3  *   Portions Copyright (c) Christoph Hellwig, 2001-2002
    4  *
    5  *   This program is free software;  you can redistribute it and/or modify
    6  *   it under the terms of the GNU General Public License as published by
    7  *   the Free Software Foundation; either version 2 of the License, or 
    8  *   (at your option) any later version.
    9  * 
   10  *   This program is distributed in the hope that it will be useful,
   11  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
   12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
   13  *   the GNU General Public License for more details.
   14  *
   15  *   You should have received a copy of the GNU General Public License
   16  *   along with this program;  if not, write to the Free Software 
   17  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
   18  */ 
   19 #ifndef _H_JFS_INCORE
   20 #define _H_JFS_INCORE
   21 
   22 #include <linux/rwsem.h>
   23 #include <linux/slab.h>
   24 #include <asm/bitops.h>
   25 #include "jfs_types.h"
   26 #include "jfs_xtree.h"
   27 #include "jfs_dtree.h"
   28 
   29 /*
   30  * JFS magic number
   31  */
   32 #define JFS_SUPER_MAGIC 0x3153464a /* "JFS1" */
   33 
   34 /*
   35  * JFS-private inode information
   36  */
   37 struct jfs_inode_info {
   38         struct inode *inode;    /* pointer back to fs-independent inode */
   39         int     fileset;        /* fileset number (always 16)*/
   40         uint    mode2;          /* jfs-specific mode            */
   41         pxd_t   ixpxd;          /* inode extent descriptor      */
   42         dxd_t   acl;            /* dxd describing acl   */
   43         dxd_t   ea;             /* dxd describing ea    */
   44         time_t  otime;          /* time created */
   45         uint    next_index;     /* next available directory entry index */
   46         int     acltype;        /* Type of ACL  */
   47         short   btorder;        /* access order */
   48         short   btindex;        /* btpage entry index*/
   49         struct inode *ipimap;   /* inode map                    */
   50         long    cflag;          /* commit flags         */
   51         u16     bxflag;         /* xflag of pseudo buffer?      */
   52         unchar  agno;           /* ag number                    */
   53         signed char active_ag;  /* ag currently allocating from */
   54         lid_t   blid;           /* lid of pseudo buffer?        */
   55         lid_t   atlhead;        /* anonymous tlock list head    */
   56         lid_t   atltail;        /* anonymous tlock list tail    */
   57         struct list_head anon_inode_list; /* inodes having anonymous txns */
   58         /*
   59          * rdwrlock serializes xtree between reads & writes and synchronizes
   60          * changes to special inodes.  It's use would be redundant on
   61          * directories since the i_sem taken in the VFS is sufficient.
   62          */
   63         struct rw_semaphore rdwrlock;
   64         /*
   65          * commit_sem serializes transaction processing on an inode.
   66          * It must be taken after beginning a transaction (txBegin), since
   67          * dirty inodes may be committed while a new transaction on the
   68          * inode is blocked in txBegin or TxBeginAnon
   69          */
   70         struct semaphore commit_sem;
   71         lid_t   xtlid;          /* lid of xtree lock on directory */
   72         union {
   73                 struct {
   74                         xtpage_t _xtroot;       /* 288: xtree root */
   75                         struct inomap *_imap;   /* 4: inode map header  */
   76                 } file;
   77                 struct {
   78                         struct dir_table_slot _table[12]; /* 96: dir index */
   79                         dtroot_t _dtroot;       /* 288: dtree root */
   80                 } dir;
   81                 struct {
   82                         unchar _unused[16];     /* 16: */
   83                         dxd_t _dxd;             /* 16: */
   84                         unchar _inline[128];    /* 128: inline symlink */
   85                         /* _inline_ea may overlay the last part of
   86                          * file._xtroot if maxentry = XTROOTINITSLOT
   87                          */
   88                         unchar _inline_ea[128]; /* 128: inline extended attr */
   89                 } link;
   90         } u;
   91 };
   92 #define i_xtroot u.file._xtroot
   93 #define i_imap u.file._imap
   94 #define i_dirtable u.dir._table
   95 #define i_dtroot u.dir._dtroot
   96 #define i_inline u.link._inline
   97 #define i_inline_ea u.link._inline_ea
   98 
   99 
  100 #define IREAD_LOCK(ip)          down_read(&JFS_IP(ip)->rdwrlock)
  101 #define IREAD_UNLOCK(ip)        up_read(&JFS_IP(ip)->rdwrlock)
  102 #define IWRITE_LOCK(ip)         down_write(&JFS_IP(ip)->rdwrlock)
  103 #define IWRITE_UNLOCK(ip)       up_write(&JFS_IP(ip)->rdwrlock)
  104 
  105 /*
  106  * cflag
  107  */
  108 enum cflags {
  109         COMMIT_New,             /* never committed inode   */
  110         COMMIT_Nolink,          /* inode committed with zero link count */
  111         COMMIT_Inlineea,        /* commit inode inline EA */
  112         COMMIT_Freewmap,        /* free WMAP at iClose() */
  113         COMMIT_Dirty,           /* Inode is really dirty */
  114         COMMIT_Dirtable,        /* commit changes to di_dirtable */
  115         COMMIT_Stale,           /* data extent is no longer valid */
  116         COMMIT_Synclist,        /* metadata pages on group commit synclist */
  117         COMMIT_Syncdata,        /* Data must be synced before inode committed */
  118 };
  119 
  120 #define set_cflag(flag, ip)     set_bit(flag, &(JFS_IP(ip)->cflag))
  121 #define clear_cflag(flag, ip)   clear_bit(flag, &(JFS_IP(ip)->cflag))
  122 #define test_cflag(flag, ip)    test_bit(flag, &(JFS_IP(ip)->cflag))
  123 #define test_and_clear_cflag(flag, ip) \
  124         test_and_clear_bit(flag, &(JFS_IP(ip)->cflag))
  125 /*
  126  * JFS-private superblock information.
  127  */
  128 struct jfs_sb_info {
  129         unsigned long   mntflag;        /* 4: aggregate attributes      */
  130         struct inode    *ipbmap;        /* 4: block map inode           */
  131         struct inode    *ipaimap;       /* 4: aggregate inode map inode */
  132         struct inode    *ipaimap2;      /* 4: secondary aimap inode     */
  133         struct inode    *ipimap;        /* 4: aggregate inode map inode */
  134         struct jfs_log  *log;           /* 4: log                       */
  135         short           bsize;          /* 2: logical block size        */
  136         short           l2bsize;        /* 2: log2 logical block size   */
  137         short           nbperpage;      /* 2: blocks per page           */
  138         short           l2nbperpage;    /* 2: log2 blocks per page      */
  139         short           l2niperblk;     /* 2: log2 inodes per page      */
  140         kdev_t          logdev;         /* 2: external log device       */
  141         uint            aggregate;      /* volume identifier in log record */
  142         pxd_t           logpxd;         /* 8: pxd describing log        */
  143         pxd_t           fsckpxd;        /* 8: pxd describing fsck wkspc */
  144         pxd_t           ait2;           /* 8: pxd describing AIT copy   */
  145         char            uuid[16];       /* 16: 128-bit uuid for volume  */
  146         char            loguuid[16];    /* 16: 128-bit uuid for log     */
  147         /* Formerly in ipimap */
  148         uint            gengen;         /* 4: inode generation generator*/
  149         uint            inostamp;       /* 4: shows inode belongs to fileset*/
  150 
  151         /* Formerly in ipbmap */
  152         struct bmap     *bmap;          /* 4: incore bmap descriptor    */
  153         struct nls_table *nls_tab;      /* 4: current codepage          */
  154         uint            state;          /* 4: mount/recovery state      */
  155 };
  156 
  157 static inline struct jfs_inode_info *JFS_IP(struct inode *inode)
  158 {
  159         return inode->u.generic_ip;
  160 }
  161 
  162 static inline struct jfs_sb_info *JFS_SBI(struct super_block *sb)
  163 {
  164         return sb->u.generic_sbp;
  165 }
  166 
  167 static inline int isReadOnly(struct inode *inode)
  168 {
  169         if (JFS_SBI(inode->i_sb)->log)
  170                 return 0;
  171         return 1;
  172 }
  173 
  174 /*
  175  * Allocating and freeing the structure
  176  */
  177 extern kmem_cache_t *jfs_inode_cachep;
  178 extern int alloc_jfs_inode(struct inode *);
  179 
  180 #define free_jfs_inode(inode) \
  181         kmem_cache_free(jfs_inode_cachep, (inode)->u.generic_ip)
  182 
  183 #endif /* _H_JFS_INCORE */

Cache object: a6c99dabd9a53e5babf85019ce479943


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.