diff options
Diffstat (limited to 'fs')
113 files changed, 293 insertions, 208 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index d7b78d531e63..6a0f3fa85ef7 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -34,7 +34,7 @@ #include <linux/list.h> #include <linux/pagemap.h> #include <linux/utsname.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/idr.h> #include <linux/uio.h> #include <linux/slab.h> diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 2853b4095344..35efb9a31dd7 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -14,7 +14,7 @@ #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/sched.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" static struct proc_dir_entry *proc_afs; @@ -42,7 +42,7 @@ #include <linux/mount.h> #include <asm/kmap_types.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" @@ -1285,7 +1285,7 @@ static long read_events(struct kioctx *ctx, long min_nr, long nr, struct io_event __user *event, struct timespec __user *timeout) { - ktime_t until = { .tv64 = KTIME_MAX }; + ktime_t until = KTIME_MAX; long ret = 0; if (timeout) { @@ -1311,7 +1311,7 @@ static long read_events(struct kioctx *ctx, long min_nr, long nr, * the ringbuffer empty. So in practice we should be ok, but it's * something to be aware of when touching this code. */ - if (until.tv64 == 0) + if (until == 0) aio_read_events(ctx, min_nr, nr, event, &ret); else wait_event_interruptible_hrtimeout(ctx->wait, diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c index 80ef38c73e5a..3168ee4e77f4 100644 --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -20,7 +20,7 @@ #include <linux/magic.h> #include <linux/anon_inodes.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> static struct vfsmount *anon_inode_mnt __read_mostly; static struct inode *anon_inode_inode; diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 1e5c896f6b79..f2deec0a62f0 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -16,7 +16,7 @@ #include <linux/vfs.h> #include <linux/writeback.h> #include <linux/uio.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "bfs.h" MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index ae1b5404fced..2a59139f520b 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c @@ -26,7 +26,7 @@ #include <linux/coredump.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/cacheflush.h> #include <asm/a.out-core.h> diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index e6c1bd443806..29a02daf08a9 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -36,7 +36,7 @@ #include <linux/coredump.h> #include <linux/sched.h> #include <linux/dax.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/param.h> #include <asm/page.h> diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 464a972e88c1..d2e36f82c35d 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -37,7 +37,7 @@ #include <linux/coredump.h> #include <linux/dax.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/param.h> #include <asm/pgalloc.h> diff --git a/fs/block_dev.c b/fs/block_dev.c index 7c4507224ed6..6254cee8f8f3 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -32,7 +32,7 @@ #include <linux/badblocks.h> #include <linux/task_io_accounting_ops.h> #include <linux/falloc.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" struct bdev_inode { diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 3d03e48a9213..9727e1dcacd5 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -24,7 +24,7 @@ #include <linux/ctype.h> #include <linux/module.h> #include <linux/proc_fs.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "cifspdu.h" #include "cifsglob.h" #include "cifsproto.h" diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 5eb04129f938..66bd7fa9b7a6 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -699,11 +699,15 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) { if (!ses->domainName) { - rc = find_domain_name(ses, nls_cp); - if (rc) { - cifs_dbg(VFS, "error %d finding domain name\n", - rc); - goto setup_ntlmv2_rsp_ret; + if (ses->domainAuto) { + rc = find_domain_name(ses, nls_cp); + if (rc) { + cifs_dbg(VFS, "error %d finding domain name\n", + rc); + goto setup_ntlmv2_rsp_ret; + } + } else { + ses->domainName = kstrdup("", GFP_KERNEL); } } } else { diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index e6efb9a88598..70f4e65fced2 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -615,7 +615,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) return dget(sb->s_root); full_path = cifs_build_path_to_root(vol, cifs_sb, - cifs_sb_master_tcon(cifs_sb)); + cifs_sb_master_tcon(cifs_sb), 0); if (full_path == NULL) return ERR_PTR(-ENOMEM); diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 1f17f6bd7a60..7ea8a3393936 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -514,6 +514,7 @@ struct smb_vol { bool persistent:1; bool nopersistent:1; bool resilient:1; /* noresilient not required since not fored for CA */ + bool domainauto:1; unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; @@ -525,6 +526,7 @@ struct smb_vol { struct sockaddr_storage srcaddr; /* allow binding to a local IP */ struct nls_table *local_nls; unsigned int echo_interval; /* echo interval in secs */ + __u64 snapshot_time; /* needed for timewarp tokens */ unsigned int max_credits; /* smb3 max_credits 10 < credits < 60000 */ }; @@ -646,6 +648,8 @@ struct TCP_Server_Info { unsigned int max_read; unsigned int max_write; __u8 preauth_hash[512]; + struct delayed_work reconnect; /* reconnect workqueue job */ + struct mutex reconnect_mutex; /* prevent simultaneous reconnects */ #endif /* CONFIG_CIFS_SMB2 */ unsigned long echo_interval; }; @@ -827,6 +831,7 @@ struct cifs_ses { enum securityEnum sectype; /* what security flavor was specified? */ bool sign; /* is signing required? */ bool need_reconnect:1; /* connection reset, uid now invalid */ + bool domainAuto:1; #ifdef CONFIG_CIFS_SMB2 __u16 session_flags; __u8 smb3signingkey[SMB3_SIGN_KEY_SIZE]; @@ -849,6 +854,7 @@ cap_unix(struct cifs_ses *ses) struct cifs_tcon { struct list_head tcon_list; int tc_count; + struct list_head rlist; /* reconnect list */ struct list_head openFileList; spinlock_t open_file_lock; /* protects list above */ struct cifs_ses *ses; /* pointer to session associated with */ @@ -922,6 +928,7 @@ struct cifs_tcon { bool broken_posix_open; /* e.g. Samba server versions < 3.3.2, 3.2.9 */ bool broken_sparse_sup; /* if server or share does not support sparse */ bool need_reconnect:1; /* connection reset, tid now invalid */ + bool need_reopen_files:1; /* need to reopen tcon file handles */ bool use_resilient:1; /* use resilient instead of durable handles */ bool use_persistent:1; /* use persistent instead of durable handles */ #ifdef CONFIG_CIFS_SMB2 @@ -932,6 +939,7 @@ struct cifs_tcon { __u32 maximal_access; __u32 vol_serial_number; __le64 vol_create_time; + __u64 snapshot_time; /* for timewarp tokens - timestamp of snapshot */ __u32 ss_flags; /* sector size flags */ __u32 perf_sector_size; /* best sector size for perf */ __u32 max_chunks; diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index ced0e42ce460..c7b3c841e660 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h @@ -63,7 +63,8 @@ extern void exit_cifs_spnego(void); extern char *build_path_from_dentry(struct dentry *); extern char *cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, - struct cifs_tcon *tcon); + struct cifs_tcon *tcon, + int add_treename); extern char *build_wildcard_path_from_dentry(struct dentry *direntry); extern char *cifs_compose_mount_options(const char *sb_mountdata, const char *fullpath, const struct dfs_info3_param *ref, @@ -206,6 +207,9 @@ extern void cifs_add_pending_open_locked(struct cifs_fid *fid, struct tcon_link *tlink, struct cifs_pending_open *open); extern void cifs_del_pending_open(struct cifs_pending_open *open); +extern void cifs_put_tcp_session(struct TCP_Server_Info *server, + int from_reconnect); +extern void cifs_put_tcon(struct cifs_tcon *tcon); #if IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) extern void cifs_dfs_release_automount_timer(void); diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index e3fed9249a04..b47261858e6d 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -35,7 +35,7 @@ #include <linux/pagemap.h> #include <linux/swap.h> #include <linux/task_io_accounting_ops.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "cifspdu.h" #include "cifsglob.h" #include "cifsacl.h" diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index f7563c88c917..35ae49ed1f76 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -34,7 +34,7 @@ #include <linux/pagevec.h> #include <linux/freezer.h> #include <linux/namei.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/processor.h> #include <linux/inet.h> #include <linux/module.h> @@ -53,6 +53,9 @@ #include "nterr.h" #include "rfc1002pdu.h" #include "fscache.h" +#ifdef CONFIG_CIFS_SMB2 +#include "smb2proto.h" +#endif #define CIFS_PORT 445 #define RFC1001_PORT 139 @@ -89,6 +92,7 @@ enum { Opt_multiuser, Opt_sloppy, Opt_nosharesock, Opt_persistent, Opt_nopersistent, Opt_resilient, Opt_noresilient, + Opt_domainauto, /* Mount options which take numeric value */ Opt_backupuid, Opt_backupgid, Opt_uid, @@ -96,6 +100,7 @@ enum { Opt_dirmode, Opt_port, Opt_rsize, Opt_wsize, Opt_actimeo, Opt_echo_interval, Opt_max_credits, + Opt_snapshot, /* Mount options which take string value */ Opt_user, Opt_pass, Opt_ip, @@ -177,6 +182,7 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_nopersistent, "nopersistenthandles"}, { Opt_resilient, "resilienthandles"}, { Opt_noresilient, "noresilienthandles"}, + { Opt_domainauto, "domainauto"}, { Opt_backupuid, "backupuid=%s" }, { Opt_backupgid, "backupgid=%s" }, @@ -192,6 +198,7 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_actimeo, "actimeo=%s" }, { Opt_echo_interval, "echo_interval=%s" }, { Opt_max_credits, "max_credits=%s" }, + { Opt_snapshot, "snapshot=%s" }, { Opt_blank_user, "user=" }, { Opt_blank_user, "username=" }, @@ -1500,6 +1507,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, case Opt_noresilient: vol->resilient = false; /* already the default */ break; + case Opt_domainauto: + vol->domainauto = true; + break; /* Numeric Values */ case Opt_backupuid: @@ -1602,6 +1612,14 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, } vol->echo_interval = option; break; + case Opt_snapshot: + if (get_option_ul(args, &option)) { + cifs_dbg(VFS, "%s: Invalid snapshot time\n", + __func__); + goto cifs_parse_mount_err; + } + vol->snapshot_time = option; + break; case Opt_max_credits: if (get_option_ul(args, &option) || (option < 20) || (option > 60000)) { @@ -2101,8 +2119,8 @@ cifs_find_tcp_session(struct smb_vol *vol) return NULL; } -static void -cifs_put_tcp_session(struct TCP_Server_Info *server) +void +cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect) { struct task_struct *task; @@ -2119,6 +2137,19 @@ cifs_put_tcp_session(struct TCP_Server_Info *server) cancel_delayed_work_sync(&server->echo); +#ifdef CONFIG_CIFS_SMB2 + if (from_reconnect) + /* + * Avoid deadlock here: reconnect work calls + * cifs_put_tcp_session() at its end. Need to be sure + * that reconnect work does nothing with server pointer after + * that step. + */ + cancel_delayed_work(&server->reconnect); + else + cancel_delayed_work_sync(&server->reconnect); +#endif + spin_lock(&GlobalMid_Lock); server->tcpStatus = CifsExiting; spin_unlock(&GlobalMid_Lock); @@ -2183,6 +2214,10 @@ cifs_get_tcp_session(struct smb_vol *volume_info) INIT_LIST_HEAD(&tcp_ses->tcp_ses_list); INIT_LIST_HEAD(&tcp_ses->smb_ses_list); INIT_DELAYED_WORK(&tcp_ses->echo, cifs_echo_request); +#ifdef CONFIG_CIFS_SMB2 + INIT_DELAYED_WORK(&tcp_ses->reconnect, smb2_reconnect_server); + mutex_init(&tcp_ses->reconnect_mutex); +#endif memcpy(&tcp_ses->srcaddr, &volume_info->srcaddr, sizeof(tcp_ses->srcaddr)); memcpy(&tcp_ses->dstaddr, &volume_info->dstaddr, @@ -2341,7 +2376,7 @@ cifs_put_smb_ses(struct cifs_ses *ses) spin_unlock(&cifs_tcp_ses_lock); sesInfoFree(ses); - cifs_put_tcp_session(server); + cifs_put_tcp_session(server, 0); } #ifdef CONFIG_KEYS @@ -2515,7 +2550,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) mutex_unlock(&ses->session_mutex); /* existing SMB ses has a server reference already */ - cifs_put_tcp_session(server); + cifs_put_tcp_session(server, 0); free_xid(xid); return ses; } @@ -2549,6 +2584,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) if (!ses->domainName) goto get_ses_fail; } + if (volume_info->domainauto) + ses->domainAuto = volume_info->domainauto; ses->cred_uid = volume_info->cred_uid; ses->linux_uid = volume_info->linux_uid; @@ -2587,7 +2624,7 @@ static int match_tcon(struct cifs_tcon *tcon, const char *unc) } static struct cifs_tcon * -cifs_find_tcon(struct cifs_ses *ses, const char *unc) +cifs_find_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) { struct list_head *tmp; struct cifs_tcon *tcon; @@ -2595,8 +2632,14 @@ cifs_find_tcon(struct cifs_ses *ses, const char *unc) spin_lock(&cifs_tcp_ses_lock); list_for_each(tmp, &ses->tcon_list) { tcon = list_entry(tmp, struct cifs_tcon, tcon_list); - if (!match_tcon(tcon, unc)) + if (!match_tcon(tcon, volume_info->UNC)) continue; + +#ifdef CONFIG_CIFS_SMB2 + if (tcon->snapshot_time != volume_info->snapshot_time) + continue; +#endif /* CONFIG_CIFS_SMB2 */ + ++tcon->tc_count; spin_unlock(&cifs_tcp_ses_lock); return tcon; @@ -2605,7 +2648,7 @@ cifs_find_tcon(struct cifs_ses *ses, const char *unc) return NULL; } -static void +void cifs_put_tcon(struct cifs_tcon *tcon) { unsigned int xid; @@ -2637,7 +2680,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) int rc, xid; struct cifs_tcon *tcon; - tcon = cifs_find_tcon(ses, volume_info->UNC); + tcon = cifs_find_tcon(ses, volume_info); if (tcon) { cifs_dbg(FYI, "Found match on UNC path\n"); /* existing tcon already has a reference */ @@ -2658,6 +2701,22 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) goto out_fail; } + if (volume_info->snapshot_time) { +#ifdef CONFIG_CIFS_SMB2 + if (ses->server->vals->protocol_id == 0) { + cifs_dbg(VFS, + "Use SMB2 or later for snapshot mount option\n"); + rc = -EOPNOTSUPP; + goto out_fail; + } else + tcon->snapshot_time = volume_info->snapshot_time; +#else + cifs_dbg(VFS, "Snapshot mount option requires SMB2 support\n"); + rc = -EOPNOTSUPP; + goto out_fail; +#endif /* CONFIG_CIFS_SMB2 */ + } + tcon->ses = ses; if (volume_info->password) { tcon->password = kstrdup(volume_info->password, GFP_KERNEL); @@ -3707,7 +3766,8 @@ remote_path_check: /* * cifs_build_path_to_root works only when we have a valid tcon */ - full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon); + full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon, + tcon->Flags & SMB_SHARE_IS_IN_DFS); if (full_path == NULL) { rc = -ENOMEM; goto mount_fail_check; @@ -3793,7 +3853,7 @@ mount_fail_check: else if (ses) cifs_put_smb_ses(ses); else - cifs_put_tcp_session(server); + cifs_put_tcp_session(server, 0); bdi_destroy(&cifs_sb->bdi); } @@ -4104,7 +4164,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) ses = cifs_get_smb_ses(master_tcon->ses->server, vol_info); if (IS_ERR(ses)) { tcon = (struct cifs_tcon *)ses; - cifs_put_tcp_session(master_tcon->ses->server); + cifs_put_tcp_session(master_tcon->ses->server, 0); goto out; } diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 789ff1df2d8d..2c227a99f369 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -47,7 +47,7 @@ renew_parental_timestamps(struct dentry *direntry) char * cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, - struct cifs_tcon *tcon) + struct cifs_tcon *tcon, int add_treename) { int pplen = vol->prepath ? strlen(vol->prepath) + 1 : 0; int dfsplen; @@ -59,7 +59,7 @@ cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, return full_path; } - if (tcon->Flags & SMB_SHARE_IS_IN_DFS) + if (add_treename) dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1); else dfsplen = 0; diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 7f5f6176c6f1..18a1e1d6671f 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -777,6 +777,11 @@ cifs_reopen_persistent_handles(struct cifs_tcon *tcon) struct list_head *tmp1; struct list_head tmp_list; + if (!tcon->use_persistent || !tcon->need_reopen_files) + return; + + tcon->need_reopen_files = false; + cifs_dbg(FYI, "Reopen persistent handles"); INIT_LIST_HEAD(&tmp_list); @@ -793,7 +798,8 @@ cifs_reopen_persistent_handles(struct cifs_tcon *tcon) list_for_each_safe(tmp, tmp1, &tmp_list) { open_file = list_entry(tmp, struct cifsFileInfo, rlist); - cifs_reopen_file(open_file, false /* do not flush */); + if (cifs_reopen_file(open_file, false /* do not flush */)) + tcon->need_reopen_files = true; list_del_init(&open_file->rlist); cifsFileInfo_put(open_file); } diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index 9f51b81119f2..001528781b6b 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c @@ -189,7 +189,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) xid = get_xid(); cifs_sb = CIFS_SB(inode->i_sb); - cifs_dbg(VFS, "cifs ioctl 0x%x\n", command); + cifs_dbg(FYI, "cifs ioctl 0x%x\n", command); switch (command) { case FS_IOC_GETFLAGS: if (pSMBFile == NULL) diff --git a/fs/cifs/link.c b/fs/cifs/link.c index d031af8d3d4d..c4d996f78e1c 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -45,13 +45,8 @@ (CIFS_MF_SYMLINK_LINK_OFFSET + CIFS_MF_SYMLINK_LINK_MAXLEN) #define CIFS_MF_SYMLINK_LEN_FORMAT "XSym\n%04u\n" -#define CIFS_MF_SYMLINK_MD5_FORMAT \ - "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n" -#define CIFS_MF_SYMLINK_MD5_ARGS(md5_hash) \ - md5_hash[0], md5_hash[1], md5_hash[2], md5_hash[3], \ - md5_hash[4], md5_hash[5], md5_hash[6], md5_hash[7], \ - md5_hash[8], md5_hash[9], md5_hash[10], md5_hash[11],\ - md5_hash[12], md5_hash[13], md5_hash[14], md5_hash[15] +#define CIFS_MF_SYMLINK_MD5_FORMAT "%16phN\n" +#define CIFS_MF_SYMLINK_MD5_ARGS(md5_hash) md5_hash static int symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash) diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c index f9e766f464be..b2aff0c6f22c 100644 --- a/fs/cifs/smb2file.c +++ b/fs/cifs/smb2file.c @@ -260,7 +260,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile) * and check it for zero before using. */ max_buf = tlink_tcon(cfile->tlink)->ses->server->maxBuf; - if (!max_buf) { + if (max_buf < sizeof(struct smb2_lock_element)) { free_xid(xid); return -EINVAL; } diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 5ca5ea4668a1..87457227812c 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -250,16 +250,19 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) } cifs_mark_open_files_invalid(tcon); + if (tcon->use_persistent) + tcon->need_reopen_files = true; rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage); mutex_unlock(&tcon->ses->session_mutex); - if (tcon->use_persistent) - cifs_reopen_persistent_handles(tcon); - cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); if (rc) goto out; + + if (smb2_command != SMB2_INTERNAL_CMD) + queue_delayed_work(cifsiod_wq, &server->reconnect, 0); + atomic_inc(&tconInfoReconnectCount); out: /* @@ -280,7 +283,7 @@ out: case SMB2_CHANGE_NOTIFY: case SMB2_QUERY_INFO: case SMB2_SET_INFO: - return -EAGAIN; + rc = -EAGAIN; } unload_nls(nls_codepage); return rc; @@ -1972,6 +1975,55 @@ smb2_echo_callback(struct mid_q_entry *mid) add_credits(server, credits_received, CIFS_ECHO_OP); } +void smb2_reconnect_server(struct work_struct *work) +{ + struct TCP_Server_Info *server = container_of(work, + struct TCP_Server_Info, reconnect.work); + struct cifs_ses *ses; + struct cifs_tcon *tcon, *tcon2; + struct list_head tmp_list; + int tcon_exist = false; + + /* Prevent simultaneous reconnects that can corrupt tcon->rlist list */ + mutex_lock(&server->reconnect_mutex); + + INIT_LIST_HEAD(&tmp_list); + cifs_dbg(FYI, "Need negotiate, reconnecting tcons\n"); + + spin_lock(&cifs_tcp_ses_lock); + list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { + list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { + if (tcon->need_reconnect || tcon->need_reopen_files) { + tcon->tc_count++; + list_add_tail(&tcon->rlist, &tmp_list); + tcon_exist = true; + } + } + } + /* + * Get the reference to server struct to be sure that the last call of + * cifs_put_tcon() in the loop below won't release the server pointer. + */ + if (tcon_exist) + server->srv_count++; + + spin_unlock(&cifs_tcp_ses_lock); + + list_for_each_entry_safe(tcon, tcon2, &tmp_list, rlist) { + if (!smb2_reconnect(SMB2_INTERNAL_CMD, tcon)) + cifs_reopen_persistent_handles(tcon); + list_del_init(&tcon->rlist); + cifs_put_tcon(tcon); + } + + cifs_dbg(FYI, "Reconnecting tcons finished\n"); + mutex_unlock(&server->reconnect_mutex); + + /* now we can safely release srv struct */ + if (tcon_exist) + cifs_put_tcp_session(server, 1); +} + int SMB2_echo(struct TCP_Server_Info *server) { @@ -1984,32 +2036,11 @@ SMB2_echo(struct TCP_Server_Info *server) cifs_dbg(FYI, "In echo request\n"); if (server->tcpStatus == CifsNeedNegotiate) { - struct list_head *tmp, *tmp2; - struct cifs_ses *ses; - struct cifs_tcon *tcon; - - cifs_dbg(FYI, "Need negotiate, reconnecting tcons\n"); - spin_lock(&cifs_tcp_ses_lock); - list_for_each(tmp, &server->smb_ses_list) { - ses = list_entry(tmp, struct cifs_ses, smb_ses_list); - list_for_each(tmp2, &ses->tcon_list) { - tcon = list_entry(tmp2, struct cifs_tcon, - tcon_list); - /* add check for persistent handle reconnect */ - if (tcon && tcon->need_reconnect) { - spin_unlock(&cifs_tcp_ses_lock); - rc = smb2_reconnect(SMB2_ECHO, tcon); - spin_lock(&cifs_tcp_ses_lock); - } - } - } - spin_unlock(&cifs_tcp_ses_lock); + /* No need to send echo on newly established connections */ + queue_delayed_work(cifsiod_wq, &server->reconnect, 0); + return rc; } - /* if no session, renegotiate failed above */ - if (server->tcpStatus == CifsNeedNegotiate) - return -EIO; - rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req); if (rc) return rc; diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index fd3709e8de33..dc0d141f33e2 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -80,6 +80,8 @@ #define SMB2_SET_INFO cpu_to_le16(SMB2_SET_INFO_HE) #define SMB2_OPLOCK_BREAK cpu_to_le16(SMB2_OPLOCK_BREAK_HE) +#define SMB2_INTERNAL_CMD cpu_to_le16(0xFFFF) + #define NUMBER_OF_SMB2_COMMANDS 0x0013 /* BB FIXME - analyze following length BB */ diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index eb2cde2f64ba..f2d511a6971b 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h @@ -96,6 +96,7 @@ extern int smb2_open_file(const unsigned int xid, extern int smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, const unsigned int xid); extern int smb2_push_mandatory_locks(struct cifsFileInfo *cfile); +extern void smb2_reconnect_server(struct work_struct *work); /* * SMB2 Worker functions - most of protocol specific implementation details diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c index 699b7868108f..c12bffefa3c9 100644 --- a/fs/cifs/smbencrypt.c +++ b/fs/cifs/smbencrypt.c @@ -23,7 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <crypto/skcipher.h> +#include <linux/crypto.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/fs.h> @@ -69,46 +69,22 @@ str_to_key(unsigned char *str, unsigned char *key) static int smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) { - int rc; unsigned char key2[8]; - struct crypto_skcipher *tfm_des; - struct scatterlist sgin, sgout; - struct skcipher_request *req; + struct crypto_cipher *tfm_des; str_to_key(key, key2); - tfm_des = crypto_alloc_skcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC); + tfm_des = crypto_alloc_cipher("des", 0, 0); if (IS_ERR(tfm_des)) { - rc = PTR_ERR(tfm_des); - cifs_dbg(VFS, "could not allocate des crypto API\n"); - goto smbhash_err; - } - - req = skcipher_request_alloc(tfm_des, GFP_KERNEL); - if (!req) { - rc = -ENOMEM; cifs_dbg(VFS, "could not allocate des crypto API\n"); - goto smbhash_free_skcipher; + return PTR_ERR(tfm_des); } - crypto_skcipher_setkey(tfm_des, key2, 8); - - sg_init_one(&sgin, in, 8); - sg_init_one(&sgout, out, 8); + crypto_cipher_setkey(tfm_des, key2, 8); + crypto_cipher_encrypt_one(tfm_des, out, in); + crypto_free_cipher(tfm_des); - skcipher_request_set_callback(req, 0, NULL, NULL); - skcipher_request_set_crypt(req, &sgin, &sgout, 8, NULL); - - rc = crypto_skcipher_encrypt(req); - if (rc) - cifs_dbg(VFS, "could not encrypt crypt key rc: %d\n", rc); - - skcipher_request_free(req); - -smbhash_free_skcipher: - crypto_free_skcipher(tfm_des); -smbhash_err: - return rc; + return 0; } static int diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 5f02edc819af..fbb84c08e3cd 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -30,7 +30,7 @@ #include <linux/tcp.h> #include <linux/bvec.h> #include <linux/highmem.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/processor.h> #include <linux/mempool.h> #include "cifspdu.h" diff --git a/fs/compat.c b/fs/compat.c index 3f4908c28698..e50a2114f474 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -49,7 +49,7 @@ #include <linux/pagemap.h> #include <linux/aio.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/mmu_context.h> #include <asm/ioctls.h> #include "internal.h" diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index f2d7402abe02..11d087b2b28e 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -76,7 +76,7 @@ #include <scsi/sg.h> #endif -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/ethtool.h> #include <linux/mii.h> #include <linux/if_bonding.h> diff --git a/fs/configfs/file.c b/fs/configfs/file.c index 2c6312db8516..39da1103d341 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c @@ -29,7 +29,7 @@ #include <linux/slab.h> #include <linux/mutex.h> #include <linux/vmalloc.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/configfs.h> #include "configfs_internal.h" diff --git a/fs/coredump.c b/fs/coredump.c index eb9c92c9b20f..e525b6017cdf 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -38,7 +38,7 @@ #include <linux/path.h> #include <linux/timekeeping.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/mmu_context.h> #include <asm/tlb.h> #include <asm/exec.h> diff --git a/fs/dcache.c b/fs/dcache.c index 252378359a8f..769903dbc19d 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -26,7 +26,7 @@ #include <linux/export.h> #include <linux/mount.h> #include <linux/file.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/security.h> #include <linux/seqlock.h> #include <linux/swap.h> diff --git a/fs/dcookies.c b/fs/dcookies.c index a26a701ef512..0d0461cf2431 100644 --- a/fs/dcookies.c +++ b/fs/dcookies.c @@ -26,7 +26,7 @@ #include <linux/mutex.h> #include <linux/path.h> #include <linux/compat.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> /* The dcookies are allocated from a kmem_cache and * hashed onto a small number of lists. None of the diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index b670f5601fbb..748e8d59e611 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h @@ -38,7 +38,7 @@ #include <linux/mutex.h> #include <linux/idr.h> #include <linux/ratelimit.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/dlm.h> #include "config.h" diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 35502d4046f5..6df332296c66 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -1395,7 +1395,6 @@ static int nodeid_warned(int nodeid, int num_nodes, int *warned) void dlm_scan_waiters(struct dlm_ls *ls) { struct dlm_lkb *lkb; - ktime_t zero = ktime_set(0, 0); s64 us; s64 debug_maxus = 0; u32 debug_scanned = 0; @@ -1409,7 +1408,7 @@ void dlm_scan_waiters(struct dlm_ls *ls) mutex_lock(&ls->ls_waiters_mutex); list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) { - if (ktime_equal(lkb->lkb_wait_time, zero)) + if (!lkb->lkb_wait_time) continue; debug_scanned++; @@ -1419,7 +1418,7 @@ void dlm_scan_waiters(struct dlm_ls *ls) if (us < dlm_config.ci_waitwarn_us) continue; - lkb->lkb_wait_time = zero; + lkb->lkb_wait_time = 0; debug_expired++; if (us > debug_maxus) diff --git a/fs/efs/efs.h b/fs/efs/efs.h index 5bbf9612140c..70f5d4f9a945 100644 --- a/fs/efs/efs.h +++ b/fs/efs/efs.h @@ -14,7 +14,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/fs.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #define EFS_VERSION "1.0a" diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 10db91218933..bcb68fcc8445 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -34,7 +34,7 @@ #include <linux/mutex.h> #include <linux/anon_inodes.h> #include <linux/device.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/io.h> #include <asm/mman.h> #include <linux/atomic.h> diff --git a/fs/exec.c b/fs/exec.c index eadbf5069c38..e57946610733 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -58,7 +58,7 @@ #include <linux/compat.h> #include <linux/vmalloc.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/mmu_context.h> #include <asm/tlb.h> diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index 9d617423e936..191e02b28ce8 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c @@ -14,7 +14,7 @@ #include <linux/compat.h> #include <linux/mount.h> #include <asm/current.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 6cb042b53b5b..9e25a71fe1a2 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -31,7 +31,7 @@ #include <linux/mount.h> #include <linux/log2.h> #include <linux/quotaops.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "ext2.h" #include "xattr.h" #include "acl.h" diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index b1f8416923ab..3e295d3350a9 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -37,7 +37,7 @@ #include <linux/quotaops.h> #include <linux/string.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/fiemap.h> #include <linux/backing-dev.h> #include "ext4_jbd2.h" diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 49fd1371bfa2..d534399cf607 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -15,7 +15,7 @@ #include <linux/file.h> #include <linux/quotaops.h> #include <linux/uuid.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "ext4_jbd2.h" #include "ext4.h" diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 63a6b6332682..66845a08a87a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -38,7 +38,7 @@ #include <linux/log2.h> #include <linux/crc16.h> #include <linux/cleancache.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/kthread.h> #include <linux/freezer.h> diff --git a/fs/fcntl.c b/fs/fcntl.c index 6e2771c210f6..e1c54f20325c 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -25,7 +25,7 @@ #include <asm/poll.h> #include <asm/siginfo.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME) diff --git a/fs/fhandle.c b/fs/fhandle.c index ca3c3dd01789..5559168d5637 100644 --- a/fs/fhandle.c +++ b/fs/fhandle.c @@ -8,7 +8,7 @@ #include <linux/fs_struct.h> #include <linux/fsnotify.h> #include <linux/personality.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" #include "mount.h" diff --git a/fs/filesystems.c b/fs/filesystems.c index c5618db110be..cac75547d35c 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -14,7 +14,7 @@ #include <linux/init.h> #include <linux/module.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> /* * Handling of filesystem drivers list. diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index e23ff70b3435..016c11eaca7c 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -22,7 +22,7 @@ #include <linux/swap.h> #include <linux/crc32.h> #include <linux/writeback.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/dlm.h> #include <linux/dlm_plock.h> #include <linux/delay.h> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 14cbf60167a7..94f50cac91c6 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -21,7 +21,7 @@ #include <linux/list.h> #include <linux/wait.h> #include <linux/module.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/seq_file.h> #include <linux/debugfs.h> #include <linux/kthread.h> @@ -695,7 +695,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, gl->gl_target = LM_ST_UNLOCKED; gl->gl_demote_state = LM_ST_EXCLUSIVE; gl->gl_ops = glops; - gl->gl_dstamp = ktime_set(0, 0); + gl->gl_dstamp = 0; preempt_disable(); /* We use the global stats to estimate the initial per-glock stats */ gl->gl_stats = this_cpu_ptr(sdp->sd_lkstats)->lkstats[glops->go_type]; diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 6cd9f84967b8..eb7724b8578a 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -19,7 +19,7 @@ #include <linux/crc32.h> #include <linux/fiemap.h> #include <linux/security.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "gfs2.h" #include "incore.h" diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index c9ff1cf7d4f3..f8d30e41d1d3 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c @@ -15,7 +15,7 @@ #include <linux/buffer_head.h> #include <linux/module.h> #include <linux/kobject.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/gfs2_ondisk.h> #include <linux/genhd.h> diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index aee4485ad8a9..763d659db91b 100644 --- a/fs/gfs2/util.c +++ b/fs/gfs2/util.c @@ -14,7 +14,7 @@ #include <linux/buffer_head.h> #include <linux/crc32.h> #include <linux/gfs2_ondisk.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "gfs2.h" #include "incore.h" diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index a4a577088d19..d87721aeb575 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -14,7 +14,7 @@ #include <linux/xattr.h> #include <linux/gfs2_ondisk.h> #include <linux/posix_acl_xattr.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "gfs2.h" #include "incore.h" diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index 4cdec5a19347..6d0783e2e276 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h @@ -23,7 +23,7 @@ #include <linux/workqueue.h> #include <asm/byteorder.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "hfs.h" diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index 99627f8a0a18..0a156d84e67d 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c @@ -16,7 +16,7 @@ #include <linux/fs.h> #include <linux/mount.h> #include <linux/sched.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "hfsplus_fs.h" /* diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 4fb7b10f3a05..54de77e78775 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -37,7 +37,7 @@ #include <linux/migrate.h> #include <linux/uio.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> static const struct super_operations hugetlbfs_ops; static const struct address_space_operations hugetlbfs_aops; diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 8ed971eeab44..a097048ed1a3 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -47,7 +47,7 @@ #define CREATE_TRACE_POINTS #include <trace/events/jbd2.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/page.h> #ifdef CONFIG_JBD2_DEBUG diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index b6fd1ff29ddf..fc89f9436784 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c @@ -13,7 +13,7 @@ #include <linux/sched.h> #include <linux/blkdev.h> #include <asm/current.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "jfs_filsys.h" #include "jfs_debug.h" diff --git a/fs/jfs/jfs_debug.c b/fs/jfs/jfs_debug.c index a37eb5f8cbc0..a70907606025 100644 --- a/fs/jfs/jfs_debug.c +++ b/fs/jfs/jfs_debug.c @@ -22,7 +22,7 @@ #include <linux/module.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "jfs_incore.h" #include "jfs_filsys.h" #include "jfs_debug.h" diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 85671f7f8518..2be7c9ce6663 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -31,7 +31,7 @@ #include <linux/exportfs.h> #include <linux/crc32.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/seq_file.h> #include <linux/blkdev.h> diff --git a/fs/libfs.c b/fs/libfs.c index 6637aa60c1da..e973cd51f126 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -16,7 +16,7 @@ #include <linux/writeback.h> #include <linux/buffer_head.h> /* sync_mapping_buffers */ -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" diff --git a/fs/locks.c b/fs/locks.c index 22c5b4aa4961..26811321d39b 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -131,7 +131,7 @@ #define CREATE_TRACE_POINTS #include <trace/events/filelock.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #define IS_POSIX(fl) (fl->fl_flags & FL_POSIX) #define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) diff --git a/fs/namei.c b/fs/namei.c index d9fc7617b9e4..ad74877e1442 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -37,7 +37,7 @@ #include <linux/hash.h> #include <linux/bitops.h> #include <linux/init_task.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" #include "mount.h" diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index 6df2a3827574..088f52484d6e 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c @@ -18,7 +18,7 @@ #include <linux/vmalloc.h> #include <linux/mm.h> #include <linux/namei.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/byteorder.h> #include "ncp_fs.h" diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 83ca77231707..76965e772264 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c @@ -8,7 +8,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/time.h> #include <linux/kernel.h> diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index ba611bf1aff3..7eb89c23c847 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -13,7 +13,7 @@ #include <linux/module.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/byteorder.h> #include <linux/time.h> diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 0a3f9b594602..4434e4977cf3 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c @@ -20,7 +20,7 @@ #include <linux/vmalloc.h> #include <linux/sched.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "ncp_fs.h" diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c index 33b873b259a8..39f57bef8531 100644 --- a/fs/ncpfs/mmap.c +++ b/fs/ncpfs/mmap.c @@ -18,7 +18,7 @@ #include <linux/fcntl.h> #include <linux/memcontrol.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "ncp_fs.h" diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h index 17cfb743b5bf..b4c87cfcee95 100644 --- a/fs/ncpfs/ncplib_kernel.h +++ b/fs/ncpfs/ncplib_kernel.h @@ -21,7 +21,7 @@ #include <linux/fcntl.h> #include <linux/pagemap.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/byteorder.h> #include <asm/unaligned.h> #include <asm/string.h> diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c index 471bc3d1139e..f32f272ee501 100644 --- a/fs/ncpfs/sock.c +++ b/fs/ncpfs/sock.c @@ -16,7 +16,7 @@ #include <linux/fcntl.h> #include <linux/stat.h> #include <linux/string.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/in.h> #include <linux/net.h> #include <linux/mm.h> diff --git a/fs/ncpfs/symlink.c b/fs/ncpfs/symlink.c index 421b6f91e8ec..a6d26b46fc05 100644 --- a/fs/ncpfs/symlink.c +++ b/fs/ncpfs/symlink.c @@ -21,7 +21,7 @@ */ -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index be88bcdca692..aab32fc3d6a8 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -52,7 +52,7 @@ #include <linux/nfs_page.h> #include <linux/sunrpc/clnt.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/atomic.h> #include "internal.h" diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 157cb43ce9db..26dbe8b0c10d 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -29,7 +29,7 @@ #include <linux/gfp.h> #include <linux/swap.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "delegation.h" #include "internal.h" diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 45962fe5098c..0ca4af8cca5d 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -619,12 +619,11 @@ nfs4_ff_layoutstat_start_io(struct nfs4_ff_layout_mirror *mirror, struct nfs4_ff_layoutstat *layoutstat, ktime_t now) { - static const ktime_t notime = {0}; s64 report_interval = FF_LAYOUTSTATS_REPORT_INTERVAL; struct nfs4_flexfile_layout *ffl = FF_LAYOUT_FROM_HDR(mirror->layout); nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now); - if (ktime_equal(mirror->start_time, notime)) + if (!mirror->start_time) mirror->start_time = now; if (mirror->report_interval != 0) report_interval = (s64)mirror->report_interval * 1000LL; diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c index a608ffd28acc..391dafaf9182 100644 --- a/fs/nfs/getroot.c +++ b/fs/nfs/getroot.c @@ -30,7 +30,7 @@ #include <linux/namei.h> #include <linux/security.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 011e4f8c1e01..5ca4d96b1942 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -39,7 +39,7 @@ #include <linux/compat.h> #include <linux/freezer.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "nfs4_fs.h" #include "callback.h" diff --git a/fs/nfs/super.c b/fs/nfs/super.c index ddce94ce8142..6bca17883b93 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -55,7 +55,7 @@ #include <linux/nsproxy.h> #include <linux/rcupdate.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "nfs4_fs.h" #include "callback.h" diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 6e761f3f4cbf..b00d53d13d47 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -24,7 +24,7 @@ #include <linux/freezer.h> #include <linux/wait.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "delegation.h" #include "internal.h" diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c index c16bf5af6831..34c1c449fddf 100644 --- a/fs/nfsd/fault_inject.c +++ b/fs/nfsd/fault_inject.c @@ -10,7 +10,7 @@ #include <linux/module.h> #include <linux/nsproxy.h> #include <linux/sunrpc/addr.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "state.h" #include "netns.h" diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 7a21abe7caf7..26c6fdb4bf67 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -26,7 +26,7 @@ #include <linux/jhash.h> #include <linux/ima.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/exportfs.h> #include <linux/writeback.h> #include <linux/security.h> diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 99510d811a8c..358ed7e1195a 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -30,7 +30,7 @@ #include <linux/writeback.h> #include <asm/page.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "attrib.h" #include "bitmap.h" diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 96a155ab5059..f6e871760f8d 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -1250,7 +1250,7 @@ static int o2hb_thread(void *data) mlog(ML_HEARTBEAT, "start = %lld, end = %lld, msec = %u, ret = %d\n", - before_hb.tv64, after_hb.tv64, elapsed_msec, ret); + before_hb, after_hb, elapsed_msec, ret); if (!kthread_should_stop() && elapsed_msec < reg->hr_timeout_ms) { diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c index dfe162f5fd4c..d331c2386b94 100644 --- a/fs/ocfs2/cluster/masklog.c +++ b/fs/ocfs2/cluster/masklog.c @@ -24,7 +24,7 @@ #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/string.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "masklog.h" diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 8abab16b4602..d4b5c81f0445 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c @@ -62,7 +62,7 @@ #include <linux/export.h> #include <net/tcp.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "heartbeat.h" #include "tcp.h" diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index 1079fae5aa12..9ab9e1892b5f 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -45,7 +45,7 @@ #include <linux/backing-dev.h> #include <linux/poll.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "stackglue.h" #include "userdlm.h" diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index c9e828ec3c8e..dae9eb7c441e 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -24,7 +24,7 @@ #include <linux/slab.h> #include <linux/reboot.h> #include <linux/sched.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "stackglue.h" diff --git a/fs/open.c b/fs/open.c index d3ed8171e8e0..9921f70bc5ca 100644 --- a/fs/open.c +++ b/fs/open.c @@ -19,7 +19,7 @@ #include <linux/mount.h> #include <linux/fcntl.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/fs.h> #include <linux/personality.h> #include <linux/pagemap.h> diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index c003a667ed1a..13215f26e321 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -16,7 +16,7 @@ #include <asm/openprom.h> #include <asm/oplib.h> #include <asm/prom.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> static DEFINE_MUTEX(op_mutex); diff --git a/fs/pipe.c b/fs/pipe.c index 8e0d9f26dfad..73b84baf58f8 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -23,7 +23,7 @@ #include <linux/fcntl.h> #include <linux/memcontrol.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/ioctls.h> #include "internal.h" diff --git a/fs/proc/base.c b/fs/proc/base.c index 5ea836362870..8e7e61b28f31 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -47,7 +47,7 @@ * Overall revision about smaps. */ -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/errno.h> #include <linux/time.h> diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 7eb3cefcf2a3..f6a01f09f79d 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -22,7 +22,7 @@ #include <linux/bitops.h> #include <linux/spinlock.h> #include <linux/completion.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 873300164dc6..842a5ff5b85c 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -24,7 +24,7 @@ #include <linux/mount.h> #include <linux/magic.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 5c89a07e3d7f..0b80ad87b4d6 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -23,7 +23,7 @@ #include <linux/bootmem.h> #include <linux/init.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/io.h> #include <linux/list.h> #include <linux/ioport.h> diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c index 05f8dcdb086e..f9387bb7631b 100644 --- a/fs/proc/kmsg.c +++ b/fs/proc/kmsg.c @@ -14,7 +14,7 @@ #include <linux/fs.h> #include <linux/syslog.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/io.h> extern wait_queue_head_t log_wait; diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c index f8595e8b5cd0..75634379f82e 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c @@ -25,7 +25,7 @@ #include <linux/seq_file.h> #include <linux/hugetlb.h> #include <linux/vmalloc.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/pgtable.h> #include <asm/tlb.h> #include <asm/div64.h> diff --git a/fs/proc/page.c b/fs/proc/page.c index 3ecd445e830d..a2066e6dee90 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -13,7 +13,7 @@ #include <linux/mmu_notifier.h> #include <linux/page_idle.h> #include <linux/kernel-page-flags.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" #define KPMSIZE sizeof(u64) diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 7ae6b1da7cab..ffd72a6c6e04 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -8,7 +8,7 @@ * proc net directory handling functions */ -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/errno.h> #include <linux/time.h> diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c index 15f327bed8c6..901bd06f437d 100644 --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c @@ -4,7 +4,7 @@ * Copyright 1997, Theodore Ts'o */ -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/module.h> #include <linux/init.h> #include <linux/errno.h> diff --git a/fs/proc/root.c b/fs/proc/root.c index 4bd0373576b5..1988440b2049 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -6,7 +6,7 @@ * proc root directory handling functions */ -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/errno.h> #include <linux/time.h> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 958f32545064..8f96a49178d0 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -17,7 +17,7 @@ #include <linux/shmem_fs.h> #include <asm/elf.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/tlbflush.h> #include "internal.h" diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 8ab782d8b33d..5105b1599981 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -22,7 +22,7 @@ #include <linux/list.h> #include <linux/vmalloc.h> #include <linux/pagemap.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/io.h> #include "internal.h" diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 2bcbf4e77982..2ef7ce75c062 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c @@ -23,7 +23,7 @@ #include <linux/sched.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" static int ramfs_nommu_setattr(struct dentry *, struct iattr *); diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index 8621c039b536..26e45863e499 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -35,7 +35,7 @@ #include <linux/parser.h> #include <linux/magic.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" #define RAMFS_DEFAULT_MODE 0755 diff --git a/fs/read_write.c b/fs/read_write.c index 7537b6b6b5a2..5816d4c4cab0 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -20,7 +20,7 @@ #include <linux/fs.h> #include "internal.h" -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/unistd.h> typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *); diff --git a/fs/readdir.c b/fs/readdir.c index 9d0212c374d6..0e8a7f355f7a 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -19,7 +19,7 @@ #include <linux/syscalls.h> #include <linux/unistd.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> int iterate_dir(struct file *file, struct dir_context *ctx) { diff --git a/fs/select.c b/fs/select.c index 3d4f85defeab..305c0daf5d67 100644 --- a/fs/select.c +++ b/fs/select.c @@ -31,7 +31,7 @@ #include <net/busy_poll.h> #include <linux/vmalloc.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> /* diff --git a/fs/seq_file.c b/fs/seq_file.c index a11f271800ef..ca69fb99e41a 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -15,7 +15,7 @@ #include <linux/printk.h> #include <linux/string_helpers.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/page.h> static void seq_set_overflow(struct seq_file *m) diff --git a/fs/stat.c b/fs/stat.c index 0b210c3ead5c..a268b7f27adf 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -15,7 +15,7 @@ #include <linux/syscalls.h> #include <linux/pagemap.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/unistd.h> void generic_fillattr(struct inode *inode, struct kstat *stat) diff --git a/fs/timerfd.c b/fs/timerfd.c index 9ae4abb4110b..c173cc196175 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -55,7 +55,7 @@ static inline bool isalarm(struct timerfd_ctx *ctx) /* * This gets called when the timer event triggers. We set the "expired" * flag, but we do not re-arm the timer (in case it's necessary, - * tintv.tv64 != 0) until the timer is accessed. + * tintv != 0) until the timer is accessed. */ static void timerfd_triggered(struct timerfd_ctx *ctx) { @@ -93,7 +93,7 @@ static enum alarmtimer_restart timerfd_alarmproc(struct alarm *alarm, */ void timerfd_clock_was_set(void) { - ktime_t moffs = ktime_mono_to_real((ktime_t){ .tv64 = 0 }); + ktime_t moffs = ktime_mono_to_real(0); struct timerfd_ctx *ctx; unsigned long flags; @@ -102,8 +102,8 @@ void timerfd_clock_was_set(void) if (!ctx->might_cancel) continue; spin_lock_irqsave(&ctx->wqh.lock, flags); - if (ctx->moffs.tv64 != moffs.tv64) { - ctx->moffs.tv64 = KTIME_MAX; + if (ctx->moffs != moffs) { + ctx->moffs = KTIME_MAX; ctx->ticks++; wake_up_locked(&ctx->wqh); } @@ -124,9 +124,9 @@ static void timerfd_remove_cancel(struct timerfd_ctx *ctx) static bool timerfd_canceled(struct timerfd_ctx *ctx) { - if (!ctx->might_cancel || ctx->moffs.tv64 != KTIME_MAX) + if (!ctx->might_cancel || ctx->moffs != KTIME_MAX) return false; - ctx->moffs = ktime_mono_to_real((ktime_t){ .tv64 = 0 }); + ctx->moffs = ktime_mono_to_real(0); return true; } @@ -155,7 +155,7 @@ static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx) else remaining = hrtimer_expires_remaining_adjusted(&ctx->t.tmr); - return remaining.tv64 < 0 ? ktime_set(0, 0): remaining; + return remaining < 0 ? 0: remaining; } static int timerfd_setup(struct timerfd_ctx *ctx, int flags, @@ -184,7 +184,7 @@ static int timerfd_setup(struct timerfd_ctx *ctx, int flags, ctx->t.tmr.function = timerfd_tmrproc; } - if (texp.tv64 != 0) { + if (texp != 0) { if (isalarm(ctx)) { if (flags & TFD_TIMER_ABSTIME) alarm_start(&ctx->t.alarm, texp); @@ -261,9 +261,9 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, if (ctx->ticks) { ticks = ctx->ticks; - if (ctx->expired && ctx->tintv.tv64) { + if (ctx->expired && ctx->tintv) { /* - * If tintv.tv64 != 0, this is a periodic timer that + * If tintv != 0, this is a periodic timer that * needs to be re-armed. We avoid doing it in the timer * callback to avoid DoS attacks specifying a very * short timer period. @@ -410,7 +410,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) else hrtimer_init(&ctx->t.tmr, clockid, HRTIMER_MODE_ABS); - ctx->moffs = ktime_mono_to_real((ktime_t){ .tv64 = 0 }); + ctx->moffs = ktime_mono_to_real(0); ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS)); @@ -469,7 +469,7 @@ static int do_timerfd_settime(int ufd, int flags, * We do not update "ticks" and "expired" since the timer will be * re-programmed again in the following timerfd_setup() call. */ - if (ctx->expired && ctx->tintv.tv64) { + if (ctx->expired && ctx->tintv) { if (isalarm(ctx)) alarm_forward_now(&ctx->t.alarm, ctx->tintv); else @@ -499,7 +499,7 @@ static int do_timerfd_gettime(int ufd, struct itimerspec *t) ctx = f.file->private_data; spin_lock_irq(&ctx->wqh.lock); - if (ctx->expired && ctx->tintv.tv64) { + if (ctx->expired && ctx->tintv) { ctx->expired = 0; if (isalarm(ctx)) { diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 1bc0bd6a9848..7e41aee7b69a 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -25,7 +25,7 @@ * David S. Miller (davem@caip.rutgers.edu), 1995 */ -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/ufs/super.c b/fs/ufs/super.c index f04ab232d08d..131b2b77c818 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -71,7 +71,7 @@ #include <stdarg.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/utimes.c b/fs/utimes.c index 5fdb505e307c..32b15b3f6629 100644 --- a/fs/utimes.c +++ b/fs/utimes.c @@ -8,7 +8,7 @@ #include <linux/stat.h> #include <linux/utime.h> #include <linux/syscalls.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/unistd.h> #ifdef __ARCH_WANT_SYS_UTIME diff --git a/fs/xattr.c b/fs/xattr.c index 2d13b4e62fae..7e3317cf4045 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -22,7 +22,7 @@ #include <linux/vmalloc.h> #include <linux/posix_acl_xattr.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> static const char * strcmp_prefix(const char *a, const char *a_prefix) diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index 321f57721b92..7c49938c5aed 100644 --- a/fs/xfs/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c @@ -19,7 +19,7 @@ #include <linux/ioctl.h> #include <linux/mount.h> #include <linux/slab.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index a415f822f2c1..e467218c0098 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -83,7 +83,7 @@ typedef __u32 xfs_nlink_t; #include <asm/page.h> #include <asm/div64.h> #include <asm/param.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <asm/byteorder.h> #include <asm/unaligned.h> |