File: fe.c

package info (click to toggle)
reiserfsprogs 1%3A3.6.27-3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 3,148 kB
  • sloc: ansic: 27,337; sh: 4,143; makefile: 87
file content (26 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (5)
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
/*
 * Copyright 2000-2004 by Hans Reiser, licensing governed by
 * reiserfsprogs/README
 */

#include "resize.h"

/* the front-end for kernel on-line resizer */
int resize_fs_online(char *devname, long long int blocks)
{
	struct mntent *mnt;
	char buf[40];

	/* Find the mount entry. */
	if ((mnt = misc_mntent(devname)) == NULL)
		die("resize_reiserfs: can't find mount entry\n");

	sprintf(buf, "resize=%lld", blocks);

	if (mount(mnt->mnt_fsname, mnt->mnt_dir, mnt->mnt_type,
		  (unsigned long)(MS_MGC_VAL << 16 | MS_REMOUNT), buf)) {
		die("resize_reiserfs: remount failed: %s\n", strerror(errno));
	}

	return 0;
}