hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/ocfs2/extent_map.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* -*- mode: c; c-basic-offset: 8; -*-
23 * vim: noexpandtab sw=8 ts=8 sts=0:
34 *
....@@ -6,20 +7,6 @@
67 * Block/Cluster mapping functions
78 *
89 * Copyright (C) 2004 Oracle. All rights reserved.
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public
12
- * License, version 2, as published by the Free Software Foundation.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
- * General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public
20
- * License along with this program; if not, write to the
21
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
- * Boston, MA 021110-1307, USA.
2310 */
2411
2512 #include <linux/fs.h>
....@@ -416,7 +403,7 @@
416403 {
417404 int i, ret, tree_height, len;
418405 struct ocfs2_dinode *di;
419
- struct ocfs2_extent_block *uninitialized_var(eb);
406
+ struct ocfs2_extent_block *eb;
420407 struct ocfs2_extent_list *el;
421408 struct ocfs2_extent_rec *rec;
422409 struct buffer_head *eb_bh = NULL;
....@@ -603,8 +590,7 @@
603590 *extent_flags = rec->e_flags;
604591 }
605592 out:
606
- if (eb_bh)
607
- brelse(eb_bh);
593
+ brelse(eb_bh);
608594 return ret;
609595 }
610596
....@@ -613,7 +599,7 @@
613599 unsigned int *extent_flags)
614600 {
615601 int ret;
616
- unsigned int uninitialized_var(hole_len), flags = 0;
602
+ unsigned int hole_len, flags = 0;
617603 struct buffer_head *di_bh = NULL;
618604 struct ocfs2_extent_rec rec;
619605
....@@ -747,8 +733,6 @@
747733 return 0;
748734 }
749735
750
-#define OCFS2_FIEMAP_FLAGS (FIEMAP_FLAG_SYNC)
751
-
752736 int ocfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
753737 u64 map_start, u64 map_len)
754738 {
....@@ -760,7 +744,7 @@
760744 struct buffer_head *di_bh = NULL;
761745 struct ocfs2_extent_rec rec;
762746
763
- ret = fiemap_check_flags(fieinfo, OCFS2_FIEMAP_FLAGS);
747
+ ret = fiemap_prep(inode, fieinfo, map_start, &map_len, 0);
764748 if (ret)
765749 return ret;
766750