Skip to content

Commit fc26901

Browse files
committed
Merge tag 'befs-v4.10-rc1' of git://github.com/luisbg/linux-befs
Pull befs updates from Luis de Bethencourt: "A series of small fixes and adding NFS export support" * tag 'befs-v4.10-rc1' of git://github.com/luisbg/linux-befs: befs: add NFS export support befs: remove trailing whitespaces befs: remove signatures from comments befs: fix style issues in header files befs: fix style issues in linuxvfs.c befs: fix typos in linuxvfs.c befs: fix style issues in io.c befs: fix style issues in inode.c befs: fix style issues in debug.c
2 parents 01302aa + ac632f5 commit fc26901

File tree

13 files changed

+145
-116
lines changed

13 files changed

+145
-116
lines changed

fs/befs/befs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static inline befs_inode_addr
129129
blockno2iaddr(struct super_block *sb, befs_blocknr_t blockno)
130130
{
131131
befs_inode_addr iaddr;
132+
132133
iaddr.allocation_group = blockno >> BEFS_SB(sb)->ag_shift;
133134
iaddr.start =
134135
blockno - (iaddr.allocation_group << BEFS_SB(sb)->ag_shift);
@@ -140,7 +141,7 @@ blockno2iaddr(struct super_block *sb, befs_blocknr_t blockno)
140141
static inline unsigned int
141142
befs_iaddrs_per_block(struct super_block *sb)
142143
{
143-
return BEFS_SB(sb)->block_size / sizeof (befs_disk_inode_addr);
144+
return BEFS_SB(sb)->block_size / sizeof(befs_disk_inode_addr);
144145
}
145146

146147
#include "endian.h"

fs/befs/befs_fs_types.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ enum super_flags {
5555
};
5656

5757
#define BEFS_BYTEORDER_NATIVE 0x42494745
58-
#define BEFS_BYTEORDER_NATIVE_LE (__force fs32)cpu_to_le32(BEFS_BYTEORDER_NATIVE)
59-
#define BEFS_BYTEORDER_NATIVE_BE (__force fs32)cpu_to_be32(BEFS_BYTEORDER_NATIVE)
58+
#define BEFS_BYTEORDER_NATIVE_LE ((__force fs32)cpu_to_le32(BEFS_BYTEORDER_NATIVE))
59+
#define BEFS_BYTEORDER_NATIVE_BE ((__force fs32)cpu_to_be32(BEFS_BYTEORDER_NATIVE))
6060

6161
#define BEFS_SUPER_MAGIC BEFS_SUPER_MAGIC1
62-
#define BEFS_SUPER_MAGIC1_LE (__force fs32)cpu_to_le32(BEFS_SUPER_MAGIC1)
63-
#define BEFS_SUPER_MAGIC1_BE (__force fs32)cpu_to_be32(BEFS_SUPER_MAGIC1)
62+
#define BEFS_SUPER_MAGIC1_LE ((__force fs32)cpu_to_le32(BEFS_SUPER_MAGIC1))
63+
#define BEFS_SUPER_MAGIC1_BE ((__force fs32)cpu_to_be32(BEFS_SUPER_MAGIC1))
6464

6565
/*
6666
* Flags of inode
@@ -79,7 +79,7 @@ enum inode_flags {
7979
BEFS_INODE_WAS_WRITTEN = 0x00020000,
8080
BEFS_NO_TRANSACTION = 0x00040000,
8181
};
82-
/*
82+
/*
8383
* On-Disk datastructures of BeFS
8484
*/
8585

@@ -139,7 +139,7 @@ typedef struct {
139139

140140
} PACKED befs_super_block;
141141

142-
/*
142+
/*
143143
* Note: the indirect and dbl_indir block_runs may
144144
* be longer than one block!
145145
*/

fs/befs/btree.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
*
1313
* Dominic Giampaolo, author of "Practical File System
1414
* Design with the Be File System", for such a helpful book.
15-
*
16-
* Marcus J. Ranum, author of the b+tree package in
15+
*
16+
* Marcus J. Ranum, author of the b+tree package in
1717
* comp.sources.misc volume 10. This code is not copied from that
1818
* work, but it is partially based on it.
1919
*
@@ -38,38 +38,38 @@
3838
*/
3939

4040
/* Befs B+tree structure:
41-
*
41+
*
4242
* The first thing in the tree is the tree superblock. It tells you
4343
* all kinds of useful things about the tree, like where the rootnode
4444
* is located, and the size of the nodes (always 1024 with current version
4545
* of BeOS).
4646
*
4747
* The rest of the tree consists of a series of nodes. Nodes contain a header
48-
* (struct befs_btree_nodehead), the packed key data, an array of shorts
48+
* (struct befs_btree_nodehead), the packed key data, an array of shorts
4949
* containing the ending offsets for each of the keys, and an array of
50-
* befs_off_t values. In interior nodes, the keys are the ending keys for
51-
* the childnode they point to, and the values are offsets into the
52-
* datastream containing the tree.
50+
* befs_off_t values. In interior nodes, the keys are the ending keys for
51+
* the childnode they point to, and the values are offsets into the
52+
* datastream containing the tree.
5353
*/
5454

5555
/* Note:
56-
*
57-
* The book states 2 confusing things about befs b+trees. First,
56+
*
57+
* The book states 2 confusing things about befs b+trees. First,
5858
* it states that the overflow field of node headers is used by internal nodes
5959
* to point to another node that "effectively continues this one". Here is what
6060
* I believe that means. Each key in internal nodes points to another node that
61-
* contains key values less than itself. Inspection reveals that the last key
62-
* in the internal node is not the last key in the index. Keys that are
63-
* greater than the last key in the internal node go into the overflow node.
61+
* contains key values less than itself. Inspection reveals that the last key
62+
* in the internal node is not the last key in the index. Keys that are
63+
* greater than the last key in the internal node go into the overflow node.
6464
* I imagine there is a performance reason for this.
6565
*
66-
* Second, it states that the header of a btree node is sufficient to
67-
* distinguish internal nodes from leaf nodes. Without saying exactly how.
66+
* Second, it states that the header of a btree node is sufficient to
67+
* distinguish internal nodes from leaf nodes. Without saying exactly how.
6868
* After figuring out the first, it becomes obvious that internal nodes have
6969
* overflow nodes and leafnodes do not.
7070
*/
7171

72-
/*
72+
/*
7373
* Currently, this code is only good for directory B+trees.
7474
* In order to be used for other BFS indexes, it needs to be extended to handle
7575
* duplicate keys and non-string keytypes (int32, int64, float, double).
@@ -237,8 +237,8 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds,
237237
* with @key (usually the disk block number of an inode).
238238
*
239239
* On failure, returns BEFS_ERR or BEFS_BT_NOT_FOUND.
240-
*
241-
* Algorithm:
240+
*
241+
* Algorithm:
242242
* Read the superblock and rootnode of the b+tree.
243243
* Drill down through the interior nodes using befs_find_key().
244244
* Once at the correct leaf node, use befs_find_key() again to get the
@@ -402,12 +402,12 @@ befs_find_key(struct super_block *sb, struct befs_btree_node *node,
402402
*
403403
* Here's how it works: Key_no is the index of the key/value pair to
404404
* return in keybuf/value.
405-
* Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is
405+
* Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is
406406
* the number of characters in the key (just a convenience).
407407
*
408408
* Algorithm:
409409
* Get the first leafnode of the tree. See if the requested key is in that
410-
* node. If not, follow the node->right link to the next leafnode. Repeat
410+
* node. If not, follow the node->right link to the next leafnode. Repeat
411411
* until the (key_no)th key is found or the tree is out of keys.
412412
*/
413413
int
@@ -536,7 +536,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
536536
* @node_off: Pointer to offset of current node within datastream. Modified
537537
* by the function.
538538
*
539-
* Helper function for btree traverse. Moves the current position to the
539+
* Helper function for btree traverse. Moves the current position to the
540540
* start of the first leaf node.
541541
*
542542
* Also checks for an empty tree. If there are no keys, returns BEFS_BT_EMPTY.
@@ -592,10 +592,10 @@ befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds,
592592
}
593593

594594
/**
595-
* befs_leafnode - Determine if the btree node is a leaf node or an
595+
* befs_leafnode - Determine if the btree node is a leaf node or an
596596
* interior node
597597
* @node: Pointer to node structure to test
598-
*
598+
*
599599
* Return 1 if leaf, 0 if interior
600600
*/
601601
static int
@@ -656,7 +656,7 @@ befs_bt_valarray(struct befs_btree_node *node)
656656
* @node: Pointer to the node structure to find the keydata array within
657657
*
658658
* Returns a pointer to the start of the keydata array
659-
* of the node pointed to by the node header
659+
* of the node pointed to by the node header
660660
*/
661661
static char *
662662
befs_bt_keydata(struct befs_btree_node *node)
@@ -702,7 +702,7 @@ befs_bt_get_key(struct super_block *sb, struct befs_btree_node *node,
702702

703703
/**
704704
* befs_compare_strings - compare two strings
705-
* @key1: pointer to the first key to be compared
705+
* @key1: pointer to the first key to be compared
706706
* @keylen1: length in bytes of key1
707707
* @key2: pointer to the second key to be compared
708708
* @keylen2: length in bytes of key2

fs/befs/btree.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/*
22
* btree.h
3-
*
3+
*
44
*/
55

6-
76
int befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
8-
const char *key, befs_off_t * value);
7+
const char *key, befs_off_t *value);
98

109
int befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
1110
loff_t key_no, size_t bufsize, char *keybuf,
12-
size_t * keysize, befs_off_t * value);
13-
11+
size_t *keysize, befs_off_t *value);

fs/befs/datastream.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,11 @@ befs_read_datastream(struct super_block *sb, const befs_data_stream *ds,
8484
*
8585
* Takes a file position and gives back a brun who's starting block
8686
* is block number fblock of the file.
87-
*
87+
*
8888
* Returns BEFS_OK or BEFS_ERR.
89-
*
89+
*
9090
* Calls specialized functions for each of the three possible
9191
* datastream regions.
92-
*
93-
* 2001-11-15 Will Dyson
9492
*/
9593
int
9694
befs_fblock2brun(struct super_block *sb, const befs_data_stream *data,
@@ -120,7 +118,7 @@ befs_fblock2brun(struct super_block *sb, const befs_data_stream *data,
120118

121119
/**
122120
* befs_read_lsmylink - read long symlink from datastream.
123-
* @sb: Filesystem superblock
121+
* @sb: Filesystem superblock
124122
* @ds: Datastream to read from
125123
* @buff: Buffer in which to place long symlink data
126124
* @len: Length of the long symlink in bytes

fs/befs/datastream.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
struct buffer_head *befs_read_datastream(struct super_block *sb,
77
const befs_data_stream *ds,
8-
befs_off_t pos, uint * off);
8+
befs_off_t pos, uint *off);
99

1010
int befs_fblock2brun(struct super_block *sb, const befs_data_stream *data,
11-
befs_blocknr_t fblock, befs_block_run * run);
11+
befs_blocknr_t fblock, befs_block_run *run);
1212

1313
size_t befs_read_lsymlink(struct super_block *sb, const befs_data_stream *data,
1414
void *buff, befs_off_t len);
@@ -17,4 +17,3 @@ befs_blocknr_t befs_count_blocks(struct super_block *sb,
1717
const befs_data_stream *ds);
1818

1919
extern const befs_inode_addr BAD_IADDR;
20-

fs/befs/debug.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* linux/fs/befs/debug.c
3-
*
3+
*
44
* Copyright (C) 2001 Will Dyson (will_dyson at pobox.com)
55
*
66
* With help from the ntfs-tng driver by Anton Altparmakov
@@ -57,6 +57,7 @@ befs_debug(const struct super_block *sb, const char *fmt, ...)
5757

5858
struct va_format vaf;
5959
va_list args;
60+
6061
va_start(args, fmt);
6162
vaf.fmt = fmt;
6263
vaf.va = &args;
@@ -67,7 +68,7 @@ befs_debug(const struct super_block *sb, const char *fmt, ...)
6768
}
6869

6970
void
70-
befs_dump_inode(const struct super_block *sb, befs_inode * inode)
71+
befs_dump_inode(const struct super_block *sb, befs_inode *inode)
7172
{
7273
#ifdef CONFIG_BEFS_DEBUG
7374

@@ -151,7 +152,7 @@ befs_dump_inode(const struct super_block *sb, befs_inode * inode)
151152
*/
152153

153154
void
154-
befs_dump_super_block(const struct super_block *sb, befs_super_block * sup)
155+
befs_dump_super_block(const struct super_block *sb, befs_super_block *sup)
155156
{
156157
#ifdef CONFIG_BEFS_DEBUG
157158

@@ -202,7 +203,7 @@ befs_dump_super_block(const struct super_block *sb, befs_super_block * sup)
202203
#if 0
203204
/* unused */
204205
void
205-
befs_dump_small_data(const struct super_block *sb, befs_small_data * sd)
206+
befs_dump_small_data(const struct super_block *sb, befs_small_data *sd)
206207
{
207208
}
208209

@@ -221,7 +222,8 @@ befs_dump_run(const struct super_block *sb, befs_disk_block_run run)
221222
#endif /* 0 */
222223

223224
void
224-
befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super * super)
225+
befs_dump_index_entry(const struct super_block *sb,
226+
befs_disk_btree_super *super)
225227
{
226228
#ifdef CONFIG_BEFS_DEBUG
227229

@@ -242,7 +244,7 @@ befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super * supe
242244
}
243245

244246
void
245-
befs_dump_index_node(const struct super_block *sb, befs_btree_nodehead * node)
247+
befs_dump_index_node(const struct super_block *sb, befs_btree_nodehead *node)
246248
{
247249
#ifdef CONFIG_BEFS_DEBUG
248250

fs/befs/inode.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* inode.c
3-
*
3+
*
44
* Copyright (C) 2001 Will Dyson <will_dyson@pobox.com>
55
*/
66

@@ -10,12 +10,12 @@
1010
#include "inode.h"
1111

1212
/*
13-
Validates the correctness of the befs inode
14-
Returns BEFS_OK if the inode should be used, otherwise
15-
returns BEFS_BAD_INODE
16-
*/
13+
* Validates the correctness of the befs inode
14+
* Returns BEFS_OK if the inode should be used, otherwise
15+
* returns BEFS_BAD_INODE
16+
*/
1717
int
18-
befs_check_inode(struct super_block *sb, befs_inode * raw_inode,
18+
befs_check_inode(struct super_block *sb, befs_inode *raw_inode,
1919
befs_blocknr_t inode)
2020
{
2121
u32 magic1 = fs32_to_cpu(sb, raw_inode->magic1);

fs/befs/inode.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/*
22
* inode.h
3-
*
3+
*
44
*/
55

6-
int befs_check_inode(struct super_block *sb, befs_inode * raw_inode,
6+
int befs_check_inode(struct super_block *sb, befs_inode *raw_inode,
77
befs_blocknr_t inode);
8-

fs/befs/io.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (C) 2001 Will Dyson <will_dyson@pobox.com
55
*
6-
* Based on portions of file.c and inode.c
6+
* Based on portions of file.c and inode.c
77
* by Makoto Kato (m_kato@ga2.so-net.ne.jp)
88
*
99
* Many thanks to Dominic Giampaolo, author of Practical File System
@@ -19,8 +19,7 @@
1919
/*
2020
* Converts befs notion of disk addr to a disk offset and uses
2121
* linux kernel function sb_bread() to get the buffer containing
22-
* the offset. -Will Dyson
23-
*
22+
* the offset.
2423
*/
2524

2625
struct buffer_head *
@@ -55,7 +54,7 @@ befs_bread_iaddr(struct super_block *sb, befs_inode_addr iaddr)
5554
befs_debug(sb, "<--- %s", __func__);
5655
return bh;
5756

58-
error:
57+
error:
5958
befs_debug(sb, "<--- %s ERROR", __func__);
6059
return NULL;
6160
}

fs/befs/io.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44

55
struct buffer_head *befs_bread_iaddr(struct super_block *sb,
66
befs_inode_addr iaddr);
7-

0 commit comments

Comments
 (0)