- }
-
- if (exportsize == (off_t)OFFT_MAX) {
- exportsize = size_autodetect(export[0]);
- }
- if (exportsize > (off_t)OFFT_MAX) {
- err("Size of exported file is too big\n");
- }
- else
- msg3(LOG_INFO, "size of exported file/device is %Lu",
- (unsigned long long)exportsize);
-
- if (flags & F_COPYONWRITE) {
- sprintf(difffilename,"%s-%s-%d.diff",exportname2,clientname,
- (int)getpid()) ;
- msg3(LOG_INFO,"About to create map and diff file %s",difffilename) ;
- difffile=open(difffilename,O_RDWR | O_CREAT | O_TRUNC,0600) ;
- if (difffile<0) err("Could not create diff file (%m)") ;
- if ((difmap=calloc(exportsize/DIFFPAGESIZE,sizeof(u32)))==NULL)
- err("Could not allocate memory") ;
- for (i=0;i<exportsize/DIFFPAGESIZE;i++) difmap[i]=(u32)-1 ;
- }
-
- setmysockopt(net);
-
- mainloop(net);
+ if (exportsize > (off_t)OFFT_MAX) {
+ err("Size of exported file is too big\n");
+ }
+ else
+ msg3(LOG_INFO, "size of exported file/device is %Lu",
+ (unsigned long long)exportsize);
+
+ if (flags & F_COPYONWRITE) {
+ sprintf(difffilename,"%s-%s-%d.diff",exportname2,clientname,
+ (int)getpid()) ;
+ msg3(LOG_INFO,"About to create map and diff file %s",difffilename) ;
+ difffile=open(difffilename,O_RDWR | O_CREAT | O_TRUNC,0600) ;
+ if (difffile<0) err("Could not create diff file (%m)") ;
+ if ((difmap=calloc(exportsize/DIFFPAGESIZE,sizeof(u32)))==NULL)
+ err("Could not allocate memory") ;
+ for (i=0;i<exportsize/DIFFPAGESIZE;i++) difmap[i]=(u32)-1 ;
+ }
+
+ setmysockopt(net);
+
+ mainloop(net);