blob: 9d5f6446a9b3953590597b9fcae8779866442783 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// SPDX-License-Identifier: GPL-2.0-only
/* * This file is part of UBIFS.
*
* Copyright (C) 2006-2008 Nokia Corporation.
* Copyright (C) 2006, 2007 University of Szeged, Hungary
*
* Authors: Artem Bityutskiy (Битюцкий Артём)
* Adrian Hunter
* Zoltan Sogor
*/
/*
* This file implements directory operations.
*
* All FS operations in this file allocate budget before writing anything to the
* media. If they fail to allocate it, the error is returned. The only
* exceptions are 'ubifs_unlink()' and 'ubifs_rmdir()' which keep working even
* if they unable to allocate the budget, because deletion %-ENOSPC failure is
* not what users are usually ready to get. UBIFS budgeting subsystem has some
* space reserved for these purposes.
*
* All operations in this file write all inodes which they change straight
* away, instead of marking them dirty. For example, 'ubifs_link()' changes
* @i_size of the parent inode and writes the parent inode together with the
* target inode. This was done to simplify file-system recovery which would
* otherwise be very difficult to do. The only exception is rename which marks
* the re-named inode dirty (because its @i_ctime is updated) but does not
* write it, but just marks it as dirty.
*/
#include "ubifs.h"
|