@@ -218,7 +218,11 @@ static struct inode *exfat_build_inode(struct super_block *sb, FILE_ID_T *fid, l
218
218
static void exfat_detach (struct inode * inode );
219
219
static void exfat_attach (struct inode * inode , loff_t i_pos );
220
220
static inline unsigned long exfat_hash (loff_t i_pos );
221
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,34 )
222
+ static int exfat_write_inode (struct inode * inode , int wait );
223
+ #else
221
224
static int exfat_write_inode (struct inode * inode , struct writeback_control * wbc );
225
+ #endif
222
226
static void exfat_write_super (struct super_block * sb );
223
227
224
228
static void __lock_super (struct super_block * sb )
@@ -338,6 +342,8 @@ static unsigned int exfat_striptail_len(const struct qstr *qstr)
338
342
339
343
#if LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,11 ,0 )
340
344
static int exfat_d_hash (const struct dentry * dentry , struct qstr * qstr )
345
+ #elif LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
346
+ static int exfat_d_hash (struct dentry * dentry , struct qstr * qstr )
341
347
#else
342
348
static int exfat_d_hash (const struct dentry * dentry , const struct inode * inode ,
343
349
struct qstr * qstr )
@@ -349,6 +355,8 @@ static int exfat_d_hash(const struct dentry *dentry, const struct inode *inode,
349
355
350
356
#if LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,11 ,0 )
351
357
static int exfat_d_hashi (const struct dentry * dentry , struct qstr * qstr )
358
+ #elif LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
359
+ static int exfat_d_hashi (struct dentry * dentry , struct qstr * qstr )
352
360
#else
353
361
static int exfat_d_hashi (const struct dentry * dentry , const struct inode * inode ,
354
362
struct qstr * qstr )
@@ -373,6 +381,8 @@ static int exfat_d_hashi(const struct dentry *dentry, const struct inode *inode,
373
381
#if LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,11 ,0 )
374
382
static int exfat_cmpi (const struct dentry * parent , const struct dentry * dentry ,
375
383
unsigned int len , const char * str , const struct qstr * name )
384
+ #elif LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
385
+ static int exfat_cmpi (struct dentry * parent , struct qstr * a , struct qstr * b )
376
386
#else
377
387
static int exfat_cmpi (const struct dentry * parent , const struct inode * pinode ,
378
388
const struct dentry * dentry , const struct inode * inode ,
@@ -382,13 +392,26 @@ static int exfat_cmpi(const struct dentry *parent, const struct inode *pinode,
382
392
struct nls_table * t = EXFAT_SB (parent -> d_sb )-> nls_io ;
383
393
unsigned int alen , blen ;
384
394
395
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
396
+ alen = exfat_striptail_len (a );
397
+ blen = exfat_striptail_len (b );
398
+ #else
385
399
alen = exfat_striptail_len (name );
386
400
blen = __exfat_striptail_len (len , str );
401
+ #endif
387
402
if (alen == blen ) {
388
403
if (t == NULL ) {
404
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
405
+ if (strncasecmp (a -> name , b -> name , alen ) == 0 )
406
+ #else
389
407
if (strncasecmp (name -> name , str , alen ) == 0 )
408
+ #endif
390
409
return 0 ;
410
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
411
+ } else if (nls_strnicmp (t , a -> name , b -> name , alen ) == 0 )
412
+ #else
391
413
} else if (nls_strnicmp (t , name -> name , str , alen ) == 0 )
414
+ #endif
392
415
return 0 ;
393
416
}
394
417
return 1 ;
@@ -397,6 +420,9 @@ static int exfat_cmpi(const struct dentry *parent, const struct inode *pinode,
397
420
#if LINUX_VERSION_CODE >= KERNEL_VERSION (3 ,11 ,0 )
398
421
static int exfat_cmp (const struct dentry * parent , const struct dentry * dentry ,
399
422
unsigned int len , const char * str , const struct qstr * name )
423
+ #elif LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
424
+ static int exfat_cmp (struct dentry * parent , struct qstr * a ,
425
+ struct qstr * b )
400
426
#else
401
427
static int exfat_cmp (const struct dentry * parent , const struct inode * pinode ,
402
428
const struct dentry * dentry , const struct inode * inode ,
@@ -405,10 +431,19 @@ static int exfat_cmp(const struct dentry *parent, const struct inode *pinode,
405
431
{
406
432
unsigned int alen , blen ;
407
433
434
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
435
+ alen = exfat_striptail_len (a );
436
+ blen = exfat_striptail_len (b );
437
+ #else
408
438
alen = exfat_striptail_len (name );
409
439
blen = __exfat_striptail_len (len , str );
440
+ #endif
410
441
if (alen == blen ) {
442
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,38 )
443
+ if (strncmp (a -> name , b -> name , alen ) == 0 )
444
+ #else
411
445
if (strncmp (name -> name , str , alen ) == 0 )
446
+ #endif
412
447
return 0 ;
413
448
}
414
449
return 1 ;
@@ -617,13 +652,22 @@ static long exfat_generic_ioctl(struct file *filp,
617
652
}
618
653
619
654
#if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,36 )
655
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,35 )
656
+ static int exfat_file_fsync (struct file * filp , struct dentry * dentry ,
657
+ int datasync )
658
+ #else
620
659
static int exfat_file_fsync (struct file * filp , int datasync )
660
+ #endif
621
661
{
622
662
struct inode * inode = filp -> f_mapping -> host ;
623
663
struct super_block * sb = inode -> i_sb ;
624
664
int res , err ;
625
665
666
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,35 )
667
+ res = simple_fsync (filp , dentry , datasync );
668
+ #else
626
669
res = generic_file_fsync (filp , datasync );
670
+ #endif
627
671
err = FsSyncVol (sb , 1 );
628
672
629
673
return res ? res : err ;
@@ -1140,7 +1184,13 @@ static int exfat_cont_expand(struct inode *inode, loff_t size)
1140
1184
err2 = write_inode_now (inode , 1 );
1141
1185
err = (err ) ? (err ) : (err2 );
1142
1186
if (!err )
1187
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,32 )
1188
+ err = wait_on_page_writeback_range (mapping ,
1189
+ start >> PAGE_CACHE_SHIFT ,
1190
+ (start + count - 1 ) >> PAGE_CACHE_SHIFT );
1191
+ #else
1143
1192
err = filemap_fdatawait_range (mapping , start , start + count - 1 );
1193
+ #endif
1144
1194
}
1145
1195
return err ;
1146
1196
}
@@ -1205,7 +1255,9 @@ static int exfat_setattr(struct dentry *dentry, struct iattr *attr)
1205
1255
struct inode * inode = dentry -> d_inode ;
1206
1256
unsigned int ia_valid ;
1207
1257
int error ;
1258
+ #if LINUX_VERSION_CODE > KERNEL_VERSION (2 ,6 ,35 )
1208
1259
loff_t old_size ;
1260
+ #endif
1209
1261
1210
1262
DPRINTK ("exfat_setattr entered\n" );
1211
1263
@@ -1842,7 +1894,11 @@ static struct inode *exfat_build_inode(struct super_block *sb,
1842
1894
1843
1895
static int exfat_sync_inode (struct inode * inode )
1844
1896
{
1897
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,34 )
1898
+ return exfat_write_inode (inode , 0 );
1899
+ #else
1845
1900
return exfat_write_inode (inode , NULL );
1901
+ #endif
1846
1902
}
1847
1903
1848
1904
static struct inode * exfat_alloc_inode (struct super_block * sb )
@@ -1869,7 +1925,11 @@ static void exfat_destroy_inode(struct inode *inode)
1869
1925
kmem_cache_free (exfat_inode_cachep , EXFAT_I (inode ));
1870
1926
}
1871
1927
1928
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (2 ,6 ,34 )
1929
+ static int exfat_write_inode (struct inode * inode , int wait )
1930
+ #else
1872
1931
static int exfat_write_inode (struct inode * inode , struct writeback_control * wbc )
1932
+ #endif
1873
1933
{
1874
1934
struct super_block * sb = inode -> i_sb ;
1875
1935
struct exfat_sb_info * sbi = EXFAT_SB (sb );
@@ -2296,13 +2356,15 @@ static int exfat_read_root(struct inode *inode)
2296
2356
return 0 ;
2297
2357
}
2298
2358
2359
+ #if LINUX_VERSION_CODE > KERNEL_VERSION (2 ,6 ,37 )
2299
2360
static void setup_dops (struct super_block * sb )
2300
2361
{
2301
2362
if (EXFAT_SB (sb )-> options .casesensitive == 0 )
2302
2363
sb -> s_d_op = & exfat_ci_dentry_ops ;
2303
2364
else
2304
2365
sb -> s_d_op = & exfat_dentry_ops ;
2305
2366
}
2367
+ #endif
2306
2368
2307
2369
static int exfat_fill_super (struct super_block * sb , void * data , int silent )
2308
2370
{
@@ -2333,7 +2395,9 @@ static int exfat_fill_super(struct super_block *sb, void *data, int silent)
2333
2395
if (error )
2334
2396
goto out_fail ;
2335
2397
2398
+ #if LINUX_VERSION_CODE > KERNEL_VERSION (2 ,6 ,37 )
2336
2399
setup_dops (sb );
2400
+ #endif
2337
2401
2338
2402
error = - EIO ;
2339
2403
sb_min_blocksize (sb , 512 );
0 commit comments