diff options
author | Felix Blyakher <felixb@sgi.com> | 2009-03-30 23:17:44 -0400 |
---|---|---|
committer | Felix Blyakher <felixb@sgi.com> | 2009-03-30 23:17:44 -0400 |
commit | 5123bc35d2bd2e5c344a53e634edec2cd0861a0e (patch) | |
tree | 86f56040b6a8d394c30b7f6bc48d9c001851c2b2 /fs/xfs | |
parent | 930861c4e6f13ce2e7d06cd1ef11441a065517d9 (diff) | |
parent | 27174203f570b923e5c02c618a5557295bab8755 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfs
Diffstat (limited to 'fs/xfs')
38 files changed, 204 insertions, 292 deletions
diff --git a/fs/xfs/linux-2.6/mutex.h b/fs/xfs/linux-2.6/mutex.h deleted file mode 100644 index 2a88d56c4dc2..000000000000 --- a/fs/xfs/linux-2.6/mutex.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. | ||
3 | * All Rights Reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it would be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write the Free Software Foundation, | ||
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | #ifndef __XFS_SUPPORT_MUTEX_H__ | ||
19 | #define __XFS_SUPPORT_MUTEX_H__ | ||
20 | |||
21 | #include <linux/mutex.h> | ||
22 | |||
23 | typedef struct mutex mutex_t; | ||
24 | |||
25 | #endif /* __XFS_SUPPORT_MUTEX_H__ */ | ||
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index de3a198f771e..c13f67300fe7 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -1623,4 +1623,5 @@ const struct address_space_operations xfs_address_space_operations = { | |||
1623 | .bmap = xfs_vm_bmap, | 1623 | .bmap = xfs_vm_bmap, |
1624 | .direct_IO = xfs_vm_direct_IO, | 1624 | .direct_IO = xfs_vm_direct_IO, |
1625 | .migratepage = buffer_migrate_page, | 1625 | .migratepage = buffer_migrate_page, |
1626 | .is_partially_uptodate = block_is_partially_uptodate, | ||
1626 | }; | 1627 | }; |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index e103b05dc777..631d0137551e 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -541,9 +541,6 @@ xfs_vn_getattr( | |||
541 | stat->uid = ip->i_d.di_uid; | 541 | stat->uid = ip->i_d.di_uid; |
542 | stat->gid = ip->i_d.di_gid; | 542 | stat->gid = ip->i_d.di_gid; |
543 | stat->ino = ip->i_ino; | 543 | stat->ino = ip->i_ino; |
544 | #if XFS_BIG_INUMS | ||
545 | stat->ino += mp->m_inoadd; | ||
546 | #endif | ||
547 | stat->atime = inode->i_atime; | 544 | stat->atime = inode->i_atime; |
548 | stat->mtime.tv_sec = ip->i_d.di_mtime.t_sec; | 545 | stat->mtime.tv_sec = ip->i_d.di_mtime.t_sec; |
549 | stat->mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; | 546 | stat->mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; |
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index fc8d776ba05b..f65a53f8752f 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <kmem.h> | 38 | #include <kmem.h> |
39 | #include <mrlock.h> | 39 | #include <mrlock.h> |
40 | #include <sv.h> | 40 | #include <sv.h> |
41 | #include <mutex.h> | ||
42 | #include <time.h> | 41 | #include <time.h> |
43 | 42 | ||
44 | #include <support/ktrace.h> | 43 | #include <support/ktrace.h> |
@@ -51,6 +50,7 @@ | |||
51 | #include <linux/blkdev.h> | 50 | #include <linux/blkdev.h> |
52 | #include <linux/slab.h> | 51 | #include <linux/slab.h> |
53 | #include <linux/module.h> | 52 | #include <linux/module.h> |
53 | #include <linux/mutex.h> | ||
54 | #include <linux/file.h> | 54 | #include <linux/file.h> |
55 | #include <linux/swap.h> | 55 | #include <linux/swap.h> |
56 | #include <linux/errno.h> | 56 | #include <linux/errno.h> |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 9f974f4b3307..bb685269f832 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -78,7 +78,6 @@ mempool_t *xfs_ioend_pool; | |||
78 | #define MNTOPT_RTDEV "rtdev" /* realtime I/O device */ | 78 | #define MNTOPT_RTDEV "rtdev" /* realtime I/O device */ |
79 | #define MNTOPT_BIOSIZE "biosize" /* log2 of preferred buffered io size */ | 79 | #define MNTOPT_BIOSIZE "biosize" /* log2 of preferred buffered io size */ |
80 | #define MNTOPT_WSYNC "wsync" /* safe-mode nfs compatible mount */ | 80 | #define MNTOPT_WSYNC "wsync" /* safe-mode nfs compatible mount */ |
81 | #define MNTOPT_INO64 "ino64" /* force inodes into 64-bit range */ | ||
82 | #define MNTOPT_NOALIGN "noalign" /* turn off stripe alignment */ | 81 | #define MNTOPT_NOALIGN "noalign" /* turn off stripe alignment */ |
83 | #define MNTOPT_SWALLOC "swalloc" /* turn on stripe width allocation */ | 82 | #define MNTOPT_SWALLOC "swalloc" /* turn on stripe width allocation */ |
84 | #define MNTOPT_SUNIT "sunit" /* data volume stripe unit */ | 83 | #define MNTOPT_SUNIT "sunit" /* data volume stripe unit */ |
@@ -290,16 +289,6 @@ xfs_parseargs( | |||
290 | mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; | 289 | mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; |
291 | } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { | 290 | } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { |
292 | mp->m_flags |= XFS_MOUNT_NORECOVERY; | 291 | mp->m_flags |= XFS_MOUNT_NORECOVERY; |
293 | } else if (!strcmp(this_char, MNTOPT_INO64)) { | ||
294 | #if XFS_BIG_INUMS | ||
295 | mp->m_flags |= XFS_MOUNT_INO64; | ||
296 | mp->m_inoadd = XFS_INO64_OFFSET; | ||
297 | #else | ||
298 | cmn_err(CE_WARN, | ||
299 | "XFS: %s option not allowed on this system", | ||
300 | this_char); | ||
301 | return EINVAL; | ||
302 | #endif | ||
303 | } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { | 292 | } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { |
304 | mp->m_flags |= XFS_MOUNT_NOALIGN; | 293 | mp->m_flags |= XFS_MOUNT_NOALIGN; |
305 | } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { | 294 | } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { |
@@ -528,7 +517,6 @@ xfs_showargs( | |||
528 | /* the few simple ones we can get from the mount struct */ | 517 | /* the few simple ones we can get from the mount struct */ |
529 | { XFS_MOUNT_IKEEP, "," MNTOPT_IKEEP }, | 518 | { XFS_MOUNT_IKEEP, "," MNTOPT_IKEEP }, |
530 | { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, | 519 | { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, |
531 | { XFS_MOUNT_INO64, "," MNTOPT_INO64 }, | ||
532 | { XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN }, | 520 | { XFS_MOUNT_NOALIGN, "," MNTOPT_NOALIGN }, |
533 | { XFS_MOUNT_SWALLOC, "," MNTOPT_SWALLOC }, | 521 | { XFS_MOUNT_SWALLOC, "," MNTOPT_SWALLOC }, |
534 | { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, | 522 | { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, |
@@ -1199,18 +1187,12 @@ xfs_fs_statfs( | |||
1199 | statp->f_bfree = statp->f_bavail = | 1187 | statp->f_bfree = statp->f_bavail = |
1200 | sbp->sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp); | 1188 | sbp->sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp); |
1201 | fakeinos = statp->f_bfree << sbp->sb_inopblog; | 1189 | fakeinos = statp->f_bfree << sbp->sb_inopblog; |
1202 | #if XFS_BIG_INUMS | ||
1203 | fakeinos += mp->m_inoadd; | ||
1204 | #endif | ||
1205 | statp->f_files = | 1190 | statp->f_files = |
1206 | MIN(sbp->sb_icount + fakeinos, (__uint64_t)XFS_MAXINUMBER); | 1191 | MIN(sbp->sb_icount + fakeinos, (__uint64_t)XFS_MAXINUMBER); |
1207 | if (mp->m_maxicount) | 1192 | if (mp->m_maxicount) |
1208 | #if XFS_BIG_INUMS | 1193 | statp->f_files = min_t(typeof(statp->f_files), |
1209 | if (!mp->m_inoadd) | 1194 | statp->f_files, |
1210 | #endif | 1195 | mp->m_maxicount); |
1211 | statp->f_files = min_t(typeof(statp->f_files), | ||
1212 | statp->f_files, | ||
1213 | mp->m_maxicount); | ||
1214 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); | 1196 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); |
1215 | spin_unlock(&mp->m_sb_lock); | 1197 | spin_unlock(&mp->m_sb_lock); |
1216 | 1198 | ||
diff --git a/fs/xfs/quota/xfs_dquot.h b/fs/xfs/quota/xfs_dquot.h index d1f726e0e5a4..de0f402ddb4c 100644 --- a/fs/xfs/quota/xfs_dquot.h +++ b/fs/xfs/quota/xfs_dquot.h | |||
@@ -34,7 +34,7 @@ | |||
34 | */ | 34 | */ |
35 | typedef struct xfs_dqhash { | 35 | typedef struct xfs_dqhash { |
36 | struct xfs_dquot *qh_next; | 36 | struct xfs_dquot *qh_next; |
37 | mutex_t qh_lock; | 37 | struct mutex qh_lock; |
38 | uint qh_version; /* ever increasing version */ | 38 | uint qh_version; /* ever increasing version */ |
39 | uint qh_nelems; /* number of dquots on the list */ | 39 | uint qh_nelems; /* number of dquots on the list */ |
40 | } xfs_dqhash_t; | 40 | } xfs_dqhash_t; |
@@ -81,7 +81,7 @@ typedef struct xfs_dquot { | |||
81 | xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */ | 81 | xfs_qcnt_t q_res_bcount; /* total regular nblks used+reserved */ |
82 | xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */ | 82 | xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */ |
83 | xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */ | 83 | xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */ |
84 | mutex_t q_qlock; /* quota lock */ | 84 | struct mutex q_qlock; /* quota lock */ |
85 | struct completion q_flush; /* flush completion queue */ | 85 | struct completion q_flush; /* flush completion queue */ |
86 | atomic_t q_pincount; /* dquot pin count */ | 86 | atomic_t q_pincount; /* dquot pin count */ |
87 | wait_queue_head_t q_pinwait; /* dquot pinning wait queue */ | 87 | wait_queue_head_t q_pinwait; /* dquot pinning wait queue */ |
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 11d0a4f89a0e..5b6695049e00 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -55,7 +55,7 @@ | |||
55 | * quota functionality, including maintaining the freelist and hash | 55 | * quota functionality, including maintaining the freelist and hash |
56 | * tables of dquots. | 56 | * tables of dquots. |
57 | */ | 57 | */ |
58 | mutex_t xfs_Gqm_lock; | 58 | struct mutex xfs_Gqm_lock; |
59 | struct xfs_qm *xfs_Gqm; | 59 | struct xfs_qm *xfs_Gqm; |
60 | uint ndquot; | 60 | uint ndquot; |
61 | 61 | ||
@@ -80,7 +80,7 @@ static struct shrinker xfs_qm_shaker = { | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | #ifdef DEBUG | 82 | #ifdef DEBUG |
83 | extern mutex_t qcheck_lock; | 83 | extern struct mutex qcheck_lock; |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #ifdef QUOTADEBUG | 86 | #ifdef QUOTADEBUG |
diff --git a/fs/xfs/quota/xfs_qm.h b/fs/xfs/quota/xfs_qm.h index 933df4204fc7..a371954cae1b 100644 --- a/fs/xfs/quota/xfs_qm.h +++ b/fs/xfs/quota/xfs_qm.h | |||
@@ -27,7 +27,7 @@ struct xfs_qm; | |||
27 | struct xfs_inode; | 27 | struct xfs_inode; |
28 | 28 | ||
29 | extern uint ndquot; | 29 | extern uint ndquot; |
30 | extern mutex_t xfs_Gqm_lock; | 30 | extern struct mutex xfs_Gqm_lock; |
31 | extern struct xfs_qm *xfs_Gqm; | 31 | extern struct xfs_qm *xfs_Gqm; |
32 | extern kmem_zone_t *qm_dqzone; | 32 | extern kmem_zone_t *qm_dqzone; |
33 | extern kmem_zone_t *qm_dqtrxzone; | 33 | extern kmem_zone_t *qm_dqtrxzone; |
@@ -79,7 +79,7 @@ typedef xfs_dqhash_t xfs_dqlist_t; | |||
79 | typedef struct xfs_frlist { | 79 | typedef struct xfs_frlist { |
80 | struct xfs_dquot *qh_next; | 80 | struct xfs_dquot *qh_next; |
81 | struct xfs_dquot *qh_prev; | 81 | struct xfs_dquot *qh_prev; |
82 | mutex_t qh_lock; | 82 | struct mutex qh_lock; |
83 | uint qh_version; | 83 | uint qh_version; |
84 | uint qh_nelems; | 84 | uint qh_nelems; |
85 | } xfs_frlist_t; | 85 | } xfs_frlist_t; |
@@ -115,7 +115,7 @@ typedef struct xfs_quotainfo { | |||
115 | xfs_qwarncnt_t qi_bwarnlimit; /* limit for blks warnings */ | 115 | xfs_qwarncnt_t qi_bwarnlimit; /* limit for blks warnings */ |
116 | xfs_qwarncnt_t qi_iwarnlimit; /* limit for inodes warnings */ | 116 | xfs_qwarncnt_t qi_iwarnlimit; /* limit for inodes warnings */ |
117 | xfs_qwarncnt_t qi_rtbwarnlimit;/* limit for rt blks warnings */ | 117 | xfs_qwarncnt_t qi_rtbwarnlimit;/* limit for rt blks warnings */ |
118 | mutex_t qi_quotaofflock;/* to serialize quotaoff */ | 118 | struct mutex qi_quotaofflock;/* to serialize quotaoff */ |
119 | xfs_filblks_t qi_dqchunklen; /* # BBs in a chunk of dqs */ | 119 | xfs_filblks_t qi_dqchunklen; /* # BBs in a chunk of dqs */ |
120 | uint qi_dqperchunk; /* # ondisk dqs in above chunk */ | 120 | uint qi_dqperchunk; /* # ondisk dqs in above chunk */ |
121 | xfs_qcnt_t qi_bhardlimit; /* default data blk hard limit */ | 121 | xfs_qcnt_t qi_bhardlimit; /* default data blk hard limit */ |
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index b00c8d484aa9..c7b66f6506ce 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c | |||
@@ -960,7 +960,7 @@ xfs_dqhash_t *qmtest_udqtab; | |||
960 | xfs_dqhash_t *qmtest_gdqtab; | 960 | xfs_dqhash_t *qmtest_gdqtab; |
961 | int qmtest_hashmask; | 961 | int qmtest_hashmask; |
962 | int qmtest_nfails; | 962 | int qmtest_nfails; |
963 | mutex_t qcheck_lock; | 963 | struct mutex qcheck_lock; |
964 | 964 | ||
965 | #define DQTEST_HASHVAL(mp, id) (((__psunsigned_t)(mp) + \ | 965 | #define DQTEST_HASHVAL(mp, id) (((__psunsigned_t)(mp) + \ |
966 | (__psunsigned_t)(id)) & \ | 966 | (__psunsigned_t)(id)) & \ |
diff --git a/fs/xfs/support/uuid.c b/fs/xfs/support/uuid.c index 5830c040ea7e..b83f76b6d410 100644 --- a/fs/xfs/support/uuid.c +++ b/fs/xfs/support/uuid.c | |||
@@ -17,10 +17,6 @@ | |||
17 | */ | 17 | */ |
18 | #include <xfs.h> | 18 | #include <xfs.h> |
19 | 19 | ||
20 | static DEFINE_MUTEX(uuid_monitor); | ||
21 | static int uuid_table_size; | ||
22 | static uuid_t *uuid_table; | ||
23 | |||
24 | /* IRIX interpretation of an uuid_t */ | 20 | /* IRIX interpretation of an uuid_t */ |
25 | typedef struct { | 21 | typedef struct { |
26 | __be32 uu_timelow; | 22 | __be32 uu_timelow; |
@@ -46,12 +42,6 @@ uuid_getnodeuniq(uuid_t *uuid, int fsid [2]) | |||
46 | fsid[1] = be32_to_cpu(uup->uu_timelow); | 42 | fsid[1] = be32_to_cpu(uup->uu_timelow); |
47 | } | 43 | } |
48 | 44 | ||
49 | void | ||
50 | uuid_create_nil(uuid_t *uuid) | ||
51 | { | ||
52 | memset(uuid, 0, sizeof(*uuid)); | ||
53 | } | ||
54 | |||
55 | int | 45 | int |
56 | uuid_is_nil(uuid_t *uuid) | 46 | uuid_is_nil(uuid_t *uuid) |
57 | { | 47 | { |
@@ -71,64 +61,3 @@ uuid_equal(uuid_t *uuid1, uuid_t *uuid2) | |||
71 | { | 61 | { |
72 | return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1; | 62 | return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1; |
73 | } | 63 | } |
74 | |||
75 | /* | ||
76 | * Given a 128-bit uuid, return a 64-bit value by adding the top and bottom | ||
77 | * 64-bit words. NOTE: This function can not be changed EVER. Although | ||
78 | * brain-dead, some applications depend on this 64-bit value remaining | ||
79 | * persistent. Specifically, DMI vendors store the value as a persistent | ||
80 | * filehandle. | ||
81 | */ | ||
82 | __uint64_t | ||
83 | uuid_hash64(uuid_t *uuid) | ||
84 | { | ||
85 | __uint64_t *sp = (__uint64_t *)uuid; | ||
86 | |||
87 | return sp[0] + sp[1]; | ||
88 | } | ||
89 | |||
90 | int | ||
91 | uuid_table_insert(uuid_t *uuid) | ||
92 | { | ||
93 | int i, hole; | ||
94 | |||
95 | mutex_lock(&uuid_monitor); | ||
96 | for (i = 0, hole = -1; i < uuid_table_size; i++) { | ||
97 | if (uuid_is_nil(&uuid_table[i])) { | ||
98 | hole = i; | ||
99 | continue; | ||
100 | } | ||
101 | if (uuid_equal(uuid, &uuid_table[i])) { | ||
102 | mutex_unlock(&uuid_monitor); | ||
103 | return 0; | ||
104 | } | ||
105 | } | ||
106 | if (hole < 0) { | ||
107 | uuid_table = kmem_realloc(uuid_table, | ||
108 | (uuid_table_size + 1) * sizeof(*uuid_table), | ||
109 | uuid_table_size * sizeof(*uuid_table), | ||
110 | KM_SLEEP); | ||
111 | hole = uuid_table_size++; | ||
112 | } | ||
113 | uuid_table[hole] = *uuid; | ||
114 | mutex_unlock(&uuid_monitor); | ||
115 | return 1; | ||
116 | } | ||
117 | |||
118 | void | ||
119 | uuid_table_remove(uuid_t *uuid) | ||
120 | { | ||
121 | int i; | ||
122 | |||
123 | mutex_lock(&uuid_monitor); | ||
124 | for (i = 0; i < uuid_table_size; i++) { | ||
125 | if (uuid_is_nil(&uuid_table[i])) | ||
126 | continue; | ||
127 | if (!uuid_equal(uuid, &uuid_table[i])) | ||
128 | continue; | ||
129 | uuid_create_nil(&uuid_table[i]); | ||
130 | break; | ||
131 | } | ||
132 | ASSERT(i < uuid_table_size); | ||
133 | mutex_unlock(&uuid_monitor); | ||
134 | } | ||
diff --git a/fs/xfs/support/uuid.h b/fs/xfs/support/uuid.h index cff5b607d445..4732d71262cc 100644 --- a/fs/xfs/support/uuid.h +++ b/fs/xfs/support/uuid.h | |||
@@ -22,12 +22,8 @@ typedef struct { | |||
22 | unsigned char __u_bits[16]; | 22 | unsigned char __u_bits[16]; |
23 | } uuid_t; | 23 | } uuid_t; |
24 | 24 | ||
25 | extern void uuid_create_nil(uuid_t *uuid); | ||
26 | extern int uuid_is_nil(uuid_t *uuid); | 25 | extern int uuid_is_nil(uuid_t *uuid); |
27 | extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2); | 26 | extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2); |
28 | extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]); | 27 | extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]); |
29 | extern __uint64_t uuid_hash64(uuid_t *uuid); | ||
30 | extern int uuid_table_insert(uuid_t *uuid); | ||
31 | extern void uuid_table_remove(uuid_t *uuid); | ||
32 | 28 | ||
33 | #endif /* __XFS_SUPPORT_UUID_H__ */ | 29 | #endif /* __XFS_SUPPORT_UUID_H__ */ |
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index aa001629b596..afdc8911637d 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -155,7 +155,8 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes) | |||
155 | * minimum offset only needs to be the space required for | 155 | * minimum offset only needs to be the space required for |
156 | * the btree root. | 156 | * the btree root. |
157 | */ | 157 | */ |
158 | if (!dp->i_d.di_forkoff && dp->i_df.if_bytes > mp->m_attroffset) | 158 | if (!dp->i_d.di_forkoff && dp->i_df.if_bytes > |
159 | xfs_default_attroffset(dp)) | ||
159 | dsize = XFS_BMDR_SPACE_CALC(MINDBTPTRS); | 160 | dsize = XFS_BMDR_SPACE_CALC(MINDBTPTRS); |
160 | break; | 161 | break; |
161 | 162 | ||
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 07b7d0d59d88..3a6ed426327a 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -2479,7 +2479,7 @@ xfs_bmap_adjacent( | |||
2479 | fb_agno = nullfb ? NULLAGNUMBER : XFS_FSB_TO_AGNO(mp, ap->firstblock); | 2479 | fb_agno = nullfb ? NULLAGNUMBER : XFS_FSB_TO_AGNO(mp, ap->firstblock); |
2480 | /* | 2480 | /* |
2481 | * If allocating at eof, and there's a previous real block, | 2481 | * If allocating at eof, and there's a previous real block, |
2482 | * try to use it's last block as our starting point. | 2482 | * try to use its last block as our starting point. |
2483 | */ | 2483 | */ |
2484 | if (ap->eof && ap->prevp->br_startoff != NULLFILEOFF && | 2484 | if (ap->eof && ap->prevp->br_startoff != NULLFILEOFF && |
2485 | !isnullstartblock(ap->prevp->br_startblock) && | 2485 | !isnullstartblock(ap->prevp->br_startblock) && |
@@ -3569,6 +3569,27 @@ xfs_bmap_extents_to_btree( | |||
3569 | } | 3569 | } |
3570 | 3570 | ||
3571 | /* | 3571 | /* |
3572 | * Calculate the default attribute fork offset for newly created inodes. | ||
3573 | */ | ||
3574 | uint | ||
3575 | xfs_default_attroffset( | ||
3576 | struct xfs_inode *ip) | ||
3577 | { | ||
3578 | struct xfs_mount *mp = ip->i_mount; | ||
3579 | uint offset; | ||
3580 | |||
3581 | if (mp->m_sb.sb_inodesize == 256) { | ||
3582 | offset = XFS_LITINO(mp) - | ||
3583 | XFS_BMDR_SPACE_CALC(MINABTPTRS); | ||
3584 | } else { | ||
3585 | offset = XFS_BMDR_SPACE_CALC(6 * MINABTPTRS); | ||
3586 | } | ||
3587 | |||
3588 | ASSERT(offset < XFS_LITINO(mp)); | ||
3589 | return offset; | ||
3590 | } | ||
3591 | |||
3592 | /* | ||
3572 | * Helper routine to reset inode di_forkoff field when switching | 3593 | * Helper routine to reset inode di_forkoff field when switching |
3573 | * attribute fork from local to extent format - we reset it where | 3594 | * attribute fork from local to extent format - we reset it where |
3574 | * possible to make space available for inline data fork extents. | 3595 | * possible to make space available for inline data fork extents. |
@@ -3580,15 +3601,18 @@ xfs_bmap_forkoff_reset( | |||
3580 | int whichfork) | 3601 | int whichfork) |
3581 | { | 3602 | { |
3582 | if (whichfork == XFS_ATTR_FORK && | 3603 | if (whichfork == XFS_ATTR_FORK && |
3583 | (ip->i_d.di_format != XFS_DINODE_FMT_DEV) && | 3604 | ip->i_d.di_format != XFS_DINODE_FMT_DEV && |
3584 | (ip->i_d.di_format != XFS_DINODE_FMT_UUID) && | 3605 | ip->i_d.di_format != XFS_DINODE_FMT_UUID && |
3585 | (ip->i_d.di_format != XFS_DINODE_FMT_BTREE) && | 3606 | ip->i_d.di_format != XFS_DINODE_FMT_BTREE) { |
3586 | ((mp->m_attroffset >> 3) > ip->i_d.di_forkoff)) { | 3607 | uint dfl_forkoff = xfs_default_attroffset(ip) >> 3; |
3587 | ip->i_d.di_forkoff = mp->m_attroffset >> 3; | 3608 | |
3588 | ip->i_df.if_ext_max = XFS_IFORK_DSIZE(ip) / | 3609 | if (dfl_forkoff > ip->i_d.di_forkoff) { |
3589 | (uint)sizeof(xfs_bmbt_rec_t); | 3610 | ip->i_d.di_forkoff = dfl_forkoff; |
3590 | ip->i_afp->if_ext_max = XFS_IFORK_ASIZE(ip) / | 3611 | ip->i_df.if_ext_max = |
3591 | (uint)sizeof(xfs_bmbt_rec_t); | 3612 | XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t); |
3613 | ip->i_afp->if_ext_max = | ||
3614 | XFS_IFORK_ASIZE(ip) / sizeof(xfs_bmbt_rec_t); | ||
3615 | } | ||
3592 | } | 3616 | } |
3593 | } | 3617 | } |
3594 | 3618 | ||
@@ -4057,7 +4081,7 @@ xfs_bmap_add_attrfork( | |||
4057 | case XFS_DINODE_FMT_BTREE: | 4081 | case XFS_DINODE_FMT_BTREE: |
4058 | ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size); | 4082 | ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size); |
4059 | if (!ip->i_d.di_forkoff) | 4083 | if (!ip->i_d.di_forkoff) |
4060 | ip->i_d.di_forkoff = mp->m_attroffset >> 3; | 4084 | ip->i_d.di_forkoff = xfs_default_attroffset(ip) >> 3; |
4061 | else if (mp->m_flags & XFS_MOUNT_ATTR2) | 4085 | else if (mp->m_flags & XFS_MOUNT_ATTR2) |
4062 | version = 2; | 4086 | version = 2; |
4063 | break; | 4087 | break; |
@@ -4204,12 +4228,12 @@ xfs_bmap_compute_maxlevels( | |||
4204 | * (a signed 16-bit number, xfs_aextnum_t). | 4228 | * (a signed 16-bit number, xfs_aextnum_t). |
4205 | * | 4229 | * |
4206 | * Note that we can no longer assume that if we are in ATTR1 that | 4230 | * Note that we can no longer assume that if we are in ATTR1 that |
4207 | * the fork offset of all the inodes will be (m_attroffset >> 3) | 4231 | * the fork offset of all the inodes will be |
4208 | * because we could have mounted with ATTR2 and then mounted back | 4232 | * (xfs_default_attroffset(ip) >> 3) because we could have mounted |
4209 | * with ATTR1, keeping the di_forkoff's fixed but probably at | 4233 | * with ATTR2 and then mounted back with ATTR1, keeping the |
4210 | * various positions. Therefore, for both ATTR1 and ATTR2 | 4234 | * di_forkoff's fixed but probably at various positions. Therefore, |
4211 | * we have to assume the worst case scenario of a minimum size | 4235 | * for both ATTR1 and ATTR2 we have to assume the worst case scenario |
4212 | * available. | 4236 | * of a minimum size available. |
4213 | */ | 4237 | */ |
4214 | if (whichfork == XFS_DATA_FORK) { | 4238 | if (whichfork == XFS_DATA_FORK) { |
4215 | maxleafents = MAXEXTNUM; | 4239 | maxleafents = MAXEXTNUM; |
@@ -4796,7 +4820,7 @@ xfs_bmapi( | |||
4796 | xfs_extlen_t minlen; /* min allocation size */ | 4820 | xfs_extlen_t minlen; /* min allocation size */ |
4797 | xfs_mount_t *mp; /* xfs mount structure */ | 4821 | xfs_mount_t *mp; /* xfs mount structure */ |
4798 | int n; /* current extent index */ | 4822 | int n; /* current extent index */ |
4799 | int nallocs; /* number of extents alloc\'d */ | 4823 | int nallocs; /* number of extents alloc'd */ |
4800 | xfs_extnum_t nextents; /* number of extents in file */ | 4824 | xfs_extnum_t nextents; /* number of extents in file */ |
4801 | xfs_fileoff_t obno; /* old block number (offset) */ | 4825 | xfs_fileoff_t obno; /* old block number (offset) */ |
4802 | xfs_bmbt_irec_t prev; /* previous file extent record */ | 4826 | xfs_bmbt_irec_t prev; /* previous file extent record */ |
@@ -6486,7 +6510,7 @@ xfs_bmap_count_tree( | |||
6486 | block = XFS_BUF_TO_BLOCK(bp); | 6510 | block = XFS_BUF_TO_BLOCK(bp); |
6487 | 6511 | ||
6488 | if (--level) { | 6512 | if (--level) { |
6489 | /* Not at node above leafs, count this level of nodes */ | 6513 | /* Not at node above leaves, count this level of nodes */ |
6490 | nextbno = be64_to_cpu(block->bb_u.l.bb_rightsib); | 6514 | nextbno = be64_to_cpu(block->bb_u.l.bb_rightsib); |
6491 | while (nextbno != NULLFSBLOCK) { | 6515 | while (nextbno != NULLFSBLOCK) { |
6492 | if ((error = xfs_btree_read_bufl(mp, tp, nextbno, | 6516 | if ((error = xfs_btree_read_bufl(mp, tp, nextbno, |
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h index be2979d88d32..1b8ff9256bd0 100644 --- a/fs/xfs/xfs_bmap.h +++ b/fs/xfs/xfs_bmap.h | |||
@@ -125,7 +125,7 @@ typedef struct xfs_bmalloca { | |||
125 | struct xfs_bmbt_irec *gotp; /* extent after, or delayed */ | 125 | struct xfs_bmbt_irec *gotp; /* extent after, or delayed */ |
126 | xfs_extlen_t alen; /* i/o length asked/allocated */ | 126 | xfs_extlen_t alen; /* i/o length asked/allocated */ |
127 | xfs_extlen_t total; /* total blocks needed for xaction */ | 127 | xfs_extlen_t total; /* total blocks needed for xaction */ |
128 | xfs_extlen_t minlen; /* mininum allocation size (blocks) */ | 128 | xfs_extlen_t minlen; /* minimum allocation size (blocks) */ |
129 | xfs_extlen_t minleft; /* amount must be left after alloc */ | 129 | xfs_extlen_t minleft; /* amount must be left after alloc */ |
130 | char eof; /* set if allocating past last extent */ | 130 | char eof; /* set if allocating past last extent */ |
131 | char wasdel; /* replacing a delayed allocation */ | 131 | char wasdel; /* replacing a delayed allocation */ |
@@ -338,6 +338,10 @@ xfs_check_nostate_extents( | |||
338 | xfs_extnum_t idx, | 338 | xfs_extnum_t idx, |
339 | xfs_extnum_t num); | 339 | xfs_extnum_t num); |
340 | 340 | ||
341 | uint | ||
342 | xfs_default_attroffset( | ||
343 | struct xfs_inode *ip); | ||
344 | |||
341 | #ifdef __KERNEL__ | 345 | #ifdef __KERNEL__ |
342 | 346 | ||
343 | /* | 347 | /* |
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c index e73c332eb23f..e9df99574829 100644 --- a/fs/xfs/xfs_btree.c +++ b/fs/xfs/xfs_btree.c | |||
@@ -1883,7 +1883,7 @@ xfs_btree_lshift( | |||
1883 | 1883 | ||
1884 | /* | 1884 | /* |
1885 | * We add one entry to the left side and remove one for the right side. | 1885 | * We add one entry to the left side and remove one for the right side. |
1886 | * Accout for it here, the changes will be updated on disk and logged | 1886 | * Account for it here, the changes will be updated on disk and logged |
1887 | * later. | 1887 | * later. |
1888 | */ | 1888 | */ |
1889 | lrecs++; | 1889 | lrecs++; |
@@ -3535,7 +3535,7 @@ xfs_btree_delrec( | |||
3535 | XFS_BTREE_STATS_INC(cur, join); | 3535 | XFS_BTREE_STATS_INC(cur, join); |
3536 | 3536 | ||
3537 | /* | 3537 | /* |
3538 | * Fix up the the number of records and right block pointer in the | 3538 | * Fix up the number of records and right block pointer in the |
3539 | * surviving block, and log it. | 3539 | * surviving block, and log it. |
3540 | */ | 3540 | */ |
3541 | xfs_btree_set_numrecs(left, lrecs + rrecs); | 3541 | xfs_btree_set_numrecs(left, lrecs + rrecs); |
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h index 789fffdf8b2f..4f852b735b96 100644 --- a/fs/xfs/xfs_btree.h +++ b/fs/xfs/xfs_btree.h | |||
@@ -41,7 +41,7 @@ extern kmem_zone_t *xfs_btree_cur_zone; | |||
41 | /* | 41 | /* |
42 | * Generic btree header. | 42 | * Generic btree header. |
43 | * | 43 | * |
44 | * This is a comination of the actual format used on disk for short and long | 44 | * This is a combination of the actual format used on disk for short and long |
45 | * format btrees. The first three fields are shared by both format, but | 45 | * format btrees. The first three fields are shared by both format, but |
46 | * the pointers are different and should be used with care. | 46 | * the pointers are different and should be used with care. |
47 | * | 47 | * |
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h index 41f27b332048..8c536167bf75 100644 --- a/fs/xfs/xfs_da_btree.h +++ b/fs/xfs/xfs_da_btree.h | |||
@@ -185,7 +185,7 @@ typedef struct xfs_da_state { | |||
185 | unsigned char inleaf; /* insert into 1->lf, 0->splf */ | 185 | unsigned char inleaf; /* insert into 1->lf, 0->splf */ |
186 | unsigned char extravalid; /* T/F: extrablk is in use */ | 186 | unsigned char extravalid; /* T/F: extrablk is in use */ |
187 | unsigned char extraafter; /* T/F: extrablk is after new */ | 187 | unsigned char extraafter; /* T/F: extrablk is after new */ |
188 | xfs_da_state_blk_t extrablk; /* for double-splits on leafs */ | 188 | xfs_da_state_blk_t extrablk; /* for double-splits on leaves */ |
189 | /* for dirv2 extrablk is data */ | 189 | /* for dirv2 extrablk is data */ |
190 | } xfs_da_state_t; | 190 | } xfs_da_state_t; |
191 | 191 | ||
diff --git a/fs/xfs/xfs_dinode.h b/fs/xfs/xfs_dinode.h index 162e8726df5e..e5b153b2e6a3 100644 --- a/fs/xfs/xfs_dinode.h +++ b/fs/xfs/xfs_dinode.h | |||
@@ -103,7 +103,9 @@ typedef enum xfs_dinode_fmt { | |||
103 | /* | 103 | /* |
104 | * Inode size for given fs. | 104 | * Inode size for given fs. |
105 | */ | 105 | */ |
106 | #define XFS_LITINO(mp) ((mp)->m_litino) | 106 | #define XFS_LITINO(mp) \ |
107 | ((int)(((mp)->m_sb.sb_inodesize) - sizeof(struct xfs_dinode))) | ||
108 | |||
107 | #define XFS_BROOT_SIZE_ADJ \ | 109 | #define XFS_BROOT_SIZE_ADJ \ |
108 | (XFS_BTREE_LBLOCK_LEN - sizeof(xfs_bmdr_block_t)) | 110 | (XFS_BTREE_LBLOCK_LEN - sizeof(xfs_bmdr_block_t)) |
109 | 111 | ||
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index e1f0a06aaf04..ab52e9e1c1ee 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -448,7 +448,6 @@ xfs_dir2_block_getdents( | |||
448 | xfs_mount_t *mp; /* filesystem mount point */ | 448 | xfs_mount_t *mp; /* filesystem mount point */ |
449 | char *ptr; /* current data entry */ | 449 | char *ptr; /* current data entry */ |
450 | int wantoff; /* starting block offset */ | 450 | int wantoff; /* starting block offset */ |
451 | xfs_ino_t ino; | ||
452 | xfs_off_t cook; | 451 | xfs_off_t cook; |
453 | 452 | ||
454 | mp = dp->i_mount; | 453 | mp = dp->i_mount; |
@@ -509,16 +508,12 @@ xfs_dir2_block_getdents( | |||
509 | 508 | ||
510 | cook = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, | 509 | cook = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, |
511 | (char *)dep - (char *)block); | 510 | (char *)dep - (char *)block); |
512 | ino = be64_to_cpu(dep->inumber); | ||
513 | #if XFS_BIG_INUMS | ||
514 | ino += mp->m_inoadd; | ||
515 | #endif | ||
516 | 511 | ||
517 | /* | 512 | /* |
518 | * If it didn't fit, set the final offset to here & return. | 513 | * If it didn't fit, set the final offset to here & return. |
519 | */ | 514 | */ |
520 | if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff, | 515 | if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff, |
521 | ino, DT_UNKNOWN)) { | 516 | be64_to_cpu(dep->inumber), DT_UNKNOWN)) { |
522 | *offset = cook & 0x7fffffff; | 517 | *offset = cook & 0x7fffffff; |
523 | xfs_da_brelse(NULL, bp); | 518 | xfs_da_brelse(NULL, bp); |
524 | return 0; | 519 | return 0; |
diff --git a/fs/xfs/xfs_dir2_data.h b/fs/xfs/xfs_dir2_data.h index b816e0252739..efbc290c7fec 100644 --- a/fs/xfs/xfs_dir2_data.h +++ b/fs/xfs/xfs_dir2_data.h | |||
@@ -38,7 +38,7 @@ struct xfs_trans; | |||
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Directory address space divided into sections, | 40 | * Directory address space divided into sections, |
41 | * spaces separated by 32gb. | 41 | * spaces separated by 32GB. |
42 | */ | 42 | */ |
43 | #define XFS_DIR2_SPACE_SIZE (1ULL << (32 + XFS_DIR2_DATA_ALIGN_LOG)) | 43 | #define XFS_DIR2_SPACE_SIZE (1ULL << (32 + XFS_DIR2_DATA_ALIGN_LOG)) |
44 | #define XFS_DIR2_DATA_SPACE 0 | 44 | #define XFS_DIR2_DATA_SPACE 0 |
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index 6427ff11089f..fa913e459442 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
@@ -780,7 +780,6 @@ xfs_dir2_leaf_getdents( | |||
780 | int ra_index; /* *map index for read-ahead */ | 780 | int ra_index; /* *map index for read-ahead */ |
781 | int ra_offset; /* map entry offset for ra */ | 781 | int ra_offset; /* map entry offset for ra */ |
782 | int ra_want; /* readahead count wanted */ | 782 | int ra_want; /* readahead count wanted */ |
783 | xfs_ino_t ino; | ||
784 | 783 | ||
785 | /* | 784 | /* |
786 | * If the offset is at or past the largest allowed value, | 785 | * If the offset is at or past the largest allowed value, |
@@ -1076,24 +1075,12 @@ xfs_dir2_leaf_getdents( | |||
1076 | continue; | 1075 | continue; |
1077 | } | 1076 | } |
1078 | 1077 | ||
1079 | /* | ||
1080 | * Copy the entry into the putargs, and try formatting it. | ||
1081 | */ | ||
1082 | dep = (xfs_dir2_data_entry_t *)ptr; | 1078 | dep = (xfs_dir2_data_entry_t *)ptr; |
1083 | |||
1084 | length = xfs_dir2_data_entsize(dep->namelen); | 1079 | length = xfs_dir2_data_entsize(dep->namelen); |
1085 | 1080 | ||
1086 | ino = be64_to_cpu(dep->inumber); | ||
1087 | #if XFS_BIG_INUMS | ||
1088 | ino += mp->m_inoadd; | ||
1089 | #endif | ||
1090 | |||
1091 | /* | ||
1092 | * Won't fit. Return to caller. | ||
1093 | */ | ||
1094 | if (filldir(dirent, dep->name, dep->namelen, | 1081 | if (filldir(dirent, dep->name, dep->namelen, |
1095 | xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff, | 1082 | xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff, |
1096 | ino, DT_UNKNOWN)) | 1083 | be64_to_cpu(dep->inumber), DT_UNKNOWN)) |
1097 | break; | 1084 | break; |
1098 | 1085 | ||
1099 | /* | 1086 | /* |
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c index fa6c3a5ddbc6..5a81ccd1045b 100644 --- a/fs/xfs/xfs_dir2_node.c +++ b/fs/xfs/xfs_dir2_node.c | |||
@@ -1104,7 +1104,7 @@ xfs_dir2_leafn_remove( | |||
1104 | } | 1104 | } |
1105 | xfs_dir2_leafn_check(dp, bp); | 1105 | xfs_dir2_leafn_check(dp, bp); |
1106 | /* | 1106 | /* |
1107 | * Return indication of whether this leaf block is emtpy enough | 1107 | * Return indication of whether this leaf block is empty enough |
1108 | * to justify trying to join it with a neighbor. | 1108 | * to justify trying to join it with a neighbor. |
1109 | */ | 1109 | */ |
1110 | *rval = | 1110 | *rval = |
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index a8a8a6efad5b..e89734e84646 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -748,11 +748,7 @@ xfs_dir2_sf_getdents( | |||
748 | * Put . entry unless we're starting past it. | 748 | * Put . entry unless we're starting past it. |
749 | */ | 749 | */ |
750 | if (*offset <= dot_offset) { | 750 | if (*offset <= dot_offset) { |
751 | ino = dp->i_ino; | 751 | if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, dp->i_ino, DT_DIR)) { |
752 | #if XFS_BIG_INUMS | ||
753 | ino += mp->m_inoadd; | ||
754 | #endif | ||
755 | if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, ino, DT_DIR)) { | ||
756 | *offset = dot_offset & 0x7fffffff; | 752 | *offset = dot_offset & 0x7fffffff; |
757 | return 0; | 753 | return 0; |
758 | } | 754 | } |
@@ -763,9 +759,6 @@ xfs_dir2_sf_getdents( | |||
763 | */ | 759 | */ |
764 | if (*offset <= dotdot_offset) { | 760 | if (*offset <= dotdot_offset) { |
765 | ino = xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent); | 761 | ino = xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent); |
766 | #if XFS_BIG_INUMS | ||
767 | ino += mp->m_inoadd; | ||
768 | #endif | ||
769 | if (filldir(dirent, "..", 2, dotdot_offset & 0x7fffffff, ino, DT_DIR)) { | 762 | if (filldir(dirent, "..", 2, dotdot_offset & 0x7fffffff, ino, DT_DIR)) { |
770 | *offset = dotdot_offset & 0x7fffffff; | 763 | *offset = dotdot_offset & 0x7fffffff; |
771 | return 0; | 764 | return 0; |
@@ -786,10 +779,6 @@ xfs_dir2_sf_getdents( | |||
786 | } | 779 | } |
787 | 780 | ||
788 | ino = xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)); | 781 | ino = xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)); |
789 | #if XFS_BIG_INUMS | ||
790 | ino += mp->m_inoadd; | ||
791 | #endif | ||
792 | |||
793 | if (filldir(dirent, sfep->name, sfep->namelen, | 782 | if (filldir(dirent, sfep->name, sfep->namelen, |
794 | off & 0x7fffffff, ino, DT_UNKNOWN)) { | 783 | off & 0x7fffffff, ino, DT_UNKNOWN)) { |
795 | *offset = off & 0x7fffffff; | 784 | *offset = off & 0x7fffffff; |
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 680d0e0ec932..8379e3bca26c 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
@@ -576,7 +576,7 @@ out: | |||
576 | if (fdblks_delta) { | 576 | if (fdblks_delta) { |
577 | /* | 577 | /* |
578 | * If we are putting blocks back here, m_resblks_avail is | 578 | * If we are putting blocks back here, m_resblks_avail is |
579 | * already at it's max so this will put it in the free pool. | 579 | * already at its max so this will put it in the free pool. |
580 | * | 580 | * |
581 | * If we need space, we'll either succeed in getting it | 581 | * If we need space, we'll either succeed in getting it |
582 | * from the free block count or we'll get an enospc. If | 582 | * from the free block count or we'll get an enospc. If |
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 62d1ceae0943..3120a3a5e20f 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -349,7 +349,7 @@ xfs_ialloc_ag_alloc( | |||
349 | * Initialize all inodes in this buffer and then log them. | 349 | * Initialize all inodes in this buffer and then log them. |
350 | * | 350 | * |
351 | * XXX: It would be much better if we had just one transaction to | 351 | * XXX: It would be much better if we had just one transaction to |
352 | * log a whole cluster of inodes instead of all the indivdual | 352 | * log a whole cluster of inodes instead of all the individual |
353 | * transactions causing a lot of log traffic. | 353 | * transactions causing a lot of log traffic. |
354 | */ | 354 | */ |
355 | xfs_biozero(fbuf, 0, ninodes << args.mp->m_sb.sb_inodelog); | 355 | xfs_biozero(fbuf, 0, ninodes << args.mp->m_sb.sb_inodelog); |
diff --git a/fs/xfs/xfs_ialloc_btree.c b/fs/xfs/xfs_ialloc_btree.c index 99f2408e8d8e..c282a9af5393 100644 --- a/fs/xfs/xfs_ialloc_btree.c +++ b/fs/xfs/xfs_ialloc_btree.c | |||
@@ -164,7 +164,7 @@ xfs_inobt_init_rec_from_cur( | |||
164 | } | 164 | } |
165 | 165 | ||
166 | /* | 166 | /* |
167 | * intial value of ptr for lookup | 167 | * initial value of ptr for lookup |
168 | */ | 168 | */ |
169 | STATIC void | 169 | STATIC void |
170 | xfs_inobt_init_ptr_from_cur( | 170 | xfs_inobt_init_ptr_from_cur( |
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 1f175fa34b22..f879c1bc4b96 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -122,7 +122,7 @@ typedef struct xfs_ictimestamp { | |||
122 | 122 | ||
123 | /* | 123 | /* |
124 | * NOTE: This structure must be kept identical to struct xfs_dinode | 124 | * NOTE: This structure must be kept identical to struct xfs_dinode |
125 | * in xfs_dinode.h except for the endianess annotations. | 125 | * in xfs_dinode.h except for the endianness annotations. |
126 | */ | 126 | */ |
127 | typedef struct xfs_icdinode { | 127 | typedef struct xfs_icdinode { |
128 | __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ | 128 | __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ |
diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h index ee1a0c134cc2..a1cc1322fc0f 100644 --- a/fs/xfs/xfs_iomap.h +++ b/fs/xfs/xfs_iomap.h | |||
@@ -63,7 +63,7 @@ typedef enum { | |||
63 | */ | 63 | */ |
64 | 64 | ||
65 | typedef struct xfs_iomap { | 65 | typedef struct xfs_iomap { |
66 | xfs_daddr_t iomap_bn; /* first 512b blk of mapping */ | 66 | xfs_daddr_t iomap_bn; /* first 512B blk of mapping */ |
67 | xfs_buftarg_t *iomap_target; | 67 | xfs_buftarg_t *iomap_target; |
68 | xfs_off_t iomap_offset; /* offset of mapping, bytes */ | 68 | xfs_off_t iomap_offset; /* offset of mapping, bytes */ |
69 | xfs_off_t iomap_bsize; /* size of mapping, bytes */ | 69 | xfs_off_t iomap_bsize; /* size of mapping, bytes */ |
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 24f1d139a636..aeb2d2221c7d 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -584,7 +584,7 @@ xfs_bulkstat( | |||
584 | * first inode of the cluster. | 584 | * first inode of the cluster. |
585 | * | 585 | * |
586 | * Careful with clustidx. There can be | 586 | * Careful with clustidx. There can be |
587 | * multple clusters per chunk, a single | 587 | * multiple clusters per chunk, a single |
588 | * cluster per chunk or a cluster that has | 588 | * cluster per chunk or a cluster that has |
589 | * inodes represented from several different | 589 | * inodes represented from several different |
590 | * chunks (if blocksize is large). | 590 | * chunks (if blocksize is large). |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 25faa3fe83d2..f76c6d7cea21 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1098,7 +1098,7 @@ xlog_bdstrat_cb(struct xfs_buf *bp) | |||
1098 | /* | 1098 | /* |
1099 | * Return size of each in-core log record buffer. | 1099 | * Return size of each in-core log record buffer. |
1100 | * | 1100 | * |
1101 | * All machines get 8 x 32KB buffers by default, unless tuned otherwise. | 1101 | * All machines get 8 x 32kB buffers by default, unless tuned otherwise. |
1102 | * | 1102 | * |
1103 | * If the filesystem blocksize is too large, we may need to choose a | 1103 | * If the filesystem blocksize is too large, we may need to choose a |
1104 | * larger size since the directory code currently logs entire blocks. | 1104 | * larger size since the directory code currently logs entire blocks. |
@@ -1128,8 +1128,8 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp, | |||
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | if (xfs_sb_version_haslogv2(&mp->m_sb)) { | 1130 | if (xfs_sb_version_haslogv2(&mp->m_sb)) { |
1131 | /* # headers = size / 32K | 1131 | /* # headers = size / 32k |
1132 | * one header holds cycles from 32K of data | 1132 | * one header holds cycles from 32k of data |
1133 | */ | 1133 | */ |
1134 | 1134 | ||
1135 | xhdrs = mp->m_logbsize / XLOG_HEADER_CYCLE_SIZE; | 1135 | xhdrs = mp->m_logbsize / XLOG_HEADER_CYCLE_SIZE; |
@@ -1145,7 +1145,7 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp, | |||
1145 | goto done; | 1145 | goto done; |
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | /* All machines use 32KB buffers by default. */ | 1148 | /* All machines use 32kB buffers by default. */ |
1149 | log->l_iclog_size = XLOG_BIG_RECORD_BSIZE; | 1149 | log->l_iclog_size = XLOG_BIG_RECORD_BSIZE; |
1150 | log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT; | 1150 | log->l_iclog_size_log = XLOG_BIG_RECORD_BSHIFT; |
1151 | 1151 | ||
@@ -3179,7 +3179,7 @@ xlog_state_want_sync(xlog_t *log, xlog_in_core_t *iclog) | |||
3179 | */ | 3179 | */ |
3180 | 3180 | ||
3181 | /* | 3181 | /* |
3182 | * Free a used ticket when it's refcount falls to zero. | 3182 | * Free a used ticket when its refcount falls to zero. |
3183 | */ | 3183 | */ |
3184 | void | 3184 | void |
3185 | xfs_log_ticket_put( | 3185 | xfs_log_ticket_put( |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 2549a235dad2..b101990df027 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include "xfs_fsops.h" | 45 | #include "xfs_fsops.h" |
46 | #include "xfs_utils.h" | 46 | #include "xfs_utils.h" |
47 | 47 | ||
48 | STATIC int xfs_uuid_mount(xfs_mount_t *); | ||
49 | STATIC void xfs_unmountfs_wait(xfs_mount_t *); | 48 | STATIC void xfs_unmountfs_wait(xfs_mount_t *); |
50 | 49 | ||
51 | 50 | ||
@@ -121,6 +120,84 @@ static const struct { | |||
121 | { sizeof(xfs_sb_t), 0 } | 120 | { sizeof(xfs_sb_t), 0 } |
122 | }; | 121 | }; |
123 | 122 | ||
123 | static DEFINE_MUTEX(xfs_uuid_table_mutex); | ||
124 | static int xfs_uuid_table_size; | ||
125 | static uuid_t *xfs_uuid_table; | ||
126 | |||
127 | /* | ||
128 | * See if the UUID is unique among mounted XFS filesystems. | ||
129 | * Mount fails if UUID is nil or a FS with the same UUID is already mounted. | ||
130 | */ | ||
131 | STATIC int | ||
132 | xfs_uuid_mount( | ||
133 | struct xfs_mount *mp) | ||
134 | { | ||
135 | uuid_t *uuid = &mp->m_sb.sb_uuid; | ||
136 | int hole, i; | ||
137 | |||
138 | if (mp->m_flags & XFS_MOUNT_NOUUID) | ||
139 | return 0; | ||
140 | |||
141 | if (uuid_is_nil(uuid)) { | ||
142 | cmn_err(CE_WARN, | ||
143 | "XFS: Filesystem %s has nil UUID - can't mount", | ||
144 | mp->m_fsname); | ||
145 | return XFS_ERROR(EINVAL); | ||
146 | } | ||
147 | |||
148 | mutex_lock(&xfs_uuid_table_mutex); | ||
149 | for (i = 0, hole = -1; i < xfs_uuid_table_size; i++) { | ||
150 | if (uuid_is_nil(&xfs_uuid_table[i])) { | ||
151 | hole = i; | ||
152 | continue; | ||
153 | } | ||
154 | if (uuid_equal(uuid, &xfs_uuid_table[i])) | ||
155 | goto out_duplicate; | ||
156 | } | ||
157 | |||
158 | if (hole < 0) { | ||
159 | xfs_uuid_table = kmem_realloc(xfs_uuid_table, | ||
160 | (xfs_uuid_table_size + 1) * sizeof(*xfs_uuid_table), | ||
161 | xfs_uuid_table_size * sizeof(*xfs_uuid_table), | ||
162 | KM_SLEEP); | ||
163 | hole = xfs_uuid_table_size++; | ||
164 | } | ||
165 | xfs_uuid_table[hole] = *uuid; | ||
166 | mutex_unlock(&xfs_uuid_table_mutex); | ||
167 | |||
168 | return 0; | ||
169 | |||
170 | out_duplicate: | ||
171 | mutex_unlock(&xfs_uuid_table_mutex); | ||
172 | cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't mount", | ||
173 | mp->m_fsname); | ||
174 | return XFS_ERROR(EINVAL); | ||
175 | } | ||
176 | |||
177 | STATIC void | ||
178 | xfs_uuid_unmount( | ||
179 | struct xfs_mount *mp) | ||
180 | { | ||
181 | uuid_t *uuid = &mp->m_sb.sb_uuid; | ||
182 | int i; | ||
183 | |||
184 | if (mp->m_flags & XFS_MOUNT_NOUUID) | ||
185 | return; | ||
186 | |||
187 | mutex_lock(&xfs_uuid_table_mutex); | ||
188 | for (i = 0; i < xfs_uuid_table_size; i++) { | ||
189 | if (uuid_is_nil(&xfs_uuid_table[i])) | ||
190 | continue; | ||
191 | if (!uuid_equal(uuid, &xfs_uuid_table[i])) | ||
192 | continue; | ||
193 | memset(&xfs_uuid_table[i], 0, sizeof(uuid_t)); | ||
194 | break; | ||
195 | } | ||
196 | ASSERT(i < xfs_uuid_table_size); | ||
197 | mutex_unlock(&xfs_uuid_table_mutex); | ||
198 | } | ||
199 | |||
200 | |||
124 | /* | 201 | /* |
125 | * Free up the resources associated with a mount structure. Assume that | 202 | * Free up the resources associated with a mount structure. Assume that |
126 | * the structure was initially zeroed, so we can tell which fields got | 203 | * the structure was initially zeroed, so we can tell which fields got |
@@ -256,6 +333,22 @@ xfs_mount_validate_sb( | |||
256 | return XFS_ERROR(ENOSYS); | 333 | return XFS_ERROR(ENOSYS); |
257 | } | 334 | } |
258 | 335 | ||
336 | /* | ||
337 | * Currently only very few inode sizes are supported. | ||
338 | */ | ||
339 | switch (sbp->sb_inodesize) { | ||
340 | case 256: | ||
341 | case 512: | ||
342 | case 1024: | ||
343 | case 2048: | ||
344 | break; | ||
345 | default: | ||
346 | xfs_fs_mount_cmn_err(flags, | ||
347 | "inode size of %d bytes not supported", | ||
348 | sbp->sb_inodesize); | ||
349 | return XFS_ERROR(ENOSYS); | ||
350 | } | ||
351 | |||
259 | if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) || | 352 | if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) || |
260 | xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) { | 353 | xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) { |
261 | xfs_fs_mount_cmn_err(flags, | 354 | xfs_fs_mount_cmn_err(flags, |
@@ -574,32 +667,10 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp) | |||
574 | mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT; | 667 | mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT; |
575 | mp->m_agno_log = xfs_highbit32(sbp->sb_agcount - 1) + 1; | 668 | mp->m_agno_log = xfs_highbit32(sbp->sb_agcount - 1) + 1; |
576 | mp->m_agino_log = sbp->sb_inopblog + sbp->sb_agblklog; | 669 | mp->m_agino_log = sbp->sb_inopblog + sbp->sb_agblklog; |
577 | mp->m_litino = sbp->sb_inodesize - sizeof(struct xfs_dinode); | ||
578 | mp->m_blockmask = sbp->sb_blocksize - 1; | 670 | mp->m_blockmask = sbp->sb_blocksize - 1; |
579 | mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG; | 671 | mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG; |
580 | mp->m_blockwmask = mp->m_blockwsize - 1; | 672 | mp->m_blockwmask = mp->m_blockwsize - 1; |
581 | 673 | ||
582 | /* | ||
583 | * Setup for attributes, in case they get created. | ||
584 | * This value is for inodes getting attributes for the first time, | ||
585 | * the per-inode value is for old attribute values. | ||
586 | */ | ||
587 | ASSERT(sbp->sb_inodesize >= 256 && sbp->sb_inodesize <= 2048); | ||
588 | switch (sbp->sb_inodesize) { | ||
589 | case 256: | ||
590 | mp->m_attroffset = XFS_LITINO(mp) - | ||
591 | XFS_BMDR_SPACE_CALC(MINABTPTRS); | ||
592 | break; | ||
593 | case 512: | ||
594 | case 1024: | ||
595 | case 2048: | ||
596 | mp->m_attroffset = XFS_BMDR_SPACE_CALC(6 * MINABTPTRS); | ||
597 | break; | ||
598 | default: | ||
599 | ASSERT(0); | ||
600 | } | ||
601 | ASSERT(mp->m_attroffset < XFS_LITINO(mp)); | ||
602 | |||
603 | mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1); | 674 | mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1); |
604 | mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0); | 675 | mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0); |
605 | mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2; | 676 | mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2; |
@@ -645,7 +716,7 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount) | |||
645 | for (index = 0; index < agcount; index++) { | 716 | for (index = 0; index < agcount; index++) { |
646 | /* | 717 | /* |
647 | * read the agf, then the agi. This gets us | 718 | * read the agf, then the agi. This gets us |
648 | * all the inforamtion we need and populates the | 719 | * all the information we need and populates the |
649 | * per-ag structures for us. | 720 | * per-ag structures for us. |
650 | */ | 721 | */ |
651 | error = xfs_alloc_pagf_init(mp, NULL, index, 0); | 722 | error = xfs_alloc_pagf_init(mp, NULL, index, 0); |
@@ -968,18 +1039,9 @@ xfs_mountfs( | |||
968 | 1039 | ||
969 | mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog); | 1040 | mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog); |
970 | 1041 | ||
971 | /* | 1042 | error = xfs_uuid_mount(mp); |
972 | * XFS uses the uuid from the superblock as the unique | 1043 | if (error) |
973 | * identifier for fsid. We can not use the uuid from the volume | 1044 | goto out; |
974 | * since a single partition filesystem is identical to a single | ||
975 | * partition volume/filesystem. | ||
976 | */ | ||
977 | if (!(mp->m_flags & XFS_MOUNT_NOUUID)) { | ||
978 | if (xfs_uuid_mount(mp)) { | ||
979 | error = XFS_ERROR(EINVAL); | ||
980 | goto out; | ||
981 | } | ||
982 | } | ||
983 | 1045 | ||
984 | /* | 1046 | /* |
985 | * Set the minimum read and write sizes | 1047 | * Set the minimum read and write sizes |
@@ -1198,8 +1260,7 @@ xfs_mountfs( | |||
1198 | out_free_perag: | 1260 | out_free_perag: |
1199 | xfs_free_perag(mp); | 1261 | xfs_free_perag(mp); |
1200 | out_remove_uuid: | 1262 | out_remove_uuid: |
1201 | if (!(mp->m_flags & XFS_MOUNT_NOUUID)) | 1263 | xfs_uuid_unmount(mp); |
1202 | uuid_table_remove(&mp->m_sb.sb_uuid); | ||
1203 | out: | 1264 | out: |
1204 | return error; | 1265 | return error; |
1205 | } | 1266 | } |
@@ -1226,7 +1287,7 @@ xfs_unmountfs( | |||
1226 | 1287 | ||
1227 | /* | 1288 | /* |
1228 | * We can potentially deadlock here if we have an inode cluster | 1289 | * We can potentially deadlock here if we have an inode cluster |
1229 | * that has been freed has it's buffer still pinned in memory because | 1290 | * that has been freed has its buffer still pinned in memory because |
1230 | * the transaction is still sitting in a iclog. The stale inodes | 1291 | * the transaction is still sitting in a iclog. The stale inodes |
1231 | * on that buffer will have their flush locks held until the | 1292 | * on that buffer will have their flush locks held until the |
1232 | * transaction hits the disk and the callbacks run. the inode | 1293 | * transaction hits the disk and the callbacks run. the inode |
@@ -1258,7 +1319,7 @@ xfs_unmountfs( | |||
1258 | * Unreserve any blocks we have so that when we unmount we don't account | 1319 | * Unreserve any blocks we have so that when we unmount we don't account |
1259 | * the reserved free space as used. This is really only necessary for | 1320 | * the reserved free space as used. This is really only necessary for |
1260 | * lazy superblock counting because it trusts the incore superblock | 1321 | * lazy superblock counting because it trusts the incore superblock |
1261 | * counters to be aboslutely correct on clean unmount. | 1322 | * counters to be absolutely correct on clean unmount. |
1262 | * | 1323 | * |
1263 | * We don't bother correcting this elsewhere for lazy superblock | 1324 | * We don't bother correcting this elsewhere for lazy superblock |
1264 | * counting because on mount of an unclean filesystem we reconstruct the | 1325 | * counting because on mount of an unclean filesystem we reconstruct the |
@@ -1282,9 +1343,7 @@ xfs_unmountfs( | |||
1282 | xfs_unmountfs_wait(mp); /* wait for async bufs */ | 1343 | xfs_unmountfs_wait(mp); /* wait for async bufs */ |
1283 | xfs_log_unmount_write(mp); | 1344 | xfs_log_unmount_write(mp); |
1284 | xfs_log_unmount(mp); | 1345 | xfs_log_unmount(mp); |
1285 | 1346 | xfs_uuid_unmount(mp); | |
1286 | if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) | ||
1287 | uuid_table_remove(&mp->m_sb.sb_uuid); | ||
1288 | 1347 | ||
1289 | #if defined(DEBUG) | 1348 | #if defined(DEBUG) |
1290 | xfs_errortag_clearall(mp, 0); | 1349 | xfs_errortag_clearall(mp, 0); |
@@ -1786,29 +1845,6 @@ xfs_freesb( | |||
1786 | } | 1845 | } |
1787 | 1846 | ||
1788 | /* | 1847 | /* |
1789 | * See if the UUID is unique among mounted XFS filesystems. | ||
1790 | * Mount fails if UUID is nil or a FS with the same UUID is already mounted. | ||
1791 | */ | ||
1792 | STATIC int | ||
1793 | xfs_uuid_mount( | ||
1794 | xfs_mount_t *mp) | ||
1795 | { | ||
1796 | if (uuid_is_nil(&mp->m_sb.sb_uuid)) { | ||
1797 | cmn_err(CE_WARN, | ||
1798 | "XFS: Filesystem %s has nil UUID - can't mount", | ||
1799 | mp->m_fsname); | ||
1800 | return -1; | ||
1801 | } | ||
1802 | if (!uuid_table_insert(&mp->m_sb.sb_uuid)) { | ||
1803 | cmn_err(CE_WARN, | ||
1804 | "XFS: Filesystem %s has duplicate UUID - can't mount", | ||
1805 | mp->m_fsname); | ||
1806 | return -1; | ||
1807 | } | ||
1808 | return 0; | ||
1809 | } | ||
1810 | |||
1811 | /* | ||
1812 | * Used to log changes to the superblock unit and width fields which could | 1848 | * Used to log changes to the superblock unit and width fields which could |
1813 | * be altered by the mount options, as well as any potential sb_features2 | 1849 | * be altered by the mount options, as well as any potential sb_features2 |
1814 | * fixup. Only the first superblock is updated. | 1850 | * fixup. Only the first superblock is updated. |
@@ -1861,7 +1897,7 @@ xfs_mount_log_sb( | |||
1861 | * we disable the per-cpu counter and go through the slow path. | 1897 | * we disable the per-cpu counter and go through the slow path. |
1862 | * | 1898 | * |
1863 | * The slow path is the current xfs_mod_incore_sb() function. This means that | 1899 | * The slow path is the current xfs_mod_incore_sb() function. This means that |
1864 | * when we disable a per-cpu counter, we need to drain it's resources back to | 1900 | * when we disable a per-cpu counter, we need to drain its resources back to |
1865 | * the global superblock. We do this after disabling the counter to prevent | 1901 | * the global superblock. We do this after disabling the counter to prevent |
1866 | * more threads from queueing up on the counter. | 1902 | * more threads from queueing up on the counter. |
1867 | * | 1903 | * |
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 1438dd4dc909..7af44adffc8f 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -276,12 +276,10 @@ typedef struct xfs_mount { | |||
276 | int m_fixedfsid[2]; /* unchanged for life of FS */ | 276 | int m_fixedfsid[2]; /* unchanged for life of FS */ |
277 | uint m_dmevmask; /* DMI events for this FS */ | 277 | uint m_dmevmask; /* DMI events for this FS */ |
278 | __uint64_t m_flags; /* global mount flags */ | 278 | __uint64_t m_flags; /* global mount flags */ |
279 | uint m_attroffset; /* inode attribute offset */ | ||
280 | uint m_dir_node_ents; /* #entries in a dir danode */ | 279 | uint m_dir_node_ents; /* #entries in a dir danode */ |
281 | uint m_attr_node_ents; /* #entries in attr danode */ | 280 | uint m_attr_node_ents; /* #entries in attr danode */ |
282 | int m_ialloc_inos; /* inodes in inode allocation */ | 281 | int m_ialloc_inos; /* inodes in inode allocation */ |
283 | int m_ialloc_blks; /* blocks in inode allocation */ | 282 | int m_ialloc_blks; /* blocks in inode allocation */ |
284 | int m_litino; /* size of inode union area */ | ||
285 | int m_inoalign_mask;/* mask sb_inoalignmt if used */ | 283 | int m_inoalign_mask;/* mask sb_inoalignmt if used */ |
286 | uint m_qflags; /* quota status flags */ | 284 | uint m_qflags; /* quota status flags */ |
287 | xfs_trans_reservations_t m_reservations;/* precomputed res values */ | 285 | xfs_trans_reservations_t m_reservations;/* precomputed res values */ |
@@ -289,9 +287,6 @@ typedef struct xfs_mount { | |||
289 | __uint64_t m_maxioffset; /* maximum inode offset */ | 287 | __uint64_t m_maxioffset; /* maximum inode offset */ |
290 | __uint64_t m_resblks; /* total reserved blocks */ | 288 | __uint64_t m_resblks; /* total reserved blocks */ |
291 | __uint64_t m_resblks_avail;/* available reserved blocks */ | 289 | __uint64_t m_resblks_avail;/* available reserved blocks */ |
292 | #if XFS_BIG_INUMS | ||
293 | xfs_ino_t m_inoadd; /* add value for ino64_offset */ | ||
294 | #endif | ||
295 | int m_dalign; /* stripe unit */ | 290 | int m_dalign; /* stripe unit */ |
296 | int m_swidth; /* stripe width */ | 291 | int m_swidth; /* stripe width */ |
297 | int m_sinoalign; /* stripe unit inode alignment */ | 292 | int m_sinoalign; /* stripe unit inode alignment */ |
@@ -333,7 +328,6 @@ typedef struct xfs_mount { | |||
333 | #define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all metadata ops | 328 | #define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all metadata ops |
334 | must be synchronous except | 329 | must be synchronous except |
335 | for space allocations */ | 330 | for space allocations */ |
336 | #define XFS_MOUNT_INO64 (1ULL << 1) | ||
337 | #define XFS_MOUNT_DMAPI (1ULL << 2) /* dmapi is enabled */ | 331 | #define XFS_MOUNT_DMAPI (1ULL << 2) /* dmapi is enabled */ |
338 | #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) | 332 | #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) |
339 | #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem | 333 | #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem |
@@ -385,8 +379,8 @@ typedef struct xfs_mount { | |||
385 | * Synchronous read and write sizes. This should be | 379 | * Synchronous read and write sizes. This should be |
386 | * better for NFSv2 wsync filesystems. | 380 | * better for NFSv2 wsync filesystems. |
387 | */ | 381 | */ |
388 | #define XFS_WSYNC_READIO_LOG 15 /* 32K */ | 382 | #define XFS_WSYNC_READIO_LOG 15 /* 32k */ |
389 | #define XFS_WSYNC_WRITEIO_LOG 14 /* 16K */ | 383 | #define XFS_WSYNC_WRITEIO_LOG 14 /* 16k */ |
390 | 384 | ||
391 | /* | 385 | /* |
392 | * Allow large block sizes to be reported to userspace programs if the | 386 | * Allow large block sizes to be reported to userspace programs if the |
diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h index 3bac681218a4..b2d67adb6a08 100644 --- a/fs/xfs/xfs_rtalloc.h +++ b/fs/xfs/xfs_rtalloc.h | |||
@@ -23,8 +23,8 @@ struct xfs_trans; | |||
23 | 23 | ||
24 | /* Min and max rt extent sizes, specified in bytes */ | 24 | /* Min and max rt extent sizes, specified in bytes */ |
25 | #define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */ | 25 | #define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */ |
26 | #define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64KB */ | 26 | #define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64kB */ |
27 | #define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4KB */ | 27 | #define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4kB */ |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Constants for bit manipulations. | 30 | * Constants for bit manipulations. |
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 166f728bea70..775249a54f6f 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h | |||
@@ -292,7 +292,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) | |||
292 | * In a write transaction we can allocate a maximum of 2 | 292 | * In a write transaction we can allocate a maximum of 2 |
293 | * extents. This gives: | 293 | * extents. This gives: |
294 | * the inode getting the new extents: inode size | 294 | * the inode getting the new extents: inode size |
295 | * the inode\'s bmap btree: max depth * block size | 295 | * the inode's bmap btree: max depth * block size |
296 | * the agfs of the ags from which the extents are allocated: 2 * sector | 296 | * the agfs of the ags from which the extents are allocated: 2 * sector |
297 | * the superblock free block counter: sector size | 297 | * the superblock free block counter: sector size |
298 | * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size | 298 | * the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size |
@@ -321,7 +321,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) | |||
321 | /* | 321 | /* |
322 | * In truncating a file we free up to two extents at once. We can modify: | 322 | * In truncating a file we free up to two extents at once. We can modify: |
323 | * the inode being truncated: inode size | 323 | * the inode being truncated: inode size |
324 | * the inode\'s bmap btree: (max depth + 1) * block size | 324 | * the inode's bmap btree: (max depth + 1) * block size |
325 | * And the bmap_finish transaction can free the blocks and bmap blocks: | 325 | * And the bmap_finish transaction can free the blocks and bmap blocks: |
326 | * the agf for each of the ags: 4 * sector size | 326 | * the agf for each of the ags: 4 * sector size |
327 | * the agfl for each of the ags: 4 * sector size | 327 | * the agfl for each of the ags: 4 * sector size |
@@ -431,8 +431,8 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) | |||
431 | * the new inode: inode size | 431 | * the new inode: inode size |
432 | * the inode btree entry: 1 block | 432 | * the inode btree entry: 1 block |
433 | * the directory btree: (max depth + v2) * dir block size | 433 | * the directory btree: (max depth + v2) * dir block size |
434 | * the directory inode\'s bmap btree: (max depth + v2) * block size | 434 | * the directory inode's bmap btree: (max depth + v2) * block size |
435 | * the blocks for the symlink: 1 KB | 435 | * the blocks for the symlink: 1 kB |
436 | * Or in the first xact we allocate some inodes giving: | 436 | * Or in the first xact we allocate some inodes giving: |
437 | * the agi and agf of the ag getting the new inodes: 2 * sectorsize | 437 | * the agi and agf of the ag getting the new inodes: 2 * sectorsize |
438 | * the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize | 438 | * the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize |
@@ -463,7 +463,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) | |||
463 | * the inode btree entry: block size | 463 | * the inode btree entry: block size |
464 | * the superblock for the nlink flag: sector size | 464 | * the superblock for the nlink flag: sector size |
465 | * the directory btree: (max depth + v2) * dir block size | 465 | * the directory btree: (max depth + v2) * dir block size |
466 | * the directory inode\'s bmap btree: (max depth + v2) * block size | 466 | * the directory inode's bmap btree: (max depth + v2) * block size |
467 | * Or in the first xact we allocate some inodes giving: | 467 | * Or in the first xact we allocate some inodes giving: |
468 | * the agi and agf of the ag getting the new inodes: 2 * sectorsize | 468 | * the agi and agf of the ag getting the new inodes: 2 * sectorsize |
469 | * the superblock for the nlink flag: sector size | 469 | * the superblock for the nlink flag: sector size |
@@ -637,7 +637,7 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) | |||
637 | /* | 637 | /* |
638 | * Removing the attribute fork of a file | 638 | * Removing the attribute fork of a file |
639 | * the inode being truncated: inode size | 639 | * the inode being truncated: inode size |
640 | * the inode\'s bmap btree: max depth * block size | 640 | * the inode's bmap btree: max depth * block size |
641 | * And the bmap_finish transaction can free the blocks and bmap blocks: | 641 | * And the bmap_finish transaction can free the blocks and bmap blocks: |
642 | * the agf for each of the ags: 4 * sector size | 642 | * the agf for each of the ags: 4 * sector size |
643 | * the agfl for each of the ags: 4 * sector size | 643 | * the agfl for each of the ags: 4 * sector size |
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index 2d47f10f8bed..f31271c30de9 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c | |||
@@ -79,7 +79,7 @@ xfs_trans_ail_tail( | |||
79 | * the push is run asynchronously in a separate thread, so we return the tail | 79 | * the push is run asynchronously in a separate thread, so we return the tail |
80 | * of the log right now instead of the tail after the push. This means we will | 80 | * of the log right now instead of the tail after the push. This means we will |
81 | * either continue right away, or we will sleep waiting on the async thread to | 81 | * either continue right away, or we will sleep waiting on the async thread to |
82 | * do it's work. | 82 | * do its work. |
83 | * | 83 | * |
84 | * We do this unlocked - we only need to know whether there is anything in the | 84 | * We do this unlocked - we only need to know whether there is anything in the |
85 | * AIL at the time we are called. We don't need to access the contents of | 85 | * AIL at the time we are called. We don't need to access the contents of |
@@ -160,7 +160,7 @@ xfs_trans_ail_cursor_next( | |||
160 | /* | 160 | /* |
161 | * Now that the traversal is complete, we need to remove the cursor | 161 | * Now that the traversal is complete, we need to remove the cursor |
162 | * from the list of traversing cursors. Avoid removing the embedded | 162 | * from the list of traversing cursors. Avoid removing the embedded |
163 | * push cursor, but use the fact it is alway present to make the | 163 | * push cursor, but use the fact it is always present to make the |
164 | * list deletion simple. | 164 | * list deletion simple. |
165 | */ | 165 | */ |
166 | void | 166 | void |
diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c index e110bf57d7f4..eb3fc57f9eef 100644 --- a/fs/xfs/xfs_trans_item.c +++ b/fs/xfs/xfs_trans_item.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "xfs_inum.h" | 22 | #include "xfs_inum.h" |
23 | #include "xfs_trans.h" | 23 | #include "xfs_trans.h" |
24 | #include "xfs_trans_priv.h" | 24 | #include "xfs_trans_priv.h" |
25 | /* XXX: from here down needed until struct xfs_trans has it's own ailp */ | 25 | /* XXX: from here down needed until struct xfs_trans has its own ailp */ |
26 | #include "xfs_bit.h" | 26 | #include "xfs_bit.h" |
27 | #include "xfs_buf_item.h" | 27 | #include "xfs_buf_item.h" |
28 | #include "xfs_sb.h" | 28 | #include "xfs_sb.h" |
diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c index fcc2285d03ed..79b9e5ea5359 100644 --- a/fs/xfs/xfs_utils.c +++ b/fs/xfs/xfs_utils.c | |||
@@ -374,7 +374,7 @@ xfs_truncate_file( | |||
374 | 374 | ||
375 | /* | 375 | /* |
376 | * Follow the normal truncate locking protocol. Since we | 376 | * Follow the normal truncate locking protocol. Since we |
377 | * hold the inode in the transaction, we know that it's number | 377 | * hold the inode in the transaction, we know that its number |
378 | * of references will stay constant. | 378 | * of references will stay constant. |
379 | */ | 379 | */ |
380 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 380 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 6e28461e7611..7394c7af5de5 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -2862,7 +2862,7 @@ xfs_free_file_space( | |||
2862 | 2862 | ||
2863 | /* | 2863 | /* |
2864 | * Need to zero the stuff we're not freeing, on disk. | 2864 | * Need to zero the stuff we're not freeing, on disk. |
2865 | * If its a realtime file & can't use unwritten extents then we | 2865 | * If it's a realtime file & can't use unwritten extents then we |
2866 | * actually need to zero the extent edges. Otherwise xfs_bunmapi | 2866 | * actually need to zero the extent edges. Otherwise xfs_bunmapi |
2867 | * will take care of it for us. | 2867 | * will take care of it for us. |
2868 | */ | 2868 | */ |