X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=fs%2Fgfs2%2Flops.h;h=41a00df755879dea4018ae332f40a45155bc9fb6;hb=5e16e3f0e24dadb79b96b6134cd3303f0d42f0c5;hp=417f5aade4b1017436d03dd0d19922ff6a2bb57a;hpb=b3b94faa5fe5968827ba0640ee9fba4b3e7f736e;p=firefly-linux-kernel-4.4.55.git diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h index 417f5aade4b1..41a00df75587 100644 --- a/fs/gfs2/lops.h +++ b/fs/gfs2/lops.h @@ -1,25 +1,51 @@ /* * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. - * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. * * 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. + * of the GNU General Public License version 2. */ #ifndef __LOPS_DOT_H__ #define __LOPS_DOT_H__ -extern struct gfs2_log_operations gfs2_glock_lops; -extern struct gfs2_log_operations gfs2_buf_lops; -extern struct gfs2_log_operations gfs2_revoke_lops; -extern struct gfs2_log_operations gfs2_rg_lops; -extern struct gfs2_log_operations gfs2_databuf_lops; +#include +#include "incore.h" -extern struct gfs2_log_operations *gfs2_log_ops[]; +#define BUF_OFFSET \ + ((sizeof(struct gfs2_log_descriptor) + sizeof(__be64) - 1) & \ + ~(sizeof(__be64) - 1)) +#define DATABUF_OFFSET \ + ((sizeof(struct gfs2_log_descriptor) + (2 * sizeof(__be64) - 1)) & \ + ~(2 * sizeof(__be64) - 1)) + +extern const struct gfs2_log_operations gfs2_glock_lops; +extern const struct gfs2_log_operations gfs2_buf_lops; +extern const struct gfs2_log_operations gfs2_revoke_lops; +extern const struct gfs2_log_operations gfs2_rg_lops; +extern const struct gfs2_log_operations gfs2_databuf_lops; + +extern const struct gfs2_log_operations *gfs2_log_ops[]; + +static inline unsigned int buf_limit(struct gfs2_sbd *sdp) +{ + unsigned int limit; + + limit = (sdp->sd_sb.sb_bsize - BUF_OFFSET) / sizeof(__be64); + return limit; +} + +static inline unsigned int databuf_limit(struct gfs2_sbd *sdp) +{ + unsigned int limit; + + limit = (sdp->sd_sb.sb_bsize - DATABUF_OFFSET) / (2 * sizeof(__be64)); + return limit; +} static inline void lops_init_le(struct gfs2_log_element *le, - struct gfs2_log_operations *lops) + const struct gfs2_log_operations *lops) { INIT_LIST_HEAD(&le->le_list); le->le_ops = lops; @@ -57,7 +83,7 @@ static inline void lops_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai) } static inline void lops_before_scan(struct gfs2_jdesc *jd, - struct gfs2_log_header *head, + struct gfs2_log_header_host *head, unsigned int pass) { int x;