]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
sync user/kernel after recent kernel changes. noop for userspace.
authorNathan Scott <nathans@sgi.com>
Fri, 30 Aug 2002 06:13:52 +0000 (06:13 +0000)
committerNathan Scott <nathans@sgi.com>
Fri, 30 Aug 2002 06:13:52 +0000 (06:13 +0000)
13 files changed:
include/libxfs.h
include/xfs_fs.h
include/xfs_inode.h
include/xfs_mac.h
include/xfs_mount.h
include/xfs_trans.h
libxfs/init.c
libxfs/logitem.c
libxfs/trans.c
libxfs/xfs.h
libxfs/xfs_inode.c
libxfs/xfs_mount.c
libxfs/xfs_rtalloc.c

index 431a7831bf5327a981a9c58700b56d720c399f7e..0e00579f64b5909d792f4adaad6bf0318dc382cf 100644 (file)
 #include <xfs_log.h>
 #include <xfs_log_priv.h>
 
+#ifndef XFS_SUPER_MAGIC
+#define XFS_SUPER_MAGIC 0x58465342
+#endif
+
 /*
  * Argument structure for libxfs_init().
  */
@@ -128,7 +132,7 @@ typedef struct xfs_mount {
        int                     m_bsize;        /* fs logical block size */
        xfs_agnumber_t          m_agfrotor;     /* last ag where space found */
        xfs_agnumber_t          m_agirotor;     /* last ag dir inode alloced */
-       xfs_agnumber_t  m_maxagi;               /* highest inode alloc group */
+       xfs_agnumber_t          m_maxagi;       /* highest inode alloc group */
        uint                    m_rsumlevels;   /* rt summary levels */
        uint                    m_rsumsize;     /* size of rt summary, bytes */
        struct xfs_inode        *m_rbmip;       /* pointer to bitmap inode */
index 4558f972e992ba8d669be096285382c903043b51..7984d92618fd7a908ca64ba12614e1ee7377f939 100644 (file)
@@ -41,7 +41,6 @@
  * SGI's XFS filesystem's major stuff (constants, structures)
  */
 
-#define XFS_SUPER_MAGIC 0x58465342
 #define XFS_NAME       "xfs"
 
 /*
index 350710aed62bb66855bca277594aaeb657bdde80..a5320cf2cea0441a74524a2740b6900aecf7e215 100644 (file)
@@ -431,8 +431,7 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
 #define XFS_ITRUNC_MAYBE       0x2
 
 /*
- * if XFS_BIG_FILES, 2^(31+PAGE_SHIFT) - 1 (due to linux page cache),
- * else 2^40 - 1 (40=31+9) (might be an int holding a block #)
+ * max file offset is 2^(31+PAGE_SHIFT) - 1 (due to linux page cache)
  *
  * NOTE: XFS itself can handle 2^63 - 1 (largest positive value of xfs_fsize_t)
  * but Linux can't go above 2^(31+PAGE_SHIFT)-1: the Linux VM uses a 32 bit
index 17406105cc5c67a94ea29a20596146329363da0d..8a6179d9e5919c23f161d4677789be9e14b7a204 100644 (file)
@@ -98,6 +98,10 @@ typedef struct xfs_mac_label {
 
 /* NOT YET IMPLEMENTED */
 
+#define MACEXEC                00100
+#define MACWRITE       00200
+#define MACREAD                00400
+
 struct xfs_inode;
 extern int  xfs_mac_iaccess(struct xfs_inode *, mode_t, cred_t *);
 
index 2ad4a05aad9326d2ac17b51b61135df916956d58..51c86fea20c47777702245296ace886edf108d65 100644 (file)
@@ -186,14 +186,10 @@ typedef struct xfs_mount {
        struct xfs_inode        *m_rsumip;      /* pointer to summary inode */
        struct xfs_inode        *m_rootip;      /* pointer to root directory */
        struct xfs_quotainfo    *m_quotainfo;   /* disk quota information */
-       buftarg_t               m_ddev_targ;    /* ptr to data device */
-       buftarg_t               m_logdev_targ;  /* ptr to log device */
-       buftarg_t               m_rtdev_targ;   /* ptr to rt device */
-       buftarg_t               *m_ddev_targp;  /* saves taking the address */
-#define m_rtdev_targp(m)(&(m)->m_rtdev_targ)
-#define m_dev          m_ddev_targ.dev
-#define m_logdev       m_logdev_targ.dev
-#define m_rtdev                m_rtdev_targ.dev
+       xfs_buftarg_t           *m_ddev_targp;  /* saves taking the address */
+       xfs_buftarg_t           *m_logdev_targp;/* ptr to log device */
+       xfs_buftarg_t           *m_rtdev_targp; /* ptr to rt device */
+#define m_dev          m_ddev_targp->pbr_dev
        __uint8_t               m_dircook_elog; /* log d-cookie entry bits */
        __uint8_t               m_blkbit_log;   /* blocklog + NBBY */
        __uint8_t               m_blkbb_log;    /* blocklog - BBSHIFT */
index 7dcb404e445b6005b6e5124c39e222a61e0841e3..1845dd874a4baf44fdb4dc483572f55f8ab06b99 100644 (file)
@@ -118,7 +118,7 @@ typedef struct xfs_trans_header {
 
 #ifdef __KERNEL__
 struct xfs_buf;
-struct buftarg;
+struct xfs_buftarg;
 struct xfs_efd_log_item;
 struct xfs_efi_log_item;
 struct xfs_inode;
@@ -974,10 +974,10 @@ int               xfs_trans_reserve(xfs_trans_t *, uint, uint, uint,
 void           xfs_trans_callback(xfs_trans_t *,
                                   void (*)(xfs_trans_t *, void *), void *);
 void           xfs_trans_mod_sb(xfs_trans_t *, uint, long);
-struct xfs_buf *xfs_trans_get_buf(xfs_trans_t *, struct buftarg *, xfs_daddr_t,
+struct xfs_buf *xfs_trans_get_buf(xfs_trans_t *, struct xfs_buftarg *, xfs_daddr_t,
                                   int, uint);
 int            xfs_trans_read_buf(struct xfs_mount *, xfs_trans_t *,
-                                  struct buftarg *, xfs_daddr_t, int, uint,
+                                  struct xfs_buftarg *, xfs_daddr_t, int, uint,
                                   struct xfs_buf **);
 struct xfs_buf *xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int);
 
index 90d1928c13c106cc10e1f5917a8ec38bf92a19d0..382217434d2fe07aea93cc490c64bcf2ab546ed7 100644 (file)
@@ -645,6 +645,50 @@ rtmount_inodes(xfs_mount_t *mp)
        return 0;
 }
 
+/*
+ * Initialize realtime fields in the mount structure.
+ */
+static int
+rtmount_init(
+       xfs_mount_t     *mp)    /* file system mount structure */
+{
+       xfs_buf_t       *bp;    /* buffer for last block of subvolume */
+       xfs_daddr_t     d;      /* address of last block of subvolume */
+       xfs_sb_t        *sbp;   /* filesystem superblock copy in mount */
+
+       sbp = &mp->m_sb;
+       if (sbp->sb_rblocks == 0)
+               return 0;
+       if (mp->m_rtdev != 0) {
+               fprintf(stderr, "%s: filesystem has a realtime subvolume\n",
+                       progname);
+               return -1;
+       }
+       mp->m_rsumlevels = sbp->sb_rextslog + 1;
+       mp->m_rsumsize =
+               (uint)sizeof(xfs_suminfo_t) * mp->m_rsumlevels *
+               sbp->sb_rbmblocks;
+       mp->m_rsumsize = roundup(mp->m_rsumsize, sbp->sb_blocksize);
+       mp->m_rbmip = mp->m_rsumip = NULL;
+       /*
+        * Check that the realtime section is an ok size.
+        */
+       d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks);
+       if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_rblocks) {
+               fprintf(stderr, "%s: realtime init - %llu != %llu\n", progname,
+                       (unsigned long long) XFS_BB_TO_FSB(mp, d),
+                       (unsigned long long) mp->m_sb.sb_rblocks);
+               return -1;
+       }
+       bp = libxfs_readbuf(mp->m_rtdev, d - 1, 1, 0);
+       if (bp == NULL) {
+               fprintf(stderr, "%s: realtime size check failed\n", progname);
+               return -1;
+       }
+       libxfs_putbuf(bp);
+       return 0;
+}
+
 #define XFS_MOUNT_32BITINODES  0x1
 /*
  * Mount structure initialization, provides a filled-in xfs_mount_t
@@ -752,8 +796,8 @@ libxfs_mount(
        }
 
        /* Initialize realtime fields in the mount structure */
-       if (libxfs_rtmount_init(mp)) {
-               fprintf(stderr, "%s: real-time device init failed\n", progname);
+       if (rtmount_init(mp)) {
+               fprintf(stderr, "%s: realtime device init failed\n", progname);
                return NULL;
        }
 
index 689cb6bc96a304b4228ec757930d79848a12f461..19f8fd28a31449cda793d9dced262018b5441490 100644 (file)
@@ -247,7 +247,7 @@ xfs_trans_free_items(
 STATIC xfs_buf_t *
 xfs_trans_buf_item_match(
        xfs_trans_t     *tp,
-       buftarg_t       *target,
+       xfs_buftarg_t   *target,
        xfs_daddr_t     blkno,
        int             len)
 {
@@ -322,7 +322,7 @@ xfs_trans_buf_item_match(
 STATIC xfs_buf_t *
 xfs_trans_buf_item_match_all(
        xfs_trans_t     *tp,
-       buftarg_t       *target,
+       xfs_buftarg_t   *target,
        xfs_daddr_t     blkno,
        int             len)
 {
index b476263acfd04c7dc1548ae5a590ac1c00cd459b..3b9ca0150a606ae22c374cac966c0c19b5b96622 100644 (file)
@@ -363,7 +363,7 @@ libxfs_trans_get_buf(xfs_trans_t *tp, dev_t dev, xfs_daddr_t d, int len, uint f)
 {
        xfs_buf_t               *bp;
        xfs_buf_log_item_t      *bip;
-       buftarg_t               bdev = { dev };
+       xfs_buftarg_t           bdev = { dev };
 
        if (tp == NULL)
                return libxfs_getbuf(dev, d, len);
@@ -404,7 +404,7 @@ libxfs_trans_read_buf(xfs_mount_t *mp, xfs_trans_t *tp, dev_t dev,
        xfs_buf_t               *bp;
        xfs_buf_log_item_t      *bip;
        int                     error;
-       buftarg_t               bdev = { dev };
+       xfs_buftarg_t           bdev = { dev };
 
        if (tp == NULL) {
                bp = libxfs_getbuf(mp->m_dev, blkno, len);
index 7090060b0ca1dd3d5c24b879d7d0b58e951b6cd6..39c8211523a4384d236bdf9e9ee940d4f93bdb66 100644 (file)
 typedef __uint32_t uint_t;
 typedef __uint32_t inst_t;     /* an instruction */
 typedef enum { B_FALSE, B_TRUE } boolean_t;
-typedef struct { dev_t dev; } buftarg_t;
+typedef struct { dev_t dev; } xfs_buftarg_t;
 #define STATIC
 #define ATTR_ROOT      0x0002  /* use attrs in root namespace */
 #define ENOATTR                ENODATA /* Attribute not found */
 #define EFSCORRUPTED   990     /* Filesystem is corrupted */
 #define ktrace_t       void
 #define m_ddev_targp   m_dev
-#define m_rtdev_targp(m)(&(m)->m_rtdev)
 #define kdev_none(x)   (!(x))
 #define KERN_WARNING
 #define XFS_ERROR(e)   (e)
@@ -560,9 +559,9 @@ void xfs_trans_free_item (xfs_trans_t *, xfs_log_item_desc_t *);
 void xfs_trans_free_items (xfs_trans_t *, int);
 
 /* xfs_trans_buf.c */
-xfs_buf_t *xfs_trans_buf_item_match (xfs_trans_t *, buftarg_t *,
+xfs_buf_t *xfs_trans_buf_item_match (xfs_trans_t *, xfs_buftarg_t *,
                        xfs_daddr_t, int);
-xfs_buf_t *xfs_trans_buf_item_match_all (xfs_trans_t *, buftarg_t *,
+xfs_buf_t *xfs_trans_buf_item_match_all (xfs_trans_t *, xfs_buftarg_t *,
                        xfs_daddr_t, int);
 
 /* xfs_inode_item.c */
index 7f424a178c8a90c2e484f519ac26781090d537d1..e18e41e3bd5805c73822e130d613e44c870c767f 100644 (file)
@@ -1011,7 +1011,7 @@ xfs_iext_realloc(
                          kmem_realloc(ifp->if_u1.if_extents,
                                        rnew_size,
                                        ifp->if_real_bytes,
-                                       KM_SLEEP);
+                                       KM_NOFS);
                }
        }
        ifp->if_real_bytes = rnew_size;
index 7a185645c1c7506aceb4470888d64220bbb4db99..3d2e824d1359ec388ece9d87b4953abdb804a53d 100644 (file)
@@ -171,59 +171,66 @@ static struct {
  *     fields    - which fields to copy (bitmask)
  */
 void
-xfs_xlatesb(void *data, xfs_sb_t *sb, int dir, xfs_arch_t arch,
-           __int64_t fields)
+xfs_xlatesb(
+       void            *data,
+       xfs_sb_t        *sb,
+       int             dir,
+       xfs_arch_t      arch,
+       __int64_t       fields)
 {
-    xfs_caddr_t            buf_ptr;
-    xfs_caddr_t            mem_ptr;
+       xfs_caddr_t     buf_ptr;
+       xfs_caddr_t     mem_ptr;
+       xfs_sb_field_t  f;
+       int             first;
+       int             size;
 
-    ASSERT(dir);
-    ASSERT(fields);
+       ASSERT(dir);
+       ASSERT(fields);
 
-    if (!fields)
-       return;
+       if (!fields)
+               return;
 
-    buf_ptr=(xfs_caddr_t)data;
-    mem_ptr=(xfs_caddr_t)sb;
+       buf_ptr = (xfs_caddr_t)data;
+       mem_ptr = (xfs_caddr_t)sb;
 
-    while (fields) {
-       xfs_sb_field_t  f;
-       int             first;
-       int             size;
+       while (fields) {
+               f = (xfs_sb_field_t)xfs_lowbit64((__uint64_t)fields);
+               first = xfs_sb_info[f].offset;
+               size = xfs_sb_info[f + 1].offset - first;
 
-       f = (xfs_sb_field_t)xfs_lowbit64((__uint64_t)fields);
-       first = xfs_sb_info[f].offset;
-       size = xfs_sb_info[f + 1].offset - first;
+               ASSERT(xfs_sb_info[f].type == 0 || xfs_sb_info[f].type == 1);
 
-       ASSERT(xfs_sb_info[f].type==0 || xfs_sb_info[f].type==1);
+               if (arch == ARCH_NOCONVERT ||
+                   size == 1 ||
+                   xfs_sb_info[f].type == 1) {
+                       if (dir > 0) {
+                               bcopy(buf_ptr + first, mem_ptr + first, size);
+                       } else {
+                               bcopy(mem_ptr + first, buf_ptr + first, size);
+                       }
+               } else {
+                       switch (size) {
+                       case 2:
+                               INT_XLATE(*(__uint16_t*)(buf_ptr+first),
+                                         *(__uint16_t*)(mem_ptr+first),
+                                         dir, arch);
+                               break;
+                       case 4:
+                               INT_XLATE(*(__uint32_t*)(buf_ptr+first),
+                                         *(__uint32_t*)(mem_ptr+first),
+                                         dir, arch);
+                               break;
+                       case 8:
+                               INT_XLATE(*(__uint64_t*)(buf_ptr+first),
+                                         *(__uint64_t*)(mem_ptr+first), dir, arch);
+                               break;
+                       default:
+                               ASSERT(0);
+                       }
+               }
 
-       if (arch == ARCH_NOCONVERT || size==1 || xfs_sb_info[f].type==1) {
-           if (dir>0) {
-               bcopy(buf_ptr + first, mem_ptr + first, size);
-           } else {
-               bcopy(mem_ptr + first, buf_ptr + first, size);
-           }
-       } else {
-           switch (size) {
-               case 2:
-                   INT_XLATE(*(__uint16_t*)(buf_ptr+first),
-                            *(__uint16_t*)(mem_ptr+first), dir, arch);
-                   break;
-               case 4:
-                   INT_XLATE(*(__uint32_t*)(buf_ptr+first),
-                            *(__uint32_t*)(mem_ptr+first), dir, arch);
-                   break;
-               case 8:
-                   INT_XLATE(*(__uint64_t*)(buf_ptr+first),
-                            *(__uint64_t*)(mem_ptr+first), dir, arch);
-                   break;
-               default:
-                   ASSERT(0);
-           }
+               fields &= ~(1LL << f);
        }
-       fields &= ~(1LL << f);
-    }
-
 }
 
 void
index 4e216f226ce4dc013ce9b893bab1f32ce822fc26..e33fc461aed8673023c6dc4d1c2a2b3630430271 100644 (file)
@@ -787,51 +787,3 @@ xfs_rtfree_extent(
        }
        return 0;
 }
-
-/*
- * Initialize realtime fields in the mount structure.
- */
-int                            /* error */
-xfs_rtmount_init(
-       xfs_mount_t     *mp)    /* file system mount structure */
-{
-       xfs_buf_t       *bp;    /* buffer for last block of subvolume */
-       xfs_daddr_t     d;      /* address of last block of subvolume */
-       int             error;  /* error return value */
-       xfs_sb_t        *sbp;   /* filesystem superblock copy in mount */
-
-       sbp = &mp->m_sb;
-       if (sbp->sb_rblocks == 0)
-               return 0;
-       if (mp->m_rtdev != 0) {
-               printk(KERN_WARNING
-               "XFS: This FS has an RT subvol - specify -o rtdev on mount\n");
-               return XFS_ERROR(ENODEV);
-       }
-       mp->m_rsumlevels = sbp->sb_rextslog + 1;
-       mp->m_rsumsize =
-               (uint)sizeof(xfs_suminfo_t) * mp->m_rsumlevels *
-               sbp->sb_rbmblocks;
-       mp->m_rsumsize = roundup(mp->m_rsumsize, sbp->sb_blocksize);
-       mp->m_rbmip = mp->m_rsumip = NULL;
-       /*
-        * Check that the realtime section is an ok size.
-        */
-       d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks);
-       if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_rblocks) {
-               printk(KERN_WARNING "XFS: RT mount - %llu != %llu\n",
-                       (unsigned long long) XFS_BB_TO_FSB(mp, d),
-                       (unsigned long long) mp->m_sb.sb_rblocks);
-               return XFS_ERROR(E2BIG);
-       }
-       error = xfs_read_buf(mp, m_rtdev_targp(mp), d - 1, 1, 0, &bp);
-       if (error) {
-               printk(KERN_WARNING
-                       "XFS: RT mount - xfs_read_buf returned %d\n", error);
-               if (error == ENOSPC)
-                       return XFS_ERROR(E2BIG);
-               return error;
-       }
-       xfs_buf_relse(bp);
-       return 0;
-}