xfs_super.c 53.4 KB
Newer Older
1
// SPDX-License-Identifier: GPL-2.0
Linus Torvalds's avatar
Linus Torvalds committed
2
/*
3
 * Copyright (c) 2000-2006 Silicon Graphics, Inc.
4
 * All Rights Reserved.
Linus Torvalds's avatar
Linus Torvalds committed
5
 */
Christoph Hellwig's avatar
Christoph Hellwig committed
6

Linus Torvalds's avatar
Linus Torvalds committed
7
#include "xfs.h"
8
#include "xfs_shared.h"
9
#include "xfs_format.h"
10 11
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
Linus Torvalds's avatar
Linus Torvalds committed
12 13 14
#include "xfs_sb.h"
#include "xfs_mount.h"
#include "xfs_inode.h"
15
#include "xfs_btree.h"
Linus Torvalds's avatar
Linus Torvalds committed
16
#include "xfs_bmap.h"
17
#include "xfs_alloc.h"
Christoph Hellwig's avatar
Christoph Hellwig committed
18
#include "xfs_fsops.h"
19
#include "xfs_trans.h"
Linus Torvalds's avatar
Linus Torvalds committed
20
#include "xfs_buf_item.h"
21
#include "xfs_log.h"
22
#include "xfs_log_priv.h"
23
#include "xfs_dir2.h"
24 25 26
#include "xfs_extfree_item.h"
#include "xfs_mru_cache.h"
#include "xfs_inode_item.h"
27
#include "xfs_icache.h"
Christoph Hellwig's avatar
Christoph Hellwig committed
28
#include "xfs_trace.h"
Dave Chinner's avatar
Dave Chinner committed
29
#include "xfs_icreate_item.h"
30 31
#include "xfs_filestream.h"
#include "xfs_quota.h"
32
#include "xfs_sysfs.h"
33
#include "xfs_ondisk.h"
34
#include "xfs_rmap_item.h"
35
#include "xfs_refcount_item.h"
36
#include "xfs_bmap_item.h"
37
#include "xfs_reflink.h"
Linus Torvalds's avatar
Linus Torvalds committed
38

39
#include <linux/magic.h>
40 41
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
Linus Torvalds's avatar
Linus Torvalds committed
42

43
static const struct super_operations xfs_super_operations;
44

45
static struct kset *xfs_kset;		/* top-level xfs sysfs dir */
46 47 48
#ifdef DEBUG
static struct xfs_kobj xfs_dbg_kobj;	/* global debug sysfs attrs */
#endif
Linus Torvalds's avatar
Linus Torvalds committed
49

50 51 52 53
/*
 * Table driven mount option parser.
 */
enum {
54
	Opt_logbufs, Opt_logbsize, Opt_logdev, Opt_rtdev,
55
	Opt_wsync, Opt_noalign, Opt_swalloc, Opt_sunit, Opt_swidth, Opt_nouuid,
56
	Opt_grpid, Opt_nogrpid, Opt_bsdgroups, Opt_sysvgroups,
57 58 59 60
	Opt_allocsize, Opt_norecovery, Opt_inode64, Opt_inode32, Opt_ikeep,
	Opt_noikeep, Opt_largeio, Opt_nolargeio, Opt_attr2, Opt_noattr2,
	Opt_filestreams, Opt_quota, Opt_noquota, Opt_usrquota, Opt_grpquota,
	Opt_prjquota, Opt_uquota, Opt_gquota, Opt_pquota,
61
	Opt_uqnoenforce, Opt_gqnoenforce, Opt_pqnoenforce, Opt_qnoenforce,
62
	Opt_discard, Opt_nodiscard, Opt_dax,
63 64
};

65
static const struct fs_parameter_spec xfs_fs_parameters[] = {
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
	fsparam_u32("logbufs",		Opt_logbufs),
	fsparam_string("logbsize",	Opt_logbsize),
	fsparam_string("logdev",	Opt_logdev),
	fsparam_string("rtdev",		Opt_rtdev),
	fsparam_flag("wsync",		Opt_wsync),
	fsparam_flag("noalign",		Opt_noalign),
	fsparam_flag("swalloc",		Opt_swalloc),
	fsparam_u32("sunit",		Opt_sunit),
	fsparam_u32("swidth",		Opt_swidth),
	fsparam_flag("nouuid",		Opt_nouuid),
	fsparam_flag("grpid",		Opt_grpid),
	fsparam_flag("nogrpid",		Opt_nogrpid),
	fsparam_flag("bsdgroups",	Opt_bsdgroups),
	fsparam_flag("sysvgroups",	Opt_sysvgroups),
	fsparam_string("allocsize",	Opt_allocsize),
	fsparam_flag("norecovery",	Opt_norecovery),
	fsparam_flag("inode64",		Opt_inode64),
	fsparam_flag("inode32",		Opt_inode32),
	fsparam_flag("ikeep",		Opt_ikeep),
	fsparam_flag("noikeep",		Opt_noikeep),
	fsparam_flag("largeio",		Opt_largeio),
	fsparam_flag("nolargeio",	Opt_nolargeio),
	fsparam_flag("attr2",		Opt_attr2),
	fsparam_flag("noattr2",		Opt_noattr2),
	fsparam_flag("filestreams",	Opt_filestreams),
	fsparam_flag("quota",		Opt_quota),
	fsparam_flag("noquota",		Opt_noquota),
	fsparam_flag("usrquota",	Opt_usrquota),
	fsparam_flag("grpquota",	Opt_grpquota),
	fsparam_flag("prjquota",	Opt_prjquota),
	fsparam_flag("uquota",		Opt_uquota),
	fsparam_flag("gquota",		Opt_gquota),
	fsparam_flag("pquota",		Opt_pquota),
	fsparam_flag("uqnoenforce",	Opt_uqnoenforce),
	fsparam_flag("gqnoenforce",	Opt_gqnoenforce),
	fsparam_flag("pqnoenforce",	Opt_pqnoenforce),
	fsparam_flag("qnoenforce",	Opt_qnoenforce),
	fsparam_flag("discard",		Opt_discard),
	fsparam_flag("nodiscard",	Opt_nodiscard),
	fsparam_flag("dax",		Opt_dax),
	{}
107 108
};

109
struct proc_xfs_info {
Dave Chinner's avatar
Dave Chinner committed
110 111
	uint64_t	flag;
	char		*str;
112 113
};

114 115 116 117
static int
xfs_fs_show_options(
	struct seq_file		*m,
	struct dentry		*root)
118 119 120
{
	static struct proc_xfs_info xfs_info_set[] = {
		/* the few simple ones we can get from the mount struct */
121 122 123 124 125 126 127 128 129 130
		{ XFS_MOUNT_IKEEP,		",ikeep" },
		{ XFS_MOUNT_WSYNC,		",wsync" },
		{ XFS_MOUNT_NOALIGN,		",noalign" },
		{ XFS_MOUNT_SWALLOC,		",swalloc" },
		{ XFS_MOUNT_NOUUID,		",nouuid" },
		{ XFS_MOUNT_NORECOVERY,		",norecovery" },
		{ XFS_MOUNT_ATTR2,		",attr2" },
		{ XFS_MOUNT_FILESTREAMS,	",filestreams" },
		{ XFS_MOUNT_GRPID,		",grpid" },
		{ XFS_MOUNT_DISCARD,		",discard" },
131
		{ XFS_MOUNT_LARGEIO,		",largeio" },
132
		{ XFS_MOUNT_DAX,		",dax" },
133 134
		{ 0, NULL }
	};
135
	struct xfs_mount	*mp = XFS_M(root->d_sb);
136 137 138 139 140 141
	struct proc_xfs_info	*xfs_infop;

	for (xfs_infop = xfs_info_set; xfs_infop->flag; xfs_infop++) {
		if (mp->m_flags & xfs_infop->flag)
			seq_puts(m, xfs_infop->str);
	}
142 143 144

	seq_printf(m, ",inode%d",
		(mp->m_flags & XFS_MOUNT_SMALL_INUMS) ? 32 : 64);
145

146
	if (mp->m_flags & XFS_MOUNT_ALLOCSIZE)
147
		seq_printf(m, ",allocsize=%dk",
148
			   (1 << mp->m_allocsize_log) >> 10);
149 150

	if (mp->m_logbufs > 0)
151
		seq_printf(m, ",logbufs=%d", mp->m_logbufs);
152
	if (mp->m_logbsize > 0)
153
		seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10);
154 155

	if (mp->m_logname)
156
		seq_show_option(m, "logdev", mp->m_logname);
157
	if (mp->m_rtname)
158
		seq_show_option(m, "rtdev", mp->m_rtname);
159 160

	if (mp->m_dalign > 0)
161
		seq_printf(m, ",sunit=%d",
162 163
				(int)XFS_FSB_TO_BB(mp, mp->m_dalign));
	if (mp->m_swidth > 0)
164
		seq_printf(m, ",swidth=%d",
165 166 167
				(int)XFS_FSB_TO_BB(mp, mp->m_swidth));

	if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD))
168
		seq_puts(m, ",usrquota");
169
	else if (mp->m_qflags & XFS_UQUOTA_ACCT)
170
		seq_puts(m, ",uqnoenforce");
171

172
	if (mp->m_qflags & XFS_PQUOTA_ACCT) {
173
		if (mp->m_qflags & XFS_PQUOTA_ENFD)
174
			seq_puts(m, ",prjquota");
175
		else
176
			seq_puts(m, ",pqnoenforce");
177 178
	}
	if (mp->m_qflags & XFS_GQUOTA_ACCT) {
179
		if (mp->m_qflags & XFS_GQUOTA_ENFD)
180
			seq_puts(m, ",grpquota");
181
		else
182
			seq_puts(m, ",gqnoenforce");
183
	}
184 185

	if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
186
		seq_puts(m, ",noquota");
187 188

	return 0;
189
}
190

191
/*
192 193 194 195 196 197 198 199 200 201 202 203 204
 * Set parameters for inode allocation heuristics, taking into account
 * filesystem size and inode32/inode64 mount options; i.e. specifically
 * whether or not XFS_MOUNT_SMALL_INUMS is set.
 *
 * Inode allocation patterns are altered only if inode32 is requested
 * (XFS_MOUNT_SMALL_INUMS), and the filesystem is sufficiently large.
 * If altered, XFS_MOUNT_32BITINODES is set as well.
 *
 * An agcount independent of that in the mount structure is provided
 * because in the growfs case, mp->m_sb.sb_agcount is not yet updated
 * to the potentially higher ag count.
 *
 * Returns the maximum AG index which may contain inodes.
205
 */
206
xfs_agnumber_t
207 208 209
xfs_set_inode_alloc(
	struct xfs_mount *mp,
	xfs_agnumber_t	agcount)
210
{
211
	xfs_agnumber_t	index;
212
	xfs_agnumber_t	maxagi = 0;
213 214
	xfs_sb_t	*sbp = &mp->m_sb;
	xfs_agnumber_t	max_metadata;
Eric Sandeen's avatar
Eric Sandeen committed
215 216
	xfs_agino_t	agino;
	xfs_ino_t	ino;
217

218 219 220
	/*
	 * Calculate how much should be reserved for inodes to meet
	 * the max inode percentage.  Used only for inode32.
221
	 */
Darrick J. Wong's avatar
Darrick J. Wong committed
222
	if (M_IGEO(mp)->maxicount) {
223
		uint64_t	icount;
224 225 226 227 228 229 230

		icount = sbp->sb_dblocks * sbp->sb_imax_pct;
		do_div(icount, 100);
		icount += sbp->sb_agblocks - 1;
		do_div(icount, sbp->sb_agblocks);
		max_metadata = icount;
	} else {
231
		max_metadata = agcount;
232 233
	}

234
	/* Get the last possible inode in the filesystem */
235
	agino =	XFS_AGB_TO_AGINO(mp, sbp->sb_agblocks - 1);
236 237 238 239 240 241 242 243 244 245 246
	ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino);

	/*
	 * If user asked for no more than 32-bit inodes, and the fs is
	 * sufficiently large, set XFS_MOUNT_32BITINODES if we must alter
	 * the allocator to accommodate the request.
	 */
	if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32)
		mp->m_flags |= XFS_MOUNT_32BITINODES;
	else
		mp->m_flags &= ~XFS_MOUNT_32BITINODES;
Eric Sandeen's avatar
Eric Sandeen committed
247

248
	for (index = 0; index < agcount; index++) {
249
		struct xfs_perag	*pag;
250

251
		ino = XFS_AGINO_TO_INO(mp, index, agino);
252 253 254

		pag = xfs_perag_get(mp, index);

255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
		if (mp->m_flags & XFS_MOUNT_32BITINODES) {
			if (ino > XFS_MAXINUMBER_32) {
				pag->pagi_inodeok = 0;
				pag->pagf_metadata = 0;
			} else {
				pag->pagi_inodeok = 1;
				maxagi++;
				if (index < max_metadata)
					pag->pagf_metadata = 1;
				else
					pag->pagf_metadata = 0;
			}
		} else {
			pag->pagi_inodeok = 1;
			pag->pagf_metadata = 0;
		}
271 272 273 274

		xfs_perag_put(pag);
	}

275
	return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount;
276 277
}

Hannes Eder's avatar
Hannes Eder committed
278
STATIC int
Linus Torvalds's avatar
Linus Torvalds committed
279 280 281 282 283 284 285
xfs_blkdev_get(
	xfs_mount_t		*mp,
	const char		*name,
	struct block_device	**bdevp)
{
	int			error = 0;

286 287
	*bdevp = blkdev_get_by_path(name, FMODE_READ|FMODE_WRITE|FMODE_EXCL,
				    mp);
Linus Torvalds's avatar
Linus Torvalds committed
288 289
	if (IS_ERR(*bdevp)) {
		error = PTR_ERR(*bdevp);
290
		xfs_warn(mp, "Invalid device [%s], error=%d", name, error);
Linus Torvalds's avatar
Linus Torvalds committed
291 292
	}

293
	return error;
Linus Torvalds's avatar
Linus Torvalds committed
294 295
}

Hannes Eder's avatar
Hannes Eder committed
296
STATIC void
Linus Torvalds's avatar
Linus Torvalds committed
297 298 299 300
xfs_blkdev_put(
	struct block_device	*bdev)
{
	if (bdev)
301
		blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
Linus Torvalds's avatar
Linus Torvalds committed
302 303
}

304 305 306 307
void
xfs_blkdev_issue_flush(
	xfs_buftarg_t		*buftarg)
{
308
	blkdev_issue_flush(buftarg->bt_bdev, GFP_NOFS, NULL);
309
}
Linus Torvalds's avatar
Linus Torvalds committed
310

311 312 313 314
STATIC void
xfs_close_devices(
	struct xfs_mount	*mp)
{
315 316
	struct dax_device *dax_ddev = mp->m_ddev_targp->bt_daxdev;

317
	if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
318
		struct block_device *logdev = mp->m_logdev_targp->bt_bdev;
319 320
		struct dax_device *dax_logdev = mp->m_logdev_targp->bt_daxdev;

321
		xfs_free_buftarg(mp->m_logdev_targp);
322
		xfs_blkdev_put(logdev);
323
		fs_put_dax(dax_logdev);
324 325
	}
	if (mp->m_rtdev_targp) {
326
		struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev;
327 328
		struct dax_device *dax_rtdev = mp->m_rtdev_targp->bt_daxdev;

329
		xfs_free_buftarg(mp->m_rtdev_targp);
330
		xfs_blkdev_put(rtdev);
331
		fs_put_dax(dax_rtdev);
332
	}
333
	xfs_free_buftarg(mp->m_ddev_targp);
334
	fs_put_dax(dax_ddev);
335 336 337 338 339 340 341 342 343 344 345 346 347 348
}

/*
 * The file system configurations are:
 *	(1) device (partition) with data and internal log
 *	(2) logical volume with data and log subvolumes.
 *	(3) logical volume with data, log, and realtime subvolumes.
 *
 * We only have to handle opening the log and realtime volumes here if
 * they are present.  The data subvolume has already been opened by
 * get_sb_bdev() and is stored in sb->s_bdev.
 */
STATIC int
xfs_open_devices(
349
	struct xfs_mount	*mp)
350 351
{
	struct block_device	*ddev = mp->m_super->s_bdev;
352 353
	struct dax_device	*dax_ddev = fs_dax_get_by_bdev(ddev);
	struct dax_device	*dax_logdev = NULL, *dax_rtdev = NULL;
354 355 356 357 358 359
	struct block_device	*logdev = NULL, *rtdev = NULL;
	int			error;

	/*
	 * Open real time and log devices - order is important.
	 */
360 361
	if (mp->m_logname) {
		error = xfs_blkdev_get(mp, mp->m_logname, &logdev);
362 363
		if (error)
			goto out;
364
		dax_logdev = fs_dax_get_by_bdev(logdev);
365 366
	}

367 368
	if (mp->m_rtname) {
		error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev);
369 370 371 372
		if (error)
			goto out_close_logdev;

		if (rtdev == ddev || rtdev == logdev) {
373 374
			xfs_warn(mp,
	"Cannot mount filesystem with identical rtdev and ddev/logdev.");
375
			error = -EINVAL;
376 377
			goto out_close_rtdev;
		}
378
		dax_rtdev = fs_dax_get_by_bdev(rtdev);
379 380 381 382 383
	}

	/*
	 * Setup xfs_mount buffer target pointers
	 */
384
	error = -ENOMEM;
385
	mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev, dax_ddev);
386 387 388 389
	if (!mp->m_ddev_targp)
		goto out_close_rtdev;

	if (rtdev) {
390
		mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev, dax_rtdev);
391 392 393 394 395
		if (!mp->m_rtdev_targp)
			goto out_free_ddev_targ;
	}

	if (logdev && logdev != ddev) {
396
		mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev, dax_logdev);
397 398 399 400 401 402 403 404 405 406
		if (!mp->m_logdev_targp)
			goto out_free_rtdev_targ;
	} else {
		mp->m_logdev_targp = mp->m_ddev_targp;
	}

	return 0;

 out_free_rtdev_targ:
	if (mp->m_rtdev_targp)
407
		xfs_free_buftarg(mp->m_rtdev_targp);
408
 out_free_ddev_targ:
409
	xfs_free_buftarg(mp->m_ddev_targp);
410
 out_close_rtdev:
411
	xfs_blkdev_put(rtdev);
412
	fs_put_dax(dax_rtdev);
413
 out_close_logdev:
414
	if (logdev && logdev != ddev) {
415
		xfs_blkdev_put(logdev);
416 417
		fs_put_dax(dax_logdev);
	}
418
 out:
419
	fs_put_dax(dax_ddev);
420 421 422
	return error;
}

423 424 425 426 427 428 429 430
/*
 * Setup xfs_mount buffer target pointers based on superblock
 */
STATIC int
xfs_setup_devices(
	struct xfs_mount	*mp)
{
	int			error;
431

432
	error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize);
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
	if (error)
		return error;

	if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
		unsigned int	log_sector_size = BBSIZE;

		if (xfs_sb_version_hassector(&mp->m_sb))
			log_sector_size = mp->m_sb.sb_logsectsize;
		error = xfs_setsize_buftarg(mp->m_logdev_targp,
					    log_sector_size);
		if (error)
			return error;
	}
	if (mp->m_rtdev_targp) {
		error = xfs_setsize_buftarg(mp->m_rtdev_targp,
					    mp->m_sb.sb_sectsize);
		if (error)
			return error;
	}

	return 0;
}
455

456 457 458 459
STATIC int
xfs_init_mount_workqueues(
	struct xfs_mount	*mp)
{
460
	mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s",
461
			WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_super->s_id);
462 463 464
	if (!mp->m_buf_workqueue)
		goto out;

465
	mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s",
466
			WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id);
467
	if (!mp->m_unwritten_workqueue)
468
		goto out_destroy_buf;
469

470
	mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s",
471
			WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_UNBOUND,
472
			0, mp->m_super->s_id);
473 474
	if (!mp->m_cil_workqueue)
		goto out_destroy_unwritten;
Dave Chinner's avatar
Dave Chinner committed
475 476

	mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s",
477
			WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id);
Dave Chinner's avatar
Dave Chinner committed
478 479 480
	if (!mp->m_reclaim_workqueue)
		goto out_destroy_cil;

481
	mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s",
482
			WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id);
483
	if (!mp->m_eofblocks_workqueue)
484
		goto out_destroy_reclaim;
485

486
	mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", WQ_FREEZABLE, 0,
487
					       mp->m_super->s_id);
488 489 490
	if (!mp->m_sync_workqueue)
		goto out_destroy_eofb;

491 492
	return 0;

493 494
out_destroy_eofb:
	destroy_workqueue(mp->m_eofblocks_workqueue);
Dave Chinner's avatar
Dave Chinner committed
495 496 497 498
out_destroy_reclaim:
	destroy_workqueue(mp->m_reclaim_workqueue);
out_destroy_cil:
	destroy_workqueue(mp->m_cil_workqueue);
499 500
out_destroy_unwritten:
	destroy_workqueue(mp->m_unwritten_workqueue);
501 502
out_destroy_buf:
	destroy_workqueue(mp->m_buf_workqueue);
503 504 505 506 507 508 509 510
out:
	return -ENOMEM;
}

STATIC void
xfs_destroy_mount_workqueues(
	struct xfs_mount	*mp)
{
511
	destroy_workqueue(mp->m_sync_workqueue);
512
	destroy_workqueue(mp->m_eofblocks_workqueue);
Dave Chinner's avatar
Dave Chinner committed
513
	destroy_workqueue(mp->m_reclaim_workqueue);
514
	destroy_workqueue(mp->m_cil_workqueue);
515
	destroy_workqueue(mp->m_unwritten_workqueue);
516
	destroy_workqueue(mp->m_buf_workqueue);
517 518
}

519 520 521 522 523 524 525 526 527 528 529 530
/*
 * Flush all dirty data to disk. Must not be called while holding an XFS_ILOCK
 * or a page lock. We use sync_inodes_sb() here to ensure we block while waiting
 * for IO to complete so that we effectively throttle multiple callers to the
 * rate at which IO is completing.
 */
void
xfs_flush_inodes(
	struct xfs_mount	*mp)
{
	struct super_block	*sb = mp->m_super;

531 532 533
	if (!__ratelimit(&mp->m_flush_inodes_ratelimit))
		return;

534
	if (down_read_trylock(&sb->s_umount)) {
535
		sync_inodes_sb(sb);
536 537 538 539
		up_read(&sb->s_umount);
	}
}

540
/* Catch misguided souls that try to use this interface on XFS */
Linus Torvalds's avatar
Linus Torvalds committed
541
STATIC struct inode *
542
xfs_fs_alloc_inode(
Linus Torvalds's avatar
Linus Torvalds committed
543 544
	struct super_block	*sb)
{
545
	BUG();
546
	return NULL;
Linus Torvalds's avatar
Linus Torvalds committed
547 548
}

549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
#ifdef DEBUG
static void
xfs_check_delalloc(
	struct xfs_inode	*ip,
	int			whichfork)
{
	struct xfs_ifork	*ifp = XFS_IFORK_PTR(ip, whichfork);
	struct xfs_bmbt_irec	got;
	struct xfs_iext_cursor	icur;

	if (!ifp || !xfs_iext_lookup_extent(ip, ifp, 0, &icur, &got))
		return;
	do {
		if (isnullstartblock(got.br_startblock)) {
			xfs_warn(ip->i_mount,
	"ino %llx %s fork has delalloc extent at [0x%llx:0x%llx]",
				ip->i_ino,
				whichfork == XFS_DATA_FORK ? "data" : "cow",
				got.br_startoff, got.br_blockcount);
		}
	} while (xfs_iext_next_extent(ifp, &icur, &got));
}
#else
#define xfs_check_delalloc(ip, whichfork)	do { } while (0)
#endif

575
/*
576
 * Now that the generic code is guaranteed not to be accessing
577
 * the linux inode, we can inactivate and reclaim the inode.
578
 */
Linus Torvalds's avatar
Linus Torvalds committed
579
STATIC void
580
xfs_fs_destroy_inode(
581
	struct inode		*inode)
Linus Torvalds's avatar
Linus Torvalds committed
582
{
583 584
	struct xfs_inode	*ip = XFS_I(inode);

585
	trace_xfs_destroy_inode(ip);
586

587
	ASSERT(!rwsem_is_locked(&inode->i_rwsem));
588 589 590 591
	XFS_STATS_INC(ip->i_mount, vn_rele);
	XFS_STATS_INC(ip->i_mount, vn_remove);

	xfs_inactive(ip);
592

593 594 595 596 597 598
	if (!XFS_FORCED_SHUTDOWN(ip->i_mount) && ip->i_delayed_blks) {
		xfs_check_delalloc(ip, XFS_DATA_FORK);
		xfs_check_delalloc(ip, XFS_COW_FORK);
		ASSERT(0);
	}

599
	XFS_STATS_INC(ip->i_mount, vn_reclaim);
600 601 602 603 604 605 606 607

	/*
	 * We should never get here with one of the reclaim flags already set.
	 */
	ASSERT_ALWAYS(!xfs_iflags_test(ip, XFS_IRECLAIMABLE));
	ASSERT_ALWAYS(!xfs_iflags_test(ip, XFS_IRECLAIM));

	/*
608 609 610 611 612
	 * We always use background reclaim here because even if the
	 * inode is clean, it still may be under IO and hence we have
	 * to take the flush lock. The background reclaim path handles
	 * this more efficiently than we can here, so simply let background
	 * reclaim tear down all inodes.
613
	 */
614
	xfs_inode_set_reclaim_tag(ip);
Linus Torvalds's avatar
Linus Torvalds committed
615 616
}

617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638
static void
xfs_fs_dirty_inode(
	struct inode			*inode,
	int				flag)
{
	struct xfs_inode		*ip = XFS_I(inode);
	struct xfs_mount		*mp = ip->i_mount;
	struct xfs_trans		*tp;

	if (!(inode->i_sb->s_flags & SB_LAZYTIME))
		return;
	if (flag != I_DIRTY_SYNC || !(inode->i_state & I_DIRTY_TIME))
		return;

	if (xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp))
		return;
	xfs_ilock(ip, XFS_ILOCK_EXCL);
	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
	xfs_trans_log_inode(tp, ip, XFS_ILOG_TIMESTAMP);
	xfs_trans_commit(tp);
}

639 640 641 642
/*
 * Slab object creation initialisation for the XFS inode.
 * This covers only the idempotent fields in the XFS inode;
 * all other fields need to be initialised on allocation
643
 * from the slab. This avoids the need to repeatedly initialise
644 645 646
 * fields in the xfs inode that left in the initialise state
 * when freeing the inode.
 */
647 648
STATIC void
xfs_fs_inode_init_once(
649 650 651 652 653
	void			*inode)
{
	struct xfs_inode	*ip = inode;

	memset(ip, 0, sizeof(struct xfs_inode));
654 655 656 657 658

	/* vfs inode */
	inode_init_once(VFS_I(ip));

	/* xfs inode */
659 660 661
	atomic_set(&ip->i_pincount, 0);
	spin_lock_init(&ip->i_flags_lock);

662 663
	mrlock_init(&ip->i_mmaplock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER,
		     "xfsino", ip->i_ino);
664 665 666 667
	mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER,
		     "xfsino", ip->i_ino);
}

668 669 670 671 672 673 674 675 676 677 678 679 680
/*
 * We do an unlocked check for XFS_IDONTCACHE here because we are already
 * serialised against cache hits here via the inode->i_lock and igrab() in
 * xfs_iget_cache_hit(). Hence a lookup that might clear this flag will not be
 * racing with us, and it avoids needing to grab a spinlock here for every inode
 * we drop the final reference on.
 */
STATIC int
xfs_fs_drop_inode(
	struct inode		*inode)
{
	struct xfs_inode	*ip = XFS_I(inode);

681 682 683 684 685 686 687 688 689 690
	/*
	 * If this unlinked inode is in the middle of recovery, don't
	 * drop the inode just yet; log recovery will take care of
	 * that.  See the comment for this inode flag.
	 */
	if (ip->i_flags & XFS_IRECOVERY) {
		ASSERT(ip->i_mount->m_log->l_flags & XLOG_RECOVERY_NEEDED);
		return 0;
	}

691 692 693
	return generic_drop_inode(inode) || (ip->i_flags & XFS_IDONTCACHE);
}

694 695
static void
xfs_mount_free(
696 697 698 699
	struct xfs_mount	*mp)
{
	kfree(mp->m_rtname);
	kfree(mp->m_logname);
700
	kmem_free(mp);
701 702
}

Linus Torvalds's avatar
Linus Torvalds committed
703
STATIC int
Christoph Hellwig's avatar
Christoph Hellwig committed
704
xfs_fs_sync_fs(
Linus Torvalds's avatar
Linus Torvalds committed
705 706 707
	struct super_block	*sb,
	int			wait)
{
708
	struct xfs_mount	*mp = XFS_M(sb);
Linus Torvalds's avatar
Linus Torvalds committed
709

710
	/*
Christoph Hellwig's avatar
Christoph Hellwig committed
711
	 * Doing anything during the async pass would be counterproductive.
712
	 */
Christoph Hellwig's avatar
Christoph Hellwig committed
713
	if (!wait)
Christoph Hellwig's avatar
Christoph Hellwig committed
714 715
		return 0;

716
	xfs_log_force(mp, XFS_LOG_SYNC);
Christoph Hellwig's avatar
Christoph Hellwig committed
717
	if (laptop_mode) {
Linus Torvalds's avatar
Linus Torvalds committed
718 719
		/*
		 * The disk must be active because we're syncing.
720
		 * We schedule log work now (now that the disk is
Linus Torvalds's avatar
Linus Torvalds committed
721 722
		 * active) instead of later (when it might not be).
		 */
723
		flush_delayed_work(&mp->m_log->l_work);
Linus Torvalds's avatar
Linus Torvalds committed
724 725
	}

Christoph Hellwig's avatar
Christoph Hellwig committed
726
	return 0;
Linus Torvalds's avatar
Linus Torvalds committed
727 728 729
}

STATIC int
730
xfs_fs_statfs(
731
	struct dentry		*dentry,
Linus Torvalds's avatar
Linus Torvalds committed
732 733
	struct kstatfs		*statp)
{
734 735
	struct xfs_mount	*mp = XFS_M(dentry->d_sb);
	xfs_sb_t		*sbp = &mp->m_sb;
736
	struct xfs_inode	*ip = XFS_I(d_inode(dentry));
737 738 739 740
	uint64_t		fakeinos, id;
	uint64_t		icount;
	uint64_t		ifree;
	uint64_t		fdblocks;
741
	xfs_extlen_t		lsize;
742
	int64_t			ffree;
743

744
	statp->f_type = XFS_SUPER_MAGIC;
745 746 747 748 749 750
	statp->f_namelen = MAXNAMELEN - 1;

	id = huge_encode_dev(mp->m_ddev_targp->bt_dev);
	statp->f_fsid.val[0] = (u32)id;
	statp->f_fsid.val[1] = (u32)(id >> 32);

751
	icount = percpu_counter_sum(&mp->m_icount);
752
	ifree = percpu_counter_sum(&mp->m_ifree);
753
	fdblocks = percpu_counter_sum(&mp->m_fdblocks);
754 755 756 757 758

	spin_lock(&mp->m_sb_lock);
	statp->f_bsize = sbp->sb_blocksize;
	lsize = sbp->sb_logstart ? sbp->sb_logblocks : 0;
	statp->f_blocks = sbp->sb_dblocks - lsize;
759 760
	spin_unlock(&mp->m_sb_lock);

761
	statp->f_bfree = fdblocks - mp->m_alloc_set_aside;
762 763
	statp->f_bavail = statp->f_bfree;

764
	fakeinos = XFS_FSB_TO_INO(mp, statp->f_bfree);
Dave Chinner's avatar
Dave Chinner committed
765
	statp->f_files = min(icount + fakeinos, (uint64_t)XFS_MAXINUMBER);
Darrick J. Wong's avatar
Darrick J. Wong committed
766
	if (M_IGEO(mp)->maxicount)
767 768
		statp->f_files = min_t(typeof(statp->f_files),
					statp->f_files,
Darrick J. Wong's avatar
Darrick J. Wong committed
769
					M_IGEO(mp)->maxicount);
770

771 772 773 774 775
	/* If sb_icount overshot maxicount, report actual allocation */
	statp->f_files = max_t(typeof(statp->f_files),
					statp->f_files,
					sbp->sb_icount);

776
	/* make sure statp->f_ffree does not underflow */
777
	ffree = statp->f_files - (icount - ifree);
778
	statp->f_ffree = max_t(int64_t, ffree, 0);
779

780

781
	if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
782 783
	    ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) ==
			      (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))
Christoph Hellwig's avatar
Christoph Hellwig committed
784
		xfs_qm_statvfs(ip, statp);
785 786 787 788 789 790 791 792

	if (XFS_IS_REALTIME_MOUNT(mp) &&
	    (ip->i_d.di_flags & (XFS_DIFLAG_RTINHERIT | XFS_DIFLAG_REALTIME))) {
		statp->f_blocks = sbp->sb_rblocks;
		statp->f_bavail = statp->f_bfree =
			sbp->sb_frextents * sbp->sb_rextsize;
	}

793
	return 0;
Linus Torvalds's avatar
Linus Torvalds committed
794 795
}

796 797 798
STATIC void
xfs_save_resvblks(struct xfs_mount *mp)
{
799
	uint64_t resblks = 0;
800 801 802 803 804 805 806 807

	mp->m_resblks_save = mp->m_resblks;
	xfs_reserve_blocks(mp, &resblks, NULL);
}

STATIC void
xfs_restore_resvblks(struct xfs_mount *mp)
{
808
	uint64_t resblks;
809 810 811 812 813 814 815 816 817 818

	if (mp->m_resblks_save) {
		resblks = mp->m_resblks_save;
		mp->m_resblks_save = 0;
	} else
		resblks = xfs_default_resblks(mp);

	xfs_reserve_blocks(mp, &resblks, NULL);
}

819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051
/*
 * Trigger writeback of all the dirty metadata in the file system.
 *
 * This ensures that the metadata is written to their location on disk rather
 * than just existing in transactions in the log. This means after a quiesce
 * there is no log replay required to write the inodes to disk - this is the
 * primary difference between a sync and a quiesce.
 *
 * Note: xfs_log_quiesce() stops background log work - the callers must ensure
 * it is started again when appropriate.
 */
void
xfs_quiesce_attr(
	struct xfs_mount	*mp)
{
	int	error = 0;

	/* wait for all modifications to complete */
	while (atomic_read(&mp->m_active_trans) > 0)
		delay(100);

	/* force the log to unpin objects from the now complete transactions */
	xfs_log_force(mp, XFS_LOG_SYNC);

	/* reclaim inodes to do any IO before the freeze completes */
	xfs_reclaim_inodes(mp, 0);
	xfs_reclaim_inodes(mp, SYNC_WAIT);

	/* Push the superblock and write an unmount record */
	error = xfs_log_sbcount(mp);
	if (error)
		xfs_warn(mp, "xfs_attr_quiesce: failed to log sb changes. "
				"Frozen image may not be consistent.");
	/*
	 * Just warn here till VFS can correctly support
	 * read-only remount without racing.
	 */
	WARN_ON(atomic_read(&mp->m_active_trans) != 0);

	xfs_log_quiesce(mp);
}

/*
 * Second stage of a freeze. The data is already frozen so we only
 * need to take care of the metadata. Once that's done sync the superblock
 * to the log to dirty it in case of a crash while frozen. This ensures that we
 * will recover the unlinked inode lists on the next mount.
 */
STATIC int
xfs_fs_freeze(
	struct super_block	*sb)
{
	struct xfs_mount	*mp = XFS_M(sb);

	xfs_stop_block_reaping(mp);
	xfs_save_resvblks(mp);
	xfs_quiesce_attr(mp);
	return xfs_sync_sb(mp, true);
}

STATIC int
xfs_fs_unfreeze(
	struct super_block	*sb)
{
	struct xfs_mount	*mp = XFS_M(sb);

	xfs_restore_resvblks(mp);
	xfs_log_work_queue(mp);
	xfs_start_block_reaping(mp);
	return 0;
}

/*
 * This function fills in xfs_mount_t fields based on mount args.
 * Note: the superblock _has_ now been read in.
 */
STATIC int
xfs_finish_flags(
	struct xfs_mount	*mp)
{
	int			ronly = (mp->m_flags & XFS_MOUNT_RDONLY);

	/* Fail a mount where the logbuf is smaller than the log stripe */
	if (xfs_sb_version_haslogv2(&mp->m_sb)) {
		if (mp->m_logbsize <= 0 &&
		    mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) {
			mp->m_logbsize = mp->m_sb.sb_logsunit;
		} else if (mp->m_logbsize > 0 &&
			   mp->m_logbsize < mp->m_sb.sb_logsunit) {
			xfs_warn(mp,
		"logbuf size must be greater than or equal to log stripe size");
			return -EINVAL;
		}
	} else {
		/* Fail a mount if the logbuf is larger than 32K */
		if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) {
			xfs_warn(mp,
		"logbuf size for version 1 logs must be 16K or 32K");
			return -EINVAL;
		}
	}

	/*
	 * V5 filesystems always use attr2 format for attributes.
	 */
	if (xfs_sb_version_hascrc(&mp->m_sb) &&
	    (mp->m_flags & XFS_MOUNT_NOATTR2)) {
		xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. "
			     "attr2 is always enabled for V5 filesystems.");
		return -EINVAL;
	}

	/*
	 * mkfs'ed attr2 will turn on attr2 mount unless explicitly
	 * told by noattr2 to turn it off
	 */
	if (xfs_sb_version_hasattr2(&mp->m_sb) &&
	    !(mp->m_flags & XFS_MOUNT_NOATTR2))
		mp->m_flags |= XFS_MOUNT_ATTR2;

	/*
	 * prohibit r/w mounts of read-only filesystems
	 */
	if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) {
		xfs_warn(mp,
			"cannot mount a read-only filesystem as read-write");
		return -EROFS;
	}

	if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) &&
	    (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) &&
	    !xfs_sb_version_has_pquotino(&mp->m_sb)) {
		xfs_warn(mp,
		  "Super block does not support project and group quota together");
		return -EINVAL;
	}

	return 0;
}

static int
xfs_init_percpu_counters(
	struct xfs_mount	*mp)
{
	int		error;

	error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL);
	if (error)
		return -ENOMEM;

	error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL);
	if (error)
		goto free_icount;

	error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL);
	if (error)
		goto free_ifree;

	error = percpu_counter_init(&mp->m_delalloc_blks, 0, GFP_KERNEL);
	if (error)
		goto free_fdblocks;

	return 0;

free_fdblocks:
	percpu_counter_destroy(&mp->m_fdblocks);
free_ifree:
	percpu_counter_destroy(&mp->m_ifree);
free_icount:
	percpu_counter_destroy(&mp->m_icount);
	return -ENOMEM;
}

void
xfs_reinit_percpu_counters(
	struct xfs_mount	*mp)
{
	percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount);
	percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree);
	percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks);
}

static void
xfs_destroy_percpu_counters(
	struct xfs_mount	*mp)
{
	percpu_counter_destroy(&mp->m_icount);
	percpu_counter_destroy(&mp->m_ifree);
	percpu_counter_destroy(&mp->m_fdblocks);
	ASSERT(XFS_FORCED_SHUTDOWN(mp) ||
	       percpu_counter_sum(&mp->m_delalloc_blks) == 0);
	percpu_counter_destroy(&mp->m_delalloc_blks);
}

static void
xfs_fs_put_super(
	struct super_block	*sb)
{
	struct xfs_mount	*mp = XFS_M(sb);

	/* if ->fill_super failed, we have no mount to tear down */
	if (!sb->s_fs_info)
		return;

	xfs_notice(mp, "Unmounting Filesystem");
	xfs_filestream_unmount(mp);
	xfs_unmountfs(mp);

	xfs_freesb(mp);
	free_percpu(mp->m_stats.xs_stats);
	xfs_destroy_percpu_counters(mp);
	xfs_destroy_mount_workqueues(mp);
	xfs_close_devices(mp);

	sb->s_fs_info = NULL;
	xfs_mount_free(mp);
}

static long
xfs_fs_nr_cached_objects(
	struct super_block	*sb,
	struct shrink_control	*sc)
{
	/* Paranoia: catch incorrect calls during mount setup or teardown */
	if (WARN_ON_ONCE(!sb->s_fs_info))
		return 0;
	return xfs_reclaim_inodes_count(XFS_M(sb));
}

static long
xfs_fs_free_cached_objects(
	struct super_block	*sb,
	struct shrink_control	*sc)
1052
{
1053 1054
	return xfs_reclaim_inodes_nr(XFS_M(sb), sc->nr_to_scan);
}
1055

1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
static const struct super_operations xfs_super_operations = {
	.alloc_inode		= xfs_fs_alloc_inode,
	.destroy_inode		= xfs_fs_destroy_inode,
	.dirty_inode		= xfs_fs_dirty_inode,
	.drop_inode		= xfs_fs_drop_inode,
	.put_super		= xfs_fs_put_super,
	.sync_fs		= xfs_fs_sync_fs,
	.freeze_fs		= xfs_fs_freeze,
	.unfreeze_fs		= xfs_fs_unfreeze,
	.statfs			= xfs_fs_statfs,
	.show_options		= xfs_fs_show_options,
	.nr_cached_objects	= xfs_fs_nr_cached_objects,
	.free_cached_objects	= xfs_fs_free_cached_objects,
};
1070

1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
static int
suffix_kstrtoint(
	const char	*s,
	unsigned int	base,
	int		*res)
{
	int		last, shift_left_factor = 0, _res;
	char		*value;
	int		ret = 0;

	value = kstrdup(s, GFP_KERNEL);
	if (!value)
		return -ENOMEM;

	last = strlen(value) - 1;
	if (value[last] == 'K' || value[last] == 'k') {
		shift_left_factor = 10;
		value[last] = '\0';
	}
	if (value[last] == 'M' || value[last] == 'm') {
		shift_left_factor = 20;
		value[last] = '\0';
	}
	if (value[last] == 'G' || value[last] == 'g') {
		shift_left_factor = 30;
		value[last] = '\0';
	}

	if (kstrtoint(value, base, &_res))
		ret = -EINVAL;
	kfree(value);
	*res = _res << shift_left_factor;
	return ret;
1104 1105
}

Christoph Hellwig's avatar
Christoph Hellwig committed
1106
/*
1107 1108 1109
 * Set mount state from a mount option.
 *
 * NOTE: mp->m_super is NULL here!
Christoph Hellwig's avatar
Christoph Hellwig committed
1110
 */
1111 1112 1113 1114
static int
xfs_fc_parse_param(
	struct fs_context	*fc,
	struct fs_parameter	*param)
Linus Torvalds's avatar
Linus Torvalds committed
1115
{
1116 1117 1118 1119
	struct xfs_mount	*mp = fc->s_fs_info;
	struct fs_parse_result	result;
	int			size = 0;
	int			opt;
Christoph Hellwig's avatar
Christoph Hellwig committed
1120

1121
	opt = fs_parse(fc, xfs_fs_parameters, param, &result);
1122 1123
	if (opt < 0)
		return opt;
Linus Torvalds's avatar
Linus Torvalds committed
1124

1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 </