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_metapage.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_METAPAGE
   20 #define _H_JFS_METAPAGE
   21 
   22 #include <linux/pagemap.h>
   23 
   24 struct metapage {
   25         /* Common logsyncblk prefix (see jfs_logmgr.h) */
   26         u16 xflag;
   27         u16 unused;
   28         lid_t lid;
   29         int lsn;
   30         struct list_head synclist;
   31         /* End of logsyncblk prefix */
   32 
   33         unsigned long flag;     /* See Below */
   34         unsigned long count;    /* Reference count */
   35         void *data;             /* Data pointer */
   36 
   37         /* list management stuff */
   38         struct metapage *hash_prev;
   39         struct metapage *hash_next;     /* Also used for free list */
   40 
   41         /*
   42          * mapping & index become redundant, but we need these here to
   43          * add the metapage to the hash before we have the real page
   44          */
   45         struct address_space *mapping;
   46         unsigned long index;
   47         wait_queue_head_t wait;
   48 
   49         /* implementation */
   50         struct page *page;
   51         unsigned long logical_size;
   52 
   53         /* Journal management */
   54         int clsn;
   55         atomic_t nohomeok;
   56         struct jfs_log *log;
   57 };
   58 
   59 /* metapage flag */
   60 #define META_locked     0
   61 #define META_absolute   1
   62 #define META_free       2
   63 #define META_dirty      3
   64 #define META_sync       4
   65 #define META_discard    5
   66 #define META_forced     6
   67 
   68 #define mark_metapage_dirty(mp) set_bit(META_dirty, &(mp)->flag)
   69 
   70 /* function prototypes */
   71 extern struct metapage *__get_metapage(struct inode *inode,
   72                                   unsigned long lblock, unsigned int size,
   73                                   int absolute, unsigned long new);
   74 
   75 #define read_metapage(inode, lblock, size, absolute)\
   76          __get_metapage(inode, lblock, size, absolute, FALSE)
   77 
   78 #define get_metapage(inode, lblock, size, absolute)\
   79          __get_metapage(inode, lblock, size, absolute, TRUE)
   80 
   81 extern void release_metapage(struct metapage *);
   82 extern void hold_metapage(struct metapage *, int);
   83 
   84 static inline void write_metapage(struct metapage *mp)
   85 {
   86         set_bit(META_dirty, &mp->flag);
   87         release_metapage(mp);
   88 }
   89 
   90 static inline void flush_metapage(struct metapage *mp)
   91 {
   92         set_bit(META_sync, &mp->flag);
   93         write_metapage(mp);
   94 }
   95 
   96 static inline void discard_metapage(struct metapage *mp)
   97 {
   98         clear_bit(META_dirty, &mp->flag);
   99         set_bit(META_discard, &mp->flag);
  100         release_metapage(mp);
  101 }
  102 
  103 /*
  104  * This routines invalidate all pages for an extent.
  105  */
  106 extern void __invalidate_metapages(struct inode *, s64, int);
  107 #define invalidate_pxd_metapages(ip, pxd) \
  108         __invalidate_metapages((ip), addressPXD(&(pxd)), lengthPXD(&(pxd)))
  109 #define invalidate_dxd_metapages(ip, dxd) \
  110         __invalidate_metapages((ip), addressDXD(&(dxd)), lengthDXD(&(dxd)))
  111 #define invalidate_xad_metapages(ip, xad) \
  112         __invalidate_metapages((ip), addressXAD(&(xad)), lengthXAD(&(xad)))
  113 
  114 #endif                          /* _H_JFS_METAPAGE */

Cache object: da053c3fa361b332091277f8dda567e9


[ 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.