Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 549100 | Differences between
and this patch

Collapse All | Expand All

(-)a/fsr/xfs_fsr.c (+4 lines)
Lines 44-49 Link Here
44
#define _PATH_FSRLAST		"/var/tmp/.fsrlast_xfs"
44
#define _PATH_FSRLAST		"/var/tmp/.fsrlast_xfs"
45
#define _PATH_PROC_MOUNTS	"/proc/mounts"
45
#define _PATH_PROC_MOUNTS	"/proc/mounts"
46
46
47
#ifndef _PATH_MOUNTED
48
#define _PATH_MOUNTED MOUNTED
49
#endif
50
47
51
48
char *progname;
52
char *progname;
49
53
(-)a/include/platform_defs.h.in (+26 lines)
Lines 68-73 typedef __u64 __bitwise __be64; Link Here
68
68
69
typedef struct filldir		filldir_t;
69
typedef struct filldir		filldir_t;
70
70
71
#ifndef __uint8_t
72
#define __uint8_t uint8_t
73
#endif
74
#ifndef __uint16_t
75
#define __uint16_t uint16_t
76
#endif
77
#ifndef __uint32_t
78
#define __uint32_t uint32_t
79
#endif
80
#ifndef __uint64_t
81
#define __uint64_t uint64_t
82
#endif
83
84
#ifndef __int8_t
85
#define __int8_t int8_t
86
#endif
87
#ifndef __int16_t
88
#define __int16_t int16_t
89
#endif
90
#ifndef __int32_t
91
#define __int32_t int32_t
92
#endif
93
#ifndef __int64_t
94
#define __int64_t int64_t
95
#endif
96
71
#if defined(__linux__)
97
#if defined(__linux__)
72
#include <xfs/linux.h>
98
#include <xfs/linux.h>
73
#elif defined(__FreeBSD__)
99
#elif defined(__FreeBSD__)
(-)a/libhandle/handle.c (+3 lines)
Lines 20-25 Link Here
20
#include <xfs/xfs.h>
20
#include <xfs/xfs.h>
21
#include <xfs/handle.h>
21
#include <xfs/handle.h>
22
#include <xfs/parent.h>
22
#include <xfs/parent.h>
23
#if defined(__linux__)
24
#include <linux/limits.h>
25
#endif
23
26
24
/* just pick a value we know is more than big enough */
27
/* just pick a value we know is more than big enough */
25
#define	MAXHANSIZ	64
28
#define	MAXHANSIZ	64
(-)a/libhandle/jdm.c (+3 lines)
Lines 20-25 Link Here
20
#include <xfs/handle.h>
20
#include <xfs/handle.h>
21
#include <xfs/jdm.h>
21
#include <xfs/jdm.h>
22
#include <xfs/parent.h>
22
#include <xfs/parent.h>
23
#if defined(__linux__)
24
#include <linux/limits.h>
25
#endif
23
26
24
/* internal fshandle - typecast to a void for external use */
27
/* internal fshandle - typecast to a void for external use */
25
#define FSHANDLE_SZ		8
28
#define FSHANDLE_SZ		8
(-)a/libxfs/linux.c (-9 / +24 lines)
Lines 16-27 Link Here
16
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
 */
17
 */
18
18
19
#define ustat __kernel_ustat
20
#include <xfs/libxfs.h>
19
#include <xfs/libxfs.h>
21
#include <mntent.h>
20
#include <mntent.h>
22
#include <sys/stat.h>
21
#include <sys/stat.h>
23
#undef ustat
24
#include <sys/ustat.h>
25
#include <sys/mount.h>
22
#include <sys/mount.h>
26
#include <sys/ioctl.h>
23
#include <sys/ioctl.h>
27
#include <sys/sysinfo.h>
24
#include <sys/sysinfo.h>
Lines 49-57 static int max_block_alignment; Link Here
49
int
46
int
50
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
47
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
51
{
48
{
52
	/* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */
53
	struct ustat	ust[2];
54
	struct stat64	st;
49
	struct stat64	st;
50
	FILE		*f;
51
	struct stat64	mst;
52
	struct mntent	*mnt;
53
	char		mounts[MAXPATHLEN];
54
	int		ismounted = 0;
55
55
56
	if (!s) {
56
	if (!s) {
57
		if (stat64(block, &st) < 0)
57
		if (stat64(block, &st) < 0)
Lines 61-74 platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) Link Here
61
		s = &st;
61
		s = &st;
62
	}
62
	}
63
63
64
	if (ustat(s->st_rdev, ust) >= 0) {
64
	strcpy(mounts, (!access(PROC_MOUNTED, R_OK)) ? PROC_MOUNTED : MOUNTED);
65
	if ((f = setmntent(mounts, "r")) == NULL)
66
		return 0;
67
68
	while ((mnt = getmntent(f)) != NULL) {
69
		if (stat64(mnt->mnt_dir, &mst) < 0)
70
			continue;
71
		if (mst.st_dev != s->st_rdev)
72
			continue;
73
65
		if (verbose)
74
		if (verbose)
66
			fprintf(stderr,
75
			fprintf(stderr,
67
				_("%s: %s contains a mounted filesystem\n"),
76
				_("%s: %s contains a mounted filesystem\n"),
68
				progname, name);
77
				progname, name);
69
		return 1;
78
		ismounted = 1;
79
		break;
70
	}
80
	}
71
	return 0;
81
	endmntent(f);
82
	return ismounted;
72
}
83
}
73
84
74
int
85
int
75
-- ./repair/attr_repair.c.orig
86
++ ./repair/attr_repair.c
Lines 24-29 Link Here
24
#include "bmap.h"
24
#include "bmap.h"
25
#include "protos.h"
25
#include "protos.h"
26
#include "dir2.h"
26
#include "dir2.h"
27
#if defined(__linux__)
28
#include <linux/limits.h>
29
#endif
30
27
31
28
static int xfs_acl_valid(struct xfs_mount *mp, struct xfs_acl *daclp);
32
static int xfs_acl_valid(struct xfs_mount *mp, struct xfs_acl *daclp);
29
static int xfs_mac_valid(xfs_mac_label_t *lp);
33
static int xfs_mac_valid(xfs_mac_label_t *lp);

Return to bug 549100