diff -Nru exfat-nofuse-1.2.9+20150620/debian/changelog exfat-nofuse-1.2.9+20151110/debian/changelog --- exfat-nofuse-1.2.9+20150620/debian/changelog 2015-07-25 13:49:45.000000000 +0000 +++ exfat-nofuse-1.2.9+20151110/debian/changelog 2015-11-12 22:03:16.000000000 +0000 @@ -1,3 +1,9 @@ +exfat-nofuse (1.2.9+20151110-0~eugenesan~wily1) wily; urgency=medium + + * New upstream snapshot (593e1cef6219a932b281ee486fa68b252182c1f8) + + -- Eugene San (eugenesan) Thu, 12 Nov 2015 16:59:38 -0500 + exfat-nofuse (1.2.9+20150620-0~eugenesan~wily1) wily; urgency=medium * New upstream snapshot diff -Nru exfat-nofuse-1.2.9+20150620/exfat_data.c exfat-nofuse-1.2.9+20151110/exfat_data.c --- exfat-nofuse-1.2.9+20150620/exfat_data.c 2015-06-20 12:08:13.000000000 +0000 +++ exfat-nofuse-1.2.9+20151110/exfat_data.c 2015-11-10 08:45:51.000000000 +0000 @@ -57,13 +57,21 @@ /*----------------------------------------------------------------------*/ /* FAT cache */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) +DECLARE_MUTEX(f_sem); +#else DEFINE_SEMAPHORE(f_sem); +#endif BUF_CACHE_T FAT_cache_array[FAT_CACHE_SIZE]; BUF_CACHE_T FAT_cache_lru_list; BUF_CACHE_T FAT_cache_hash_list[FAT_CACHE_HASH_SIZE]; /* buf cache */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) +DECLARE_MUTEX(b_sem); +#else DEFINE_SEMAPHORE(b_sem); +#endif BUF_CACHE_T buf_cache_array[BUF_CACHE_SIZE]; BUF_CACHE_T buf_cache_lru_list; BUF_CACHE_T buf_cache_hash_list[BUF_CACHE_HASH_SIZE]; diff -Nru exfat-nofuse-1.2.9+20150620/exfat_oal.c exfat-nofuse-1.2.9+20151110/exfat_oal.c --- exfat-nofuse-1.2.9+20150620/exfat_oal.c 2015-06-20 12:08:13.000000000 +0000 +++ exfat-nofuse-1.2.9+20151110/exfat_oal.c 2015-11-10 08:45:51.000000000 +0000 @@ -55,7 +55,11 @@ /* */ /*======================================================================*/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) +DECLARE_MUTEX(z_sem); +#else DEFINE_SEMAPHORE(z_sem); +#endif s32 sm_init(struct semaphore *sm) { diff -Nru exfat-nofuse-1.2.9+20150620/exfat_super.c exfat-nofuse-1.2.9+20151110/exfat_super.c --- exfat-nofuse-1.2.9+20150620/exfat_super.c 2015-06-20 12:08:13.000000000 +0000 +++ exfat-nofuse-1.2.9+20151110/exfat_super.c 2015-11-10 08:45:51.000000000 +0000 @@ -218,7 +218,11 @@ static void exfat_detach(struct inode *inode); static void exfat_attach(struct inode *inode, loff_t i_pos); static inline unsigned long exfat_hash(loff_t i_pos); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) +static int exfat_write_inode(struct inode *inode, int wait); +#else static int exfat_write_inode(struct inode *inode, struct writeback_control *wbc); +#endif static void exfat_write_super(struct super_block *sb); static void __lock_super(struct super_block *sb) @@ -294,15 +298,15 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,00) if (flags & LOOKUP_RCU) return -ECHILD; -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,00) +#else unsigned int flags; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,00) if (nd && nd->flags & LOOKUP_RCU) return -ECHILD; +#endif flags = nd ? nd->flags : 0; -#else - flags = nd ? nd->flags : 0; #endif if (dentry->d_inode) @@ -338,6 +342,8 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) static int exfat_d_hash(const struct dentry *dentry, struct qstr *qstr) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +static int exfat_d_hash(struct dentry *dentry, struct qstr *qstr) #else static int exfat_d_hash(const struct dentry *dentry, const struct inode *inode, struct qstr *qstr) @@ -349,6 +355,8 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) static int exfat_d_hashi(const struct dentry *dentry, struct qstr *qstr) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +static int exfat_d_hashi(struct dentry *dentry, struct qstr *qstr) #else static int exfat_d_hashi(const struct dentry *dentry, const struct inode *inode, struct qstr *qstr) @@ -373,6 +381,8 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) static int exfat_cmpi(const struct dentry *parent, const struct dentry *dentry, unsigned int len, const char *str, const struct qstr *name) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +static int exfat_cmpi(struct dentry *parent, struct qstr *a, struct qstr *b) #else static int exfat_cmpi(const struct dentry *parent, const struct inode *pinode, const struct dentry *dentry, const struct inode *inode, @@ -382,13 +392,26 @@ struct nls_table *t = EXFAT_SB(parent->d_sb)->nls_io; unsigned int alen, blen; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) + alen = exfat_striptail_len(a); + blen = exfat_striptail_len(b); +#else alen = exfat_striptail_len(name); blen = __exfat_striptail_len(len, str); +#endif if (alen == blen) { if (t == NULL) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) + if (strncasecmp(a->name, b->name, alen) == 0) +#else if (strncasecmp(name->name, str, alen) == 0) +#endif return 0; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) + } else if (nls_strnicmp(t, a->name, b->name, alen) == 0) +#else } else if (nls_strnicmp(t, name->name, str, alen) == 0) +#endif return 0; } return 1; @@ -397,6 +420,9 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) static int exfat_cmp(const struct dentry *parent, const struct dentry *dentry, unsigned int len, const char *str, const struct qstr *name) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +static int exfat_cmp(struct dentry *parent, struct qstr *a, + struct qstr *b) #else static int exfat_cmp(const struct dentry *parent, const struct inode *pinode, const struct dentry *dentry, const struct inode *inode, @@ -405,10 +431,19 @@ { unsigned int alen, blen; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) + alen = exfat_striptail_len(a); + blen = exfat_striptail_len(b); +#else alen = exfat_striptail_len(name); blen = __exfat_striptail_len(len, str); +#endif if (alen == blen) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) + if (strncmp(a->name, b->name, alen) == 0) +#else if (strncmp(name->name, str, alen) == 0) +#endif return 0; } return 1; @@ -617,13 +652,22 @@ } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) +static int exfat_file_fsync(struct file *filp, struct dentry *dentry, + int datasync) +#else static int exfat_file_fsync(struct file *filp, int datasync) +#endif { struct inode *inode = filp->f_mapping->host; struct super_block *sb = inode->i_sb; int res, err; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) + res = simple_fsync(filp, dentry, datasync); +#else res = generic_file_fsync(filp, datasync); +#endif err = FsSyncVol(sb, 1); return res ? res : err; @@ -1140,7 +1184,13 @@ err2 = write_inode_now(inode, 1); err = (err) ? (err) : (err2); if (!err) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) + err = wait_on_page_writeback_range(mapping, + start >> PAGE_CACHE_SHIFT, + (start + count - 1) >> PAGE_CACHE_SHIFT); +#else err = filemap_fdatawait_range(mapping, start, start + count - 1); +#endif } return err; } @@ -1205,7 +1255,9 @@ struct inode *inode = dentry->d_inode; unsigned int ia_valid; int error; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35) loff_t old_size; +#endif DPRINTK("exfat_setattr entered\n"); @@ -1307,13 +1359,20 @@ /*======================================================================*/ /* File Operations */ /*======================================================================*/ - +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,1,0) +static const char *exfat_follow_link(struct dentry *dentry, void **cookie) +{ + struct exfat_inode_info *ei = EXFAT_I(dentry->d_inode); + return *cookie = (char *)(ei->target); +} +#else static void *exfat_follow_link(struct dentry *dentry, struct nameidata *nd) { struct exfat_inode_info *ei = EXFAT_I(dentry->d_inode); nd_set_link(nd, (char *)(ei->target)); return NULL; } +#endif const struct inode_operations exfat_symlink_inode_operations = { .readlink = generic_readlink, @@ -1591,9 +1650,12 @@ const struct iovec *iov, loff_t offset, unsigned long nr_segs) #endif -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) static ssize_t exfat_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t offset) +#else /* >= 4.1.x */ +static ssize_t exfat_direct_IO(struct kiocb *iocb, + struct iov_iter *iter, loff_t offset) #endif { struct inode *inode = iocb->ki_filp->f_mapping->host; @@ -1601,6 +1663,11 @@ struct address_space *mapping = iocb->ki_filp->f_mapping; #endif ssize_t ret; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) + int rw; + + rw = iov_iter_rw(iter); +#endif if (rw == WRITE) { #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) @@ -1827,7 +1894,11 @@ static int exfat_sync_inode(struct inode *inode) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) + return exfat_write_inode(inode, 0); +#else return exfat_write_inode(inode, NULL); +#endif } static struct inode *exfat_alloc_inode(struct super_block *sb) @@ -1854,7 +1925,11 @@ kmem_cache_free(exfat_inode_cachep, EXFAT_I(inode)); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) +static int exfat_write_inode(struct inode *inode, int wait) +#else static int exfat_write_inode(struct inode *inode, struct writeback_control *wbc) +#endif { struct super_block *sb = inode->i_sb; struct exfat_sb_info *sbi = EXFAT_SB(sb); @@ -2122,7 +2197,7 @@ opts->allow_utime = (unsigned short) -1; opts->codepage = exfat_default_codepage; opts->iocharset = exfat_default_iocharset; - opts->casesensitive = 1; + opts->casesensitive = 0; opts->errors = EXFAT_ERRORS_RO; #ifdef CONFIG_EXFAT_DISCARD opts->discard = 0; @@ -2281,6 +2356,7 @@ return 0; } +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37) static void setup_dops(struct super_block *sb) { if (EXFAT_SB(sb)->options.casesensitive == 0) @@ -2288,6 +2364,7 @@ else sb->s_d_op = &exfat_dentry_ops; } +#endif static int exfat_fill_super(struct super_block *sb, void *data, int silent) { @@ -2318,7 +2395,9 @@ if (error) goto out_fail; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37) setup_dops(sb); +#endif error = -EIO; sb_min_blocksize(sb, 512);