~ubuntu-branches/ubuntu/natty/redhat-cluster/natty

« back to all changes in this revision

Viewing changes to gfs2/mount/mount.gfs2.c

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2009-09-15 07:15:43 UTC
  • mfrom: (1.1.16 upstream) (10.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090915071543-vr089k11l3kl9llu
Tags: 3.0.2-2ubuntu1
Remove unnecessary build dep on libvolume-id-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "util.h"
2
2
 
3
 
char *prog_name;
4
 
char *fsname;
 
3
const char *fsname;
5
4
int verbose, fake_mount = 0, no_mtab = 0;
6
5
static sigset_t old_sigset;
7
6
 
155
154
                lock_dlm_leave(mo, sb, mnterr);
156
155
}
157
156
 
158
 
#if 0
159
 
static void check_sys_fs(char *fsname)
160
 
{
161
 
        DIR *d;
162
 
        struct dirent *de;
163
 
 
164
 
        d = opendir("/sys/fs/");
165
 
        if (!d)
166
 
                die("no /sys/fs/ directory found: %d\n", errno);
167
 
 
168
 
        while ((de = readdir(d))) {
169
 
                if (strnlen(fsname, 5) != strnlen(de->d_name, 5))
170
 
                        continue;
171
 
                if (!strncmp(fsname, de->d_name, strnlen(fsname, 5))) {
172
 
                        closedir(d);
173
 
                        return;
174
 
                }
175
 
        }
176
 
        closedir(d);
177
 
        die("fs type \"%s\" not found in /sys/fs/, is the module loaded?\n",
178
 
            fsname);
179
 
}
180
 
#endif
181
 
 
182
157
int main(int argc, char **argv)
183
158
{
184
159
        struct mount_options mo;
189
164
        memset(&mo, 0, sizeof(mo));
190
165
        memset(&sb, 0, sizeof(sb));
191
166
 
192
 
        prog_name = argv[0];
193
 
 
194
 
        if (!strstr(prog_name, "gfs"))
195
 
                die("invalid mount helper name \"%s\"\n", prog_name);
196
 
 
197
 
        fsname = (strstr(prog_name, "gfs2")) ? "gfs2" : "gfs";
 
167
        if (!strstr(argv[0], "gfs"))
 
168
                die("invalid mount helper name \"%s\"\n", argv[0]);
 
169
 
 
170
        fsname = (strstr(argv[0], "gfs2")) ? "gfs2" : "gfs";
198
171
        strcpy(mo.type, fsname);
199
172
 
200
173
        if (argc < 2) {