2121 * nilfs_palloc_groups_per_desc_block - get the number of groups that a group
2222 * descriptor block can maintain
2323 * @inode: inode of metadata file using this allocator
24+ *
25+ * Return: Number of groups that a group descriptor block can maintain.
2426 */
2527static inline unsigned long
2628nilfs_palloc_groups_per_desc_block (const struct inode * inode )
@@ -32,6 +34,8 @@ nilfs_palloc_groups_per_desc_block(const struct inode *inode)
3234/**
3335 * nilfs_palloc_groups_count - get maximum number of groups
3436 * @inode: inode of metadata file using this allocator
37+ *
38+ * Return: Maximum number of groups.
3539 */
3640static inline unsigned long
3741nilfs_palloc_groups_count (const struct inode * inode )
@@ -43,6 +47,8 @@ nilfs_palloc_groups_count(const struct inode *inode)
4347 * nilfs_palloc_init_blockgroup - initialize private variables for allocator
4448 * @inode: inode of metadata file using this allocator
4549 * @entry_size: size of the persistent object
50+ *
51+ * Return: 0 on success, or a negative error code on failure.
4652 */
4753int nilfs_palloc_init_blockgroup (struct inode * inode , unsigned int entry_size )
4854{
@@ -78,6 +84,9 @@ int nilfs_palloc_init_blockgroup(struct inode *inode, unsigned int entry_size)
7884 * @inode: inode of metadata file using this allocator
7985 * @nr: serial number of the entry (e.g. inode number)
8086 * @offset: pointer to store offset number in the group
87+ *
88+ * Return: Number of the group that contains the entry with the index
89+ * specified by @nr.
8190 */
8291static unsigned long nilfs_palloc_group (const struct inode * inode , __u64 nr ,
8392 unsigned long * offset )
@@ -93,8 +102,8 @@ static unsigned long nilfs_palloc_group(const struct inode *inode, __u64 nr,
93102 * @inode: inode of metadata file using this allocator
94103 * @group: group number
95104 *
96- * nilfs_palloc_desc_blkoff() returns block offset of the descriptor
97- * block which contains a descriptor of the specified group.
105+ * Return: Index number in the metadata file of the descriptor block of
106+ * the group specified by @ group.
98107 */
99108static unsigned long
100109nilfs_palloc_desc_blkoff (const struct inode * inode , unsigned long group )
@@ -111,6 +120,9 @@ nilfs_palloc_desc_blkoff(const struct inode *inode, unsigned long group)
111120 *
112121 * nilfs_palloc_bitmap_blkoff() returns block offset of the bitmap
113122 * block used to allocate/deallocate entries in the specified group.
123+ *
124+ * Return: Index number in the metadata file of the bitmap block of
125+ * the group specified by @group.
114126 */
115127static unsigned long
116128nilfs_palloc_bitmap_blkoff (const struct inode * inode , unsigned long group )
@@ -125,6 +137,8 @@ nilfs_palloc_bitmap_blkoff(const struct inode *inode, unsigned long group)
125137 * nilfs_palloc_group_desc_nfrees - get the number of free entries in a group
126138 * @desc: pointer to descriptor structure for the group
127139 * @lock: spin lock protecting @desc
140+ *
141+ * Return: Number of free entries written in the group descriptor @desc.
128142 */
129143static unsigned long
130144nilfs_palloc_group_desc_nfrees (const struct nilfs_palloc_group_desc * desc ,
@@ -143,6 +157,9 @@ nilfs_palloc_group_desc_nfrees(const struct nilfs_palloc_group_desc *desc,
143157 * @desc: pointer to descriptor structure for the group
144158 * @lock: spin lock protecting @desc
145159 * @n: delta to be added
160+ *
161+ * Return: Number of free entries after adjusting the group descriptor
162+ * @desc.
146163 */
147164static u32
148165nilfs_palloc_group_desc_add_entries (struct nilfs_palloc_group_desc * desc ,
@@ -161,6 +178,9 @@ nilfs_palloc_group_desc_add_entries(struct nilfs_palloc_group_desc *desc,
161178 * nilfs_palloc_entry_blkoff - get block offset of an entry block
162179 * @inode: inode of metadata file using this allocator
163180 * @nr: serial number of the entry (e.g. inode number)
181+ *
182+ * Return: Index number in the metadata file of the block containing
183+ * the entry specified by @nr.
164184 */
165185static unsigned long
166186nilfs_palloc_entry_blkoff (const struct inode * inode , __u64 nr )
@@ -238,6 +258,12 @@ static int nilfs_palloc_get_block(struct inode *inode, unsigned long blkoff,
238258 * @blkoff: block offset
239259 * @prev: nilfs_bh_assoc struct of the last used buffer
240260 * @lock: spin lock protecting @prev
261+ *
262+ * Return: 0 on success, or one of the following negative error codes on
263+ * failure:
264+ * * %-EIO - I/O error (including metadata corruption).
265+ * * %-ENOENT - Non-existent block.
266+ * * %-ENOMEM - Insufficient memory available.
241267 */
242268static int nilfs_palloc_delete_block (struct inode * inode , unsigned long blkoff ,
243269 struct nilfs_bh_assoc * prev ,
@@ -258,6 +284,8 @@ static int nilfs_palloc_delete_block(struct inode *inode, unsigned long blkoff,
258284 * @group: group number
259285 * @create: create flag
260286 * @bhp: pointer to store the resultant buffer head
287+ *
288+ * Return: 0 on success, or a negative error code on failure.
261289 */
262290static int nilfs_palloc_get_desc_block (struct inode * inode ,
263291 unsigned long group ,
@@ -277,6 +305,8 @@ static int nilfs_palloc_get_desc_block(struct inode *inode,
277305 * @group: group number
278306 * @create: create flag
279307 * @bhp: pointer to store the resultant buffer head
308+ *
309+ * Return: 0 on success, or a negative error code on failure.
280310 */
281311static int nilfs_palloc_get_bitmap_block (struct inode * inode ,
282312 unsigned long group ,
@@ -294,6 +324,8 @@ static int nilfs_palloc_get_bitmap_block(struct inode *inode,
294324 * nilfs_palloc_delete_bitmap_block - delete a bitmap block
295325 * @inode: inode of metadata file using this allocator
296326 * @group: group number
327+ *
328+ * Return: 0 on success, or a negative error code on failure.
297329 */
298330static int nilfs_palloc_delete_bitmap_block (struct inode * inode ,
299331 unsigned long group )
@@ -312,6 +344,8 @@ static int nilfs_palloc_delete_bitmap_block(struct inode *inode,
312344 * @nr: serial number of the entry (e.g. inode number)
313345 * @create: create flag
314346 * @bhp: pointer to store the resultant buffer head
347+ *
348+ * Return: 0 on success, or a negative error code on failure.
315349 */
316350int nilfs_palloc_get_entry_block (struct inode * inode , __u64 nr ,
317351 int create , struct buffer_head * * bhp )
@@ -328,6 +362,8 @@ int nilfs_palloc_get_entry_block(struct inode *inode, __u64 nr,
328362 * nilfs_palloc_delete_entry_block - delete an entry block
329363 * @inode: inode of metadata file using this allocator
330364 * @nr: serial number of the entry
365+ *
366+ * Return: 0 on success, or a negative error code on failure.
331367 */
332368static int nilfs_palloc_delete_entry_block (struct inode * inode , __u64 nr )
333369{
@@ -397,6 +433,9 @@ size_t nilfs_palloc_entry_offset(const struct inode *inode, __u64 nr,
397433 * @bsize: size in bits
398434 * @lock: spin lock protecting @bitmap
399435 * @wrap: whether to wrap around
436+ *
437+ * Return: Offset number within the group of the found free entry, or
438+ * %-ENOSPC if not found.
400439 */
401440static int nilfs_palloc_find_available_slot (unsigned char * bitmap ,
402441 unsigned long target ,
@@ -438,6 +477,9 @@ static int nilfs_palloc_find_available_slot(unsigned char *bitmap,
438477 * @inode: inode of metadata file using this allocator
439478 * @curr: current group number
440479 * @max: maximum number of groups
480+ *
481+ * Return: Number of remaining descriptors (= groups) managed by the descriptor
482+ * block.
441483 */
442484static unsigned long
443485nilfs_palloc_rest_groups_in_desc_block (const struct inode * inode ,
@@ -453,6 +495,8 @@ nilfs_palloc_rest_groups_in_desc_block(const struct inode *inode,
453495 * nilfs_palloc_count_desc_blocks - count descriptor blocks number
454496 * @inode: inode of metadata file using this allocator
455497 * @desc_blocks: descriptor blocks number [out]
498+ *
499+ * Return: 0 on success, or a negative error code on failure.
456500 */
457501static int nilfs_palloc_count_desc_blocks (struct inode * inode ,
458502 unsigned long * desc_blocks )
@@ -473,6 +517,8 @@ static int nilfs_palloc_count_desc_blocks(struct inode *inode,
473517 * MDT file growing
474518 * @inode: inode of metadata file using this allocator
475519 * @desc_blocks: known current descriptor blocks count
520+ *
521+ * Return: true if a group can be added in the metadata file, false if not.
476522 */
477523static inline bool nilfs_palloc_mdt_file_can_grow (struct inode * inode ,
478524 unsigned long desc_blocks )
@@ -487,6 +533,12 @@ static inline bool nilfs_palloc_mdt_file_can_grow(struct inode *inode,
487533 * @inode: inode of metadata file using this allocator
488534 * @nused: current number of used entries
489535 * @nmaxp: max number of entries [out]
536+ *
537+ * Return: 0 on success, or one of the following negative error codes on
538+ * failure:
539+ * * %-EIO - I/O error (including metadata corruption).
540+ * * %-ENOMEM - Insufficient memory available.
541+ * * %-ERANGE - Number of entries in use is out of range.
490542 */
491543int nilfs_palloc_count_max_entries (struct inode * inode , u64 nused , u64 * nmaxp )
492544{
@@ -518,6 +570,13 @@ int nilfs_palloc_count_max_entries(struct inode *inode, u64 nused, u64 *nmaxp)
518570 * @inode: inode of metadata file using this allocator
519571 * @req: nilfs_palloc_req structure exchanged for the allocation
520572 * @wrap: whether to wrap around
573+ *
574+ * Return: 0 on success, or one of the following negative error codes on
575+ * failure:
576+ * * %-EIO - I/O error (including metadata corruption).
577+ * * %-ENOMEM - Insufficient memory available.
578+ * * %-ENOSPC - Entries exhausted (No entries available for allocation).
579+ * * %-EROFS - Read only filesystem
521580 */
522581int nilfs_palloc_prepare_alloc_entry (struct inode * inode ,
523582 struct nilfs_palloc_req * req , bool wrap )
@@ -710,6 +769,8 @@ void nilfs_palloc_abort_alloc_entry(struct inode *inode,
710769 * nilfs_palloc_prepare_free_entry - prepare to deallocate a persistent object
711770 * @inode: inode of metadata file using this allocator
712771 * @req: nilfs_palloc_req structure exchanged for the removal
772+ *
773+ * Return: 0 on success, or a negative error code on failure.
713774 */
714775int nilfs_palloc_prepare_free_entry (struct inode * inode ,
715776 struct nilfs_palloc_req * req )
@@ -754,6 +815,8 @@ void nilfs_palloc_abort_free_entry(struct inode *inode,
754815 * @inode: inode of metadata file using this allocator
755816 * @entry_nrs: array of entry numbers to be deallocated
756817 * @nitems: number of entries stored in @entry_nrs
818+ *
819+ * Return: 0 on success, or a negative error code on failure.
757820 */
758821int nilfs_palloc_freev (struct inode * inode , __u64 * entry_nrs , size_t nitems )
759822{
0 commit comments