super.c (1a9a8a71ed1d457d4f03284ebfd3e40fe1e217ac) super.c (c0d19e2b9a521bbdc33049ad92c94b517afda1f0)
1/*
2 * Copyright (C) 2007 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 121 unchanged lines hidden (view full) ---

130 }
131}
132
133#ifdef CONFIG_PRINTK
134/*
135 * __btrfs_std_error decodes expected errors from the caller and
136 * invokes the approciate error response.
137 */
1/*
2 * Copyright (C) 2007 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 121 unchanged lines hidden (view full) ---

130 }
131}
132
133#ifdef CONFIG_PRINTK
134/*
135 * __btrfs_std_error decodes expected errors from the caller and
136 * invokes the approciate error response.
137 */
138__cold
138void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
139 unsigned int line, int errno, const char *fmt, ...)
140{
141 struct super_block *sb = fs_info->sb;
142 const char *errstr;
143
144 /*
145 * Special case: if the error is EROFS, and we're already

--- 96 unchanged lines hidden (view full) ---

242 * This means that error recovery at the call site is limited to freeing
243 * any local memory allocations and passing the error code up without
244 * further cleanup. The transaction should complete as it normally would
245 * in the call path but will return -EIO.
246 *
247 * We'll complete the cleanup in btrfs_end_transaction and
248 * btrfs_commit_transaction.
249 */
139void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
140 unsigned int line, int errno, const char *fmt, ...)
141{
142 struct super_block *sb = fs_info->sb;
143 const char *errstr;
144
145 /*
146 * Special case: if the error is EROFS, and we're already

--- 96 unchanged lines hidden (view full) ---

243 * This means that error recovery at the call site is limited to freeing
244 * any local memory allocations and passing the error code up without
245 * further cleanup. The transaction should complete as it normally would
246 * in the call path but will return -EIO.
247 *
248 * We'll complete the cleanup in btrfs_end_transaction and
249 * btrfs_commit_transaction.
250 */
251__cold
250void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
251 struct btrfs_root *root, const char *function,
252 unsigned int line, int errno)
253{
254 trans->aborted = errno;
255 /* Nothing used. The other threads that have joined this
256 * transaction may be able to continue. */
257 if (!trans->blocks_used && list_empty(&trans->new_bgs)) {

--- 10 unchanged lines hidden (view full) ---

268 wake_up(&root->fs_info->transaction_wait);
269 wake_up(&root->fs_info->transaction_blocked_wait);
270 __btrfs_std_error(root->fs_info, function, line, errno, NULL);
271}
272/*
273 * __btrfs_panic decodes unexpected, fatal errors from the caller,
274 * issues an alert, and either panics or BUGs, depending on mount options.
275 */
252void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
253 struct btrfs_root *root, const char *function,
254 unsigned int line, int errno)
255{
256 trans->aborted = errno;
257 /* Nothing used. The other threads that have joined this
258 * transaction may be able to continue. */
259 if (!trans->blocks_used && list_empty(&trans->new_bgs)) {

--- 10 unchanged lines hidden (view full) ---

270 wake_up(&root->fs_info->transaction_wait);
271 wake_up(&root->fs_info->transaction_blocked_wait);
272 __btrfs_std_error(root->fs_info, function, line, errno, NULL);
273}
274/*
275 * __btrfs_panic decodes unexpected, fatal errors from the caller,
276 * issues an alert, and either panics or BUGs, depending on mount options.
277 */
278__cold
276void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function,
277 unsigned int line, int errno, const char *fmt, ...)
278{
279 char *s_id = "<unknown>";
280 const char *errstr;
281 struct va_format vaf = { .fmt = fmt };
282 va_list args;
283

--- 1929 unchanged lines hidden ---
279void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function,
280 unsigned int line, int errno, const char *fmt, ...)
281{
282 char *s_id = "<unknown>";
283 const char *errstr;
284 struct va_format vaf = { .fmt = fmt };
285 va_list args;
286

--- 1929 unchanged lines hidden ---