hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/gfs2/inode.h
....@@ -1,10 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
34 * 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.
85 */
96
107 #ifndef __INODE_DOT_H__
....@@ -30,16 +27,14 @@
3027 return ip->i_diskflags & GFS2_DIF_JDATA;
3128 }
3229
33
-static inline int gfs2_is_writeback(const struct gfs2_inode *ip)
30
+static inline bool gfs2_is_ordered(const struct gfs2_sbd *sdp)
3431 {
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;
3733 }
3834
39
-static inline int gfs2_is_ordered(const struct gfs2_inode *ip)
35
+static inline bool gfs2_is_writeback(const struct gfs2_sbd *sdp)
4036 {
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;
4338 }
4439
4540 static inline int gfs2_is_dir(const struct gfs2_inode *ip)
....@@ -61,8 +56,8 @@
6156
6257 static inline void gfs2_add_inode_blocks(struct inode *inode, s64 change)
6358 {
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));
6661 inode->i_blocks += change;
6762 }
6863
....@@ -97,7 +92,7 @@
9792 u64 no_addr, u64 no_formal_ino,
9893 unsigned int blktype);
9994 extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
100
- u64 *no_formal_ino,
95
+ u64 no_formal_ino,
10196 unsigned int blktype);
10297
10398 extern int gfs2_inode_refresh(struct gfs2_inode *ip);