2006-01-16 11:50:04 -05:00
|
|
|
/*
|
|
|
|
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
|
2006-05-18 15:09:15 -04:00
|
|
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
2006-01-16 11:50:04 -05:00
|
|
|
*
|
|
|
|
* This copyrighted material is made available to anyone wishing to use,
|
|
|
|
* modify, copy, or redistribute it subject to the terms and conditions
|
|
|
|
* of the GNU General Public License v.2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
#include <linux/completion.h>
|
|
|
|
#include <linux/buffer_head.h>
|
2006-02-27 17:23:27 -05:00
|
|
|
#include <linux/gfs2_ondisk.h>
|
2006-01-16 11:50:04 -05:00
|
|
|
|
|
|
|
#include "gfs2.h"
|
2006-02-27 17:23:27 -05:00
|
|
|
#include "lm_interface.h"
|
|
|
|
#include "incore.h"
|
|
|
|
#include "lvb.h"
|
2006-01-16 11:50:04 -05:00
|
|
|
|
2006-02-27 12:00:42 -05:00
|
|
|
#define pv(struct, member, fmt) printk(KERN_INFO " "#member" = "fmt"\n", \
|
|
|
|
struct->member);
|
2006-01-16 11:50:04 -05:00
|
|
|
|
|
|
|
void gfs2_quota_lvb_in(struct gfs2_quota_lvb *qb, char *lvb)
|
|
|
|
{
|
|
|
|
struct gfs2_quota_lvb *str = (struct gfs2_quota_lvb *)lvb;
|
|
|
|
|
|
|
|
qb->qb_magic = be32_to_cpu(str->qb_magic);
|
|
|
|
qb->qb_limit = be64_to_cpu(str->qb_limit);
|
|
|
|
qb->qb_warn = be64_to_cpu(str->qb_warn);
|
|
|
|
qb->qb_value = be64_to_cpu(str->qb_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void gfs2_quota_lvb_out(struct gfs2_quota_lvb *qb, char *lvb)
|
|
|
|
{
|
|
|
|
struct gfs2_quota_lvb *str = (struct gfs2_quota_lvb *)lvb;
|
|
|
|
|
|
|
|
str->qb_magic = cpu_to_be32(qb->qb_magic);
|
|
|
|
str->qb_limit = cpu_to_be64(qb->qb_limit);
|
|
|
|
str->qb_warn = cpu_to_be64(qb->qb_warn);
|
|
|
|
str->qb_value = cpu_to_be64(qb->qb_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
|