.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
---|
3 | 4 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. |
---|
4 | | - * |
---|
5 | | - * This copyrighted material is made available to anyone wishing to use, |
---|
6 | | - * modify, copy, or redistribute it subject to the terms and conditions |
---|
7 | | - * of the GNU General Public License version 2. |
---|
8 | 5 | */ |
---|
9 | 6 | |
---|
10 | 7 | #ifndef __INODE_DOT_H__ |
---|
.. | .. |
---|
30 | 27 | return ip->i_diskflags & GFS2_DIF_JDATA; |
---|
31 | 28 | } |
---|
32 | 29 | |
---|
33 | | -static inline int gfs2_is_writeback(const struct gfs2_inode *ip) |
---|
| 30 | +static inline bool gfs2_is_ordered(const struct gfs2_sbd *sdp) |
---|
34 | 31 | { |
---|
35 | | - const struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
---|
36 | | - return (sdp->sd_args.ar_data == GFS2_DATA_WRITEBACK) && !gfs2_is_jdata(ip); |
---|
| 32 | + return sdp->sd_args.ar_data == GFS2_DATA_ORDERED; |
---|
37 | 33 | } |
---|
38 | 34 | |
---|
39 | | -static inline int gfs2_is_ordered(const struct gfs2_inode *ip) |
---|
| 35 | +static inline bool gfs2_is_writeback(const struct gfs2_sbd *sdp) |
---|
40 | 36 | { |
---|
41 | | - const struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
---|
42 | | - return (sdp->sd_args.ar_data == GFS2_DATA_ORDERED) && !gfs2_is_jdata(ip); |
---|
| 37 | + return sdp->sd_args.ar_data == GFS2_DATA_WRITEBACK; |
---|
43 | 38 | } |
---|
44 | 39 | |
---|
45 | 40 | static inline int gfs2_is_dir(const struct gfs2_inode *ip) |
---|
.. | .. |
---|
61 | 56 | |
---|
62 | 57 | static inline void gfs2_add_inode_blocks(struct inode *inode, s64 change) |
---|
63 | 58 | { |
---|
64 | | - gfs2_assert(GFS2_SB(inode), (change >= 0 || inode->i_blocks > -change)); |
---|
65 | | - change *= (GFS2_SB(inode)->sd_sb.sb_bsize/GFS2_BASIC_BLOCK); |
---|
| 59 | + change <<= inode->i_blkbits - GFS2_BASIC_BLOCK_SHIFT; |
---|
| 60 | + gfs2_assert(GFS2_SB(inode), (change >= 0 || inode->i_blocks >= -change)); |
---|
66 | 61 | inode->i_blocks += change; |
---|
67 | 62 | } |
---|
68 | 63 | |
---|
.. | .. |
---|
97 | 92 | u64 no_addr, u64 no_formal_ino, |
---|
98 | 93 | unsigned int blktype); |
---|
99 | 94 | extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, |
---|
100 | | - u64 *no_formal_ino, |
---|
| 95 | + u64 no_formal_ino, |
---|
101 | 96 | unsigned int blktype); |
---|
102 | 97 | |
---|
103 | 98 | extern int gfs2_inode_refresh(struct gfs2_inode *ip); |
---|