search for: mnt_fsname

Displaying 20 results from an estimated 23 matches for "mnt_fsname".

2008 Jul 03
1
extlinux and install script
...following code in install_loader() if ( (mtab = setmntent("/proc/mounts", "r")) ) { while ( (mnt = getmntent(mtab)) ) { if ( (!strcmp(mnt->mnt_type, "ext2") || !strcmp(mnt->mnt_type, "ext3")) && !stat(mnt->mnt_fsname, &dst) && dst.st_rdev == st.st_dev ) { devname = mnt->mnt_fsname; break; } } } if ( !devname ) { /* Didn't find it in /proc/mounts, try /etc/mtab */ if ( (mtab = setmntent("/etc/mtab", "r")) ) { while ( (...
2008 Sep 05
0
initial mntent.h, mount features, ipconfig fixes
...ain.c @@ -26,7 +26,7 @@ static __noreturn usage(void) exit(1); } -static __noreturn print_mount(void) +static __noreturn print_mount(char *type) { FILE *mfp; struct mntent *mnt; @@ -40,6 +40,8 @@ static __noreturn print_mount(void) while ((mnt = getmntent(mfp)) != NULL) { if (mnt->mnt_fsname && !strncmp(mnt->mnt_fsname, "no", 2)) continue; + if (type && mnt->mnt_type && strcmp(type, mnt->mnt_type)) + continue; printf("%s on %s", mnt->mnt_fsname, mnt->mnt_dir); if (mnt->mnt_type != NULL && mnt->mnt_typ...
2008 Sep 07
1
[git pull v2] initial mntent.h, mount features, ipconfig fixes
...ain.c @@ -26,7 +26,7 @@ static __noreturn usage(void) exit(1); } -static __noreturn print_mount(void) +static __noreturn print_mount(char *type) { FILE *mfp; struct mntent *mnt; @@ -40,6 +40,8 @@ static __noreturn print_mount(void) while ((mnt = getmntent(mfp)) != NULL) { if (mnt->mnt_fsname && !strncmp(mnt->mnt_fsname, "no", 2)) continue; + if (type && mnt->mnt_type && strcmp(type, mnt->mnt_type)) + continue; printf("%s on %s", mnt->mnt_fsname, mnt->mnt_dir); if (mnt->mnt_type != NULL && mnt->mnt_typ...
2012 Mar 08
3
[PATCH 0/3] kinit: Allow mount options
This patch series allows user-specified mount commands to be sent in via kernel command line ("kinit_mount=...") or via an embedded /etc/fstab file. The first patch is a cleanup of a patch sent last November by San Mehat (http://web.archiveorange.com/archive/v/EazJNBMORV2U7E0coh5h); the next two are small improvements or bug fixes.
2009 Nov 14
2
[PATCH] btrfs-progs: Check mount status of multidevice filesystems
...("/proc/mounts", "r")) == NULL) return -errno; - } else { - if (S_ISBLK(st_buf.st_mode)) { - file_rdev = st_buf.st_rdev; - } else { - file_dev = st_buf.st_dev; - file_ino = st_buf.st_ino; - } - } while ((mnt = getmntent (f)) != NULL) { - if (strcmp(file, mnt->mnt_fsname) == 0) - break; + /* Only check btrfs filesystems */ + if(strcmp(mnt->mnt_type, "btrfs") != 0) + continue; - if (stat(mnt->mnt_fsname, &st_buf) == 0) { - if (S_ISBLK(st_buf.st_mode)) { - if (file_rdev && (file_rdev == st_buf.st_rdev)) - break; - } els...
2011 Nov 22
0
[PATCH] kinit: Add ability to mount filesystems via /etc/fstab or cmdline
..._block(fs_name, fs_dir, fs_type, + flags, new_fs_opts)) { + fprintf(stderr, "Skipping failed mount '%s'\n", + fs_name); + } + } + return 0; +} + +int do_fstab_mounts(FILE *fp) +{ + struct mntent *ent = NULL; + + while ((ent = getmntent(fp))) { + if (!mount_block(ent->mnt_fsname, + ent->mnt_dir, + ent->mnt_type, + 0, + ent->mnt_opts)) { + fprintf(stderr, "Skipping failed mount '%s'\n", + ent->mnt_fsname); + } + } + return 0; +} + int do_mounts(int argc, char *argv[]) { const char *root_dev_name = get_arg(argc, argv, &...
2011 Jan 22
32
Bug in mkfs.btrfs?!
Hi, I wanted to create a new btrfs fs for my backups. When trying to mkfs.btrfs for that device, I''m getting "error checking /dev/loop2 mount status" With strace I see where the problem is: lstat("/dev/disk/by-id/ata-INTEL_SSDSA2M160G2GC_CVPO939201JX160AGN-par", 0x7fffa30b3cf0) = -1 ENOENT (No such file or directory) The problem is there is something missing
2015 Oct 22
2
[PATCH] Added btrfs support for vfs_min_size.
...requires custom parsing code. + */ + fp = setmntent ("/proc/mounts", "r"); + if (fp == NULL) { + fprintf (stderr, "setmntent: %s: %m\n", "/proc/mounts"); + exit (EXIT_FAILURE); + } + + while ((m = getmntent (fp)) != NULL) { + if (stat (m->mnt_fsname, &stat2) == 0) { + if (stat1.st_rdev == stat2.st_rdev) { + /* found it */ + path = strdup (m->mnt_dir); + endmntent (fp); + return path; + } + } + } + + endmntent (fp); + reply_with_error ("device not mounted: %s", device); + re...
2019 Jan 18
0
[klibc:master] mount_main: Fix empty string check
...s/mount_main.c index ab3cb71..0d299c4 100644 --- a/usr/utils/mount_main.c +++ b/usr/utils/mount_main.c @@ -43,9 +43,9 @@ static __noreturn print_mount(char *type) if (type && mnt->mnt_type && strcmp(type, mnt->mnt_type)) continue; printf("%s on %s", mnt->mnt_fsname, mnt->mnt_dir); - if (mnt->mnt_type != NULL && mnt->mnt_type != '\0') + if (mnt->mnt_type != NULL && *mnt->mnt_type != '\0') printf(" type %s", mnt->mnt_type); - if (mnt->mnt_opts != NULL && mnt->mnt_opts != '\0...
2008 Jul 23
2
[RFC] klibc add minimal mntent.h
...mntent.h @@ -0,0 +1,18 @@ +#ifndef _MNTENT_H +#define _MNTENT_H 1 + +#define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */ +#define MNTTYPE_SWAP "swap" /* Swap device. */ + +/* Structure describing a mount table entry. */ +struct mntent +{ + char *mnt_fsname; /* Device or server for filesystem. */ + char *mnt_dir; /* Directory mounted on. */ + char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */ + char *mnt_opts; /* Comma-separated options for fs. */ + int mnt_freq; /* Dump frequency (in days). */ + int mnt_passno; /* Pass number for `fsc...
2011 Aug 30
0
[PATCH] include: [mntent.h] Add MNTTYPE_SWAP definition
...sertions(+), 0 deletions(-) diff --git a/usr/include/mntent.h b/usr/include/mntent.h index 210610c..104f35e 100644 --- a/usr/include/mntent.h +++ b/usr/include/mntent.h @@ -1,6 +1,8 @@ #ifndef _MNTENT_H #define _MNTENT_H 1 +#define MNTTYPE_SWAP "swap" + struct mntent { char *mnt_fsname; /* name of mounted file system */ char *mnt_dir; /* file system path prefix */ -- 1.7.5.4
2013 Jul 19
0
[PATCH 001/001] Add UFS1/2 support to Extlinux installer.
...; goto err; > @@ -1063,6 +1083,17 @@ static const char *find_device(const char *mtab_file, dev_t dev) > done = true; > break; > } > + > + break; > + case UFS1: > + case UFS2: > + if (!strcmp(mnt->mnt_type, "ufs") && !stat(mnt->mnt_fsname, &dst) && > + dst.st_rdev == dev) { > + done = true; > + break; Don't need this break statement. -- Matt Fleming, Intel Open Source Technology Center
2013 Jul 12
2
[PATCH 001/001] Add UFS1/2 support to Extlinux installer.
...h, O_RDONLY|O_DIRECTORY); if (pfd < 0) goto err; @@ -1063,6 +1083,17 @@ static const char *find_device(const char *mtab_file, dev_t dev) done = true; break; } + + break; + case UFS1: + case UFS2: + if (!strcmp(mnt->mnt_type, "ufs") && !stat(mnt->mnt_fsname, &dst) && + dst.st_rdev == dev) { + done = true; + break; + } + + break; case NONE: break; } @@ -1187,7 +1218,7 @@ static int validate_device_btrfs(int pfd, int dfd) return -1; return 0; /* It's good! */ -} +} static const char *find_device_btr...
2015 Oct 23
0
Re: [PATCH] Added btrfs support for vfs_min_size.
...t; + fp = setmntent ("/proc/mounts", "r"); > + if (fp == NULL) { > + fprintf (stderr, "setmntent: %s: %m\n", "/proc/mounts"); > + exit (EXIT_FAILURE); > + } > + > + while ((m = getmntent (fp)) != NULL) { > + if (stat (m->mnt_fsname, &stat2) == 0) { > + if (stat1.st_rdev == stat2.st_rdev) { > + /* found it */ > + path = strdup (m->mnt_dir); > + endmntent (fp); > + return path; > + } > + } > + } > + > + endmntent (fp); > + reply_with_er...
2011 Jul 07
5
[PATCH 0/5] checkpatch cleanups
It seems checkpatch errors krept in, this is a first go. Next run will go into usr/kinit directory. No code changes, just codingstyle fixes (verified with size(3)). maximilian attems (5): [klibc] sleep: have argument on next line [klibc] readklink: remove unneeded braces [klibc] mount: whitespace policy [klibc] ls: fix various checkpatch complaints [klibc] tests: checkpatch fixlets
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.
2012 Mar 09
5
[PATCH 0/5] Fixes to resize2fs (RHBZ#755729, RHBZ#801640)
https://bugzilla.redhat.com/show_bug.cgi?id=755729 This bug reports that the error message printed by the resize2fs API calls (which comes directly from the resize2fs command) says: Please run 'e2fsck -f /dev/vda1' first. That command is not possible from guestfish (where it would be 'e2fsck-f' or 'e2fsck ... forceall:true'). Fixing that bug caused this bug:
2018 Jun 18
1
[PATCH v3 1/2] Implement classless static routes
Implement classless static routes support as specified in RFC3442. Bug-Debian: https://bugs.debian.org/884716 Bug-Ubuntu: https://launchpad.net/bugs/1526956 Signed-off-by: Benjamin Drung <benjamin.drung at profitbricks.com> --- usr/kinit/ipconfig/bootp_proto.c | 109 +++++++++++++++++++++++++++++++ usr/kinit/ipconfig/dhcp_proto.c | 1 + usr/kinit/ipconfig/main.c | 54
2013 Jul 22
1
[PATCH 1/1 v2] Add UFS1/2 support to Extlinux installer.
...h, O_RDONLY|O_DIRECTORY); if (pfd < 0) goto err; @@ -1063,6 +1088,16 @@ static const char *find_device(const char *mtab_file, dev_t dev) done = true; break; } + + break; + case UFS1: + case UFS2: + if (!strcmp(mnt->mnt_type, "ufs") && !stat(mnt->mnt_fsname, &dst) && + dst.st_rdev == dev) { + done = true; + } + + break; case NONE: break; } @@ -1187,7 +1222,7 @@ static int validate_device_btrfs(int pfd, int dfd) return -1; return 0; /* It's good! */ -} +} static const char *find_device_btrfs(const c...
2013 Dec 17
9
[PATCH] Btrfs-progs: receive: fix the case that we can not find subvolume
...+ int ret = -1; + + f = setmntent("/proc/self/mounts", "r"); + if (f == NULL) + return ret; + while ((mnt = getmntent(f)) != NULL) { + if (strcmp(mnt->mnt_type, "btrfs")) + continue; + if (strcmp(mnt->mnt_dir, mnt_dir)) + continue; + *dev = strdup(mnt->mnt_fsname); + if (*dev) + ret = 0; + break; + } + endmntent(f); + + return ret; +} + /* This finds the mount point for a given fsid, * subvols of the same fs/fsid can be mounted * so here this picks and lowest subvol id diff --git a/utils.h b/utils.h index 00f1c18..9b2f79c 100644 --- a/utils.h +++...