diff options
-rw-r--r-- | fs/nilfs2/sufile.c | 72 | ||||
-rw-r--r-- | fs/nilfs2/sufile.h | 5 |
2 files changed, 0 insertions, 77 deletions
diff --git a/fs/nilfs2/sufile.c b/fs/nilfs2/sufile.c index 3eed998df1c8..b6c36d0cc331 100644 --- a/fs/nilfs2/sufile.c +++ b/fs/nilfs2/sufile.c | |||
@@ -430,78 +430,6 @@ void nilfs_sufile_do_free(struct inode *sufile, __u64 segnum, | |||
430 | } | 430 | } |
431 | 431 | ||
432 | /** | 432 | /** |
433 | * nilfs_sufile_get_segment_usage - get a segment usage | ||
434 | * @sufile: inode of segment usage file | ||
435 | * @segnum: segment number | ||
436 | * @sup: pointer to segment usage | ||
437 | * @bhp: pointer to buffer head | ||
438 | * | ||
439 | * Description: nilfs_sufile_get_segment_usage() acquires the segment usage | ||
440 | * specified by @segnum. | ||
441 | * | ||
442 | * Return Value: On success, 0 is returned, and the segment usage and the | ||
443 | * buffer head of the buffer on which the segment usage is located are stored | ||
444 | * in the place pointed by @sup and @bhp, respectively. On error, one of the | ||
445 | * following negative error codes is returned. | ||
446 | * | ||
447 | * %-EIO - I/O error. | ||
448 | * | ||
449 | * %-ENOMEM - Insufficient amount of memory available. | ||
450 | * | ||
451 | * %-EINVAL - Invalid segment usage number. | ||
452 | */ | ||
453 | int nilfs_sufile_get_segment_usage(struct inode *sufile, __u64 segnum, | ||
454 | struct nilfs_segment_usage **sup, | ||
455 | struct buffer_head **bhp) | ||
456 | { | ||
457 | struct buffer_head *bh; | ||
458 | struct nilfs_segment_usage *su; | ||
459 | void *kaddr; | ||
460 | int ret; | ||
461 | |||
462 | /* segnum is 0 origin */ | ||
463 | if (segnum >= nilfs_sufile_get_nsegments(sufile)) | ||
464 | return -EINVAL; | ||
465 | down_write(&NILFS_MDT(sufile)->mi_sem); | ||
466 | ret = nilfs_sufile_get_segment_usage_block(sufile, segnum, 1, &bh); | ||
467 | if (ret < 0) | ||
468 | goto out_sem; | ||
469 | kaddr = kmap(bh->b_page); | ||
470 | su = nilfs_sufile_block_get_segment_usage(sufile, segnum, bh, kaddr); | ||
471 | if (nilfs_segment_usage_error(su)) { | ||
472 | kunmap(bh->b_page); | ||
473 | brelse(bh); | ||
474 | ret = -EINVAL; | ||
475 | goto out_sem; | ||
476 | } | ||
477 | |||
478 | if (sup != NULL) | ||
479 | *sup = su; | ||
480 | *bhp = bh; | ||
481 | |||
482 | out_sem: | ||
483 | up_write(&NILFS_MDT(sufile)->mi_sem); | ||
484 | return ret; | ||
485 | } | ||
486 | |||
487 | /** | ||
488 | * nilfs_sufile_put_segment_usage - put a segment usage | ||
489 | * @sufile: inode of segment usage file | ||
490 | * @segnum: segment number | ||
491 | * @bh: buffer head | ||
492 | * | ||
493 | * Description: nilfs_sufile_put_segment_usage() releases the segment usage | ||
494 | * specified by @segnum. @bh must be the buffer head which have been returned | ||
495 | * by a previous call to nilfs_sufile_get_segment_usage() with @segnum. | ||
496 | */ | ||
497 | void nilfs_sufile_put_segment_usage(struct inode *sufile, __u64 segnum, | ||
498 | struct buffer_head *bh) | ||
499 | { | ||
500 | kunmap(bh->b_page); | ||
501 | brelse(bh); | ||
502 | } | ||
503 | |||
504 | /** | ||
505 | * nilfs_sufile_mark_dirty - mark the buffer having a segment usage dirty | 433 | * nilfs_sufile_mark_dirty - mark the buffer having a segment usage dirty |
506 | * @sufile: inode of segment usage file | 434 | * @sufile: inode of segment usage file |
507 | * @segnum: segment number | 435 | * @segnum: segment number |
diff --git a/fs/nilfs2/sufile.h b/fs/nilfs2/sufile.h index e1186bf3b964..15163b8aff7d 100644 --- a/fs/nilfs2/sufile.h +++ b/fs/nilfs2/sufile.h | |||
@@ -37,11 +37,6 @@ static inline unsigned long nilfs_sufile_get_nsegments(struct inode *sufile) | |||
37 | unsigned long nilfs_sufile_get_ncleansegs(struct inode *sufile); | 37 | unsigned long nilfs_sufile_get_ncleansegs(struct inode *sufile); |
38 | 38 | ||
39 | int nilfs_sufile_alloc(struct inode *, __u64 *); | 39 | int nilfs_sufile_alloc(struct inode *, __u64 *); |
40 | int nilfs_sufile_get_segment_usage(struct inode *, __u64, | ||
41 | struct nilfs_segment_usage **, | ||
42 | struct buffer_head **); | ||
43 | void nilfs_sufile_put_segment_usage(struct inode *, __u64, | ||
44 | struct buffer_head *); | ||
45 | int nilfs_sufile_mark_dirty(struct inode *sufile, __u64 segnum); | 40 | int nilfs_sufile_mark_dirty(struct inode *sufile, __u64 segnum); |
46 | int nilfs_sufile_set_segment_usage(struct inode *sufile, __u64 segnum, | 41 | int nilfs_sufile_set_segment_usage(struct inode *sufile, __u64 segnum, |
47 | unsigned long nblocks, time_t modtime); | 42 | unsigned long nblocks, time_t modtime); |