~ubuntu-branches/ubuntu/edgy/xfsprogs/edgy

« back to all changes in this revision

Viewing changes to include/xfs_dquot_item.h

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2004-07-28 21:11:38 UTC
  • Revision ID: james.westby@ubuntu.com-20040728211138-0v4pdnunnp7na5lm
Tags: 2.6.20-1
* New upstream release.
* Fix xfs_io segfault on non-XFS files.  (closes: #260470)
* Fix packaging botch, deleted files included.  (closes: #260491)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
3
 
 * 
4
 
 * This program is free software; you can redistribute it and/or modify it
5
 
 * under the terms of version 2 of the GNU General Public License as
6
 
 * published by the Free Software Foundation.
7
 
 * 
8
 
 * This program is distributed in the hope that it would be useful, but
9
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 
 * 
12
 
 * Further, this software is distributed without any warranty that it is
13
 
 * free of the rightful claim of any third person regarding infringement
14
 
 * or the like.  Any license provided herein, whether implied or
15
 
 * otherwise, applies only to this software file.  Patent licenses, if
16
 
 * any, provided herein do not apply to combinations of this program with
17
 
 * other software, or any other product whatsoever.
18
 
 * 
19
 
 * You should have received a copy of the GNU General Public License along
20
 
 * with this program; if not, write the Free Software Foundation, Inc., 59
21
 
 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22
 
 * 
23
 
 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
 
 * Mountain View, CA  94043, or:
25
 
 * 
26
 
 * http://www.sgi.com 
27
 
 * 
28
 
 * For further information regarding this notice, see: 
29
 
 * 
30
 
 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31
 
 */
32
 
#ifndef __XFS_DQUOT_ITEM_H__
33
 
#define __XFS_DQUOT_ITEM_H__
34
 
 
35
 
/*
36
 
 * These are the structures used to lay out dquots and quotaoff
37
 
 * records on the log. Quite similar to those of inodes.
38
 
 */
39
 
 
40
 
/*
41
 
 * log format struct for dquots.
42
 
 * The first two fields must be the type and size fitting into
43
 
 * 32 bits : log_recovery code assumes that.
44
 
 */
45
 
typedef struct xfs_dq_logformat {
46
 
        __uint16_t              qlf_type;      /* dquot log item type */
47
 
        __uint16_t              qlf_size;      /* size of this item */
48
 
        xfs_dqid_t              qlf_id;        /* usr/grp id number : 32 bits */
49
 
        __int64_t               qlf_blkno;     /* blkno of dquot buffer */
50
 
        __int32_t               qlf_len;       /* len of dquot buffer */
51
 
        __uint32_t              qlf_boffset;   /* off of dquot in buffer */
52
 
} xfs_dq_logformat_t;
53
 
 
54
 
/*
55
 
 * log format struct for QUOTAOFF records.
56
 
 * The first two fields must be the type and size fitting into
57
 
 * 32 bits : log_recovery code assumes that.
58
 
 * We write two LI_QUOTAOFF logitems per quotaoff, the last one keeps a pointer
59
 
 * to the first and ensures that the first logitem is taken out of the AIL
60
 
 * only when the last one is securely committed.
61
 
 */     
62
 
typedef struct xfs_qoff_logformat {
63
 
        unsigned short          qf_type;        /* quotaoff log item type */
64
 
        unsigned short          qf_size;        /* size of this item */
65
 
        unsigned int            qf_flags;       /* USR and/or GRP */
66
 
        char                    qf_pad[12];     /* padding for future */
67
 
} xfs_qoff_logformat_t;
68
 
 
69
 
 
70
 
#ifdef __KERNEL__
71
 
 
72
 
struct xfs_dquot;
73
 
struct xfs_trans;
74
 
struct xfs_mount;
75
 
typedef struct xfs_dq_logitem {
76
 
        xfs_log_item_t           qli_item;         /* common portion */
77
 
        struct xfs_dquot        *qli_dquot;        /* dquot ptr */
78
 
        xfs_lsn_t                qli_flush_lsn;    /* lsn at last flush */
79
 
        unsigned short           qli_pushbuf_flag; /* one bit used in push_ail */
80
 
#ifdef DEBUG
81
 
        uint64_t                 qli_push_owner;
82
 
#endif
83
 
        xfs_dq_logformat_t       qli_format;       /* logged structure */
84
 
} xfs_dq_logitem_t;
85
 
 
86
 
 
87
 
typedef struct xfs_qoff_logitem {
88
 
        xfs_log_item_t           qql_item;      /* common portion */
89
 
        struct xfs_qoff_logitem *qql_start_lip; /* qoff-start logitem, if any */
90
 
        xfs_qoff_logformat_t     qql_format;    /* logged structure */
91
 
} xfs_qoff_logitem_t;
92
 
 
93
 
 
94
 
extern void                xfs_qm_dquot_logitem_init(struct xfs_dquot *);
95
 
extern xfs_qoff_logitem_t *xfs_qm_qoff_logitem_init(struct xfs_mount *, 
96
 
                                                    xfs_qoff_logitem_t *, uint);
97
 
extern xfs_qoff_logitem_t *xfs_trans_get_qoff_item(struct xfs_trans *, 
98
 
                                                   xfs_qoff_logitem_t *, uint);
99
 
extern void                xfs_trans_log_quotaoff_item(struct xfs_trans *,
100
 
                                                       xfs_qoff_logitem_t *);
101
 
 
102
 
#endif  /* __KERNEL__ */
103
 
 
104
 
#endif  /* __XFS_DQUOT_ITEM_H__ */