vfs: remove unnecessary fl_owner_t typedef
Subsystems (24)
PATCH 1/1 vfs: remove unnecessary fl_owner_t typedef
This is a pretty simple patch that touches a lot of files. What's the procedure for handling patches like this? I haven't had to do this before.
--b.
commit 4e446db46b83
Author: J. Bruce Fields <[email protected]> Date: Thu Sep 7 17:45:21 2017 -0400
vfs: remove unnecessary fl_owner_t typedef
The convention is to avoid this kind of typedef. It doesn't seem useful, and it requires a lot of casts.
Documentation/filesystems/vfs.txt +1 -1
@@ -862,7 +862,7 @@ struct file_operations { int (*mmap) (struct file *, struct vm_area_struct *); int (*mremap)(struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); - int (*flush) (struct file *, fl_owner_t id); + int (*flush) (struct file *, void *id); int (*release) (struct inode *, struct file *); int (*fsync) (struct file *, loff_t, loff_t, int datasync); int (*fasync) (int, struct file *, int);
arch/ia64/kernel/perfmon.c +1 -1
@@ -1809,7 +1809,7 @@ pfm_syswide_cleanup_other_cpu(pfm_context_t *ctx)* When caller is self-monitoring, the context is unloaded. */ static int -pfm_flush (struct file *filp,fl_owner_t id) +pfm_flush (struct file *filp,void *id) {pfm_context_t *ctx;struct task_struct *task;
arch/powerpc/platforms/cell/spufs/file.c +1 -1
@@ -1720,7 +1720,7 @@ static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)return mask; } -static int spufs_mfc_flush (struct file *file,fl_owner_t id) +static int spufs_mfc_flush (struct file *file,void *id) {struct spu_context *ctx = file->private_data;int ret;
arch/tile/kernel/hardwall.c +1 -1
@@ -1030,7 +1030,7 @@ static long hardwall_compat_ioctl(struct file *file,#endif /* The user process closed the file; revoke access to user networks. */ -static int hardwall_flush (struct file *file,fl_owner_t owner) +static int hardwall_flush (struct file *file,void *owner) {struct hardwall_info *info = file->private_data;struct task_struct *task, *tmp;
drivers/android/binder.c +1 -1
@@ -4776,7 +4776,7 @@ static int binder_open(struct inode *nodp, struct file *filp)return 0 ; } -static int binder_flush (struct file *filp,fl_owner_t id) +static int binder_flush (struct file *filp,void *id) {struct binder_proc *proc = filp->private_data;
drivers/char/ps3flash.c +1 -1
@@ -281,7 +281,7 @@ static ssize_t ps3flash_kernel_write(const void *buf, size_t count,return res; } -static int ps3flash_flush (struct file *file,fl_owner_t id) +static int ps3flash_flush (struct file *file,void *id) {return ps3flash_writeback (ps3flash_dev); }
drivers/char/xillybus/xillybus_core.c +1 -1
@@ -1156,7 +1156,7 @@ static int xillybus_myflush(struct xilly_channel *channel, long timeout)return rc; } -static int xillybus_flush (struct file *filp,fl_owner_t id) +static int xillybus_flush (struct file *filp,void *id) {if (!(filp->f_mode &FMODE_WRITE ))return 0 ;
drivers/firmware/efi/capsule-loader.c +1 -1
@@ -246,7 +246,7 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,* will be treated as upload termination and will free those completed * buffer pages and -ECANCELED will be returned. **/ -static int efi_capsule_flush (struct file *file,fl_owner_t id) +static int efi_capsule_flush (struct file *file,void *id) {int ret =0 ;struct capsule_info *cap_info = file->private_data;
drivers/input/evdev.c +1 -1
@@ -348,7 +348,7 @@ static int evdev_fasync(int fd, struct file *file, int on)return fasync_helper (fd, file, on, &client->fasync); } -static int evdev_flush (struct file *file,fl_owner_t id) +static int evdev_flush (struct file *file,void *id) {struct evdev_client *client = file->private_data;struct evdev *evdev = client->evdev;
drivers/misc/mic/scif/scif_fd.c +1 -1
@@ -48,7 +48,7 @@ static __poll_t scif_fdpoll(struct file *f, poll_table *wait)return __scif_pollfd (f, wait, priv); } -static int scif_fdflush (struct file *f,fl_owner_t id) +static int scif_fdflush (struct file *f,void *id) {struct scif_endpt *ep = f->private_data;
drivers/scsi/osst.c +1 -1
@@ -4822,7 +4822,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)/* Flush the tape buffer before close */ -static int os_scsi_tape_flush (struct file * filp,fl_owner_t id) +static int os_scsi_tape_flush (struct file * filp,void *id) {int result =0 , result2;struct osst_tape * STp = filp->private_data;
drivers/scsi/st.c +1 -1
@@ -1338,7 +1338,7 @@ static int st_open(struct inode *inode, struct file *filp)/* Flush the tape buffer before close */ -static int st_flush (struct file *filp,fl_owner_t id) +static int st_flush (struct file *filp,void *id) {int result =0 , result2;
unsigned char cmd[MAX_COMMAND_SIZE];
drivers/staging/lustre/lustre/llite/file.c +1 -1
@@ -2281,7 +2281,7 @@ static loff_t ll_file_seek(struct file *file, loff_t offset, int origin) ll_file_maxbytes(inode), eof); } -static int ll_flush (struct file *file,fl_owner_t id) +static int ll_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct ll_inode_info *lli =ll_i2info (inode);
drivers/usb/class/cdc-wdm.c +1 -1
@@ -581,7 +581,7 @@ static ssize_t wdm_readreturn rv; } -static int wdm_flush (struct file *file,fl_owner_t id) +static int wdm_flush (struct file *file,void *id) {struct wdm_device *desc = file->private_data;
drivers/usb/usb-skeleton.c +1 -1
@@ -132,7 +132,7 @@ static int skel_release(struct inode *inode, struct file *file)return 0 ; } -static int skel_flush (struct file *file,fl_owner_t id) +static int skel_flush (struct file *file,void *id) {struct usb_skel *dev;int res;
fs/afs/internal.h +1 -1
@@ -947,7 +947,7 @@ extern int afs_writepage(struct page *, struct writeback_control *);extern int afs_writepages (struct address_space *,struct writeback_control *);extern void afs_pages_written_back (struct afs_vnode *,struct afs_call *);extern ssize_t afs_file_write (struct kiocb *,struct iov_iter *); -extern int afs_flush (struct file *,fl_owner_t ); +extern int afs_flush (struct file *,void *);extern int afs_fsync (struct file *,loff_t ,loff_t ,int );extern int afs_page_mkwrite (struct vm_fault *);extern void afs_prune_wb_keys (struct afs_vnode *);
fs/afs/write.c +1 -1
@@ -737,7 +737,7 @@ int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* Flush out all outstanding writes on a file opened for writing when it is * closed. */ -int afs_flush (struct file *file,fl_owner_t id) +int afs_flush (struct file *file,void *id) {_enter ("" );
fs/cifs/cifsfs.h +1 -1
@@ -108,7 +108,7 @@ extern ssize_t cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from);extern int cifs_lock (struct file *,int ,struct file_lock *);extern int cifs_fsync (struct file *,loff_t ,loff_t ,int );extern int cifs_strict_fsync (struct file *,loff_t ,loff_t ,int ); -extern int cifs_flush (struct file *,fl_owner_t id); +extern int cifs_flush (struct file *,void *id);extern int cifs_file_mmap (struct file * ,struct vm_area_struct *);extern int cifs_file_strict_mmap (struct file * ,struct vm_area_struct *);extern const struct file_operations cifs_dir_ops;
fs/cifs/file.c +2 -2
@@ -1174,7 +1174,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) }static __u32 -hash_lockowner (fl_owner_t owner) +hash_lockowner (void *owner) {return cifs_lock_secret ^hash32_ptr ((const void *)owner); }
@@ -2393,7 +2393,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* As file closes, flush all cached write data for this inode checking * for write behind errors. */ -int cifs_flush (struct file *file,fl_owner_t id) +int cifs_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);int rc =0 ;
fs/ecryptfs/file.c +1 -1
@@ -290,7 +290,7 @@ static int ecryptfs_dir_open(struct inode *inode, struct file *file)return 0 ; } -static int ecryptfs_flush (struct file *file,fl_owner_t td) +static int ecryptfs_flush (struct file *file,void *td) {struct file *lower_file =ecryptfs_file_to_lower (file);
fs/exofs/file.c +1 -1
@@ -58,7 +58,7 @@ static int exofs_file_fsync(struct file *filp, loff_t start, loff_t end,return ret; } -static int exofs_flush (struct file *file,fl_owner_t id) +static int exofs_flush (struct file *file,void *id) {int ret =vfs_fsync (file,0 );/* TODO: Flush the OSD target */
fs/fuse/file.c +6 -7
@@ -254,8 +254,7 @@ void fuse_release_common(struct file *file, int opcode)if (ff->flock) {struct fuse_release_in *inarg = &req->misc.release.in; inarg->release_flags |=FUSE_RELEASE_FLOCK_UNLOCK ; - inarg->lock_owner =fuse_lock_owner_id (ff->fc, - (fl_owner_t ) file); + inarg->lock_owner =fuse_lock_owner_id (ff->fc, file); }/* Hold inode until release is finished */ req->misc.release.inode =igrab (file_inode (file));
@@ -307,7 +306,7 @@ EXPORT_SYMBOL_GPL(fuse_sync_release);* Scramble the ID space with XTEA, so that the value of the files_struct * pointer is not exposed to userspace. */ -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id) +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id) {u32 *k = fc->scramble_key;u64 v = (unsigned long ) id;
@@ -390,7 +389,7 @@ static void fuse_sync_writes(struct inode *inode)fuse_release_nowrite (inode); } -static int fuse_flush (struct file *file,fl_owner_t id) +static int fuse_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct fuse_conn *fc =get_fuse_conn (inode);
@@ -643,7 +642,7 @@ static size_t fuse_async_req_send(struct fuse_conn *fc, struct fuse_req *req, }static size_t fuse_send_read (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct file *file = io->iocb->ki_filp;struct fuse_file *ff = file->private_data;
@@ -958,7 +957,7 @@ static void fuse_write_fill(struct fuse_req *req, struct fuse_file *ff, }static size_t fuse_send_write (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct kiocb *iocb = io->iocb;struct file *file = iocb->ki_filp;
@@ -1358,7 +1357,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter, io->should_dirty = !write &&iter_is_iovec (iter);while (count) {size_t nres; -fl_owner_t owner = current->files; +void *owner = current->files;size_t nbytes =min (count, nmax); err =fuse_get_user_pages (req, iter, &nbytes, write);if (err && !nbytes)
fs/fuse/fuse_i.h +1 -1
@@ -900,7 +900,7 @@ int fuse_valid_type(int m);*/ int fuse_allow_current_process (struct fuse_conn *fc); -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id); +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id);void fuse_update_ctime (struct inode *inode);
fs/lockd/clntproc.c +2 -2
@@ -81,7 +81,7 @@ static inline uint32_t __nlm_alloc_pid(struct nlm_host *host)return res; } -static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *lockowner;list_for_each_entry (lockowner, &host->h_lockowners, list) {
@@ -92,7 +92,7 @@ static struct nlm_lockowner *__nlm_find_lockowner(struct nlm_host *host, fl_ownereturn NULL ; } -static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *res, *new =NULL ;
fs/lockd/svc4proc.c +1 -1
@@ -46,7 +46,7 @@ nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }
fs/lockd/svcproc.c +1 -1
@@ -76,7 +76,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }
fs/locks.c +1 -1
@@ -2462,7 +2462,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,* from the task's fd array. POSIX locks belonging to this task * are deleted at this time. */ -void locks_remove_posix (struct file *filp,fl_owner_t owner) +void locks_remove_posix (struct file *filp,void *owner) {int error;struct inode *inode =locks_inode (filp);
fs/nfs/file.c +1 -1
@@ -136,7 +136,7 @@ EXPORT_SYMBOL_GPL(nfs_file_llseek);* Flush all dirty pages, and check for write errors. */ static int -nfs_file_flush (struct file *file,fl_owner_t id) +nfs_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);
fs/nfs/inode.c +1 -1
@@ -927,7 +927,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, ctx->mode = f_mode; ctx->flags =0 ; ctx->error =0 ; - ctx->flock_owner = (fl_owner_t )filp; + ctx->flock_owner = filp;nfs_init_lock_context (&ctx->lock_context); ctx->lock_context.open_context = ctx;INIT_LIST_HEAD (&ctx->list);
fs/nfs/nfs4_fs.h +1 -1
@@ -146,7 +146,7 @@ struct nfs4_lock_state {struct nfs_seqid_counter ls_seqid;nfs4_stateid ls_stateid;refcount_t ls_count; -fl_owner_t ls_owner; +void * ls_owner; };/* bits for nfs4_state->flags */
fs/nfs/nfs4file.c +1 -1
@@ -107,7 +107,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)* Flush all dirty pages, and check for write errors. */ static int -nfs4_file_flush (struct file *file,fl_owner_t id) +nfs4_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);
fs/nfs/nfs4state.c +4 -4
@@ -822,7 +822,7 @@ void nfs4_close_sync(struct nfs4_state *state, fmode_t fmode)*/ static struct nfs4_lock_state *__nfs4_find_lock_state (struct nfs4_state *state, -fl_owner_t fl_owner,fl_owner_t fl_owner2) +void *fl_owner,void *fl_owner2) {struct nfs4_lock_state *pos, *ret =NULL ;list_for_each_entry (pos, &state->lock_states, ls_locks) {
@@ -843,7 +843,7 @@ __nfs4_find_lock_state(struct nfs4_state *state,* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,fl_owner_t fl_owner) +static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,void *fl_owner) {struct nfs4_lock_state *lsp;struct nfs_server *server = state->owner->so_server;
@@ -877,7 +877,7 @@ void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,fl_owner_t owner) +static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,void *owner) {struct nfs4_lock_state *lsp, *new =NULL ;
@@ -968,7 +968,7 @@ static int nfs4_copy_lock_stateid(nfs4_stateid *dst, const struct nfs_lock_context *l_ctx) {struct nfs4_lock_state *lsp; -fl_owner_t fl_owner, fl_flock_owner; +void *fl_owner, *fl_flock_owner;int ret = -ENOENT ;if (l_ctx ==NULL )
fs/nfsd/nfs4state.c +9 -9
@@ -1204,7 +1204,7 @@ static void nfs4_free_lock_stateid(struct nfs4_stid *stid) file =find_any_file (stp->st_stid.sc_file);if (file) -filp_close (file, (fl_owner_t )lo); +filp_close (file, lo);nfs4_free_ol_stateid (stid); }
@@ -4268,7 +4268,7 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_file *fp, int flag) fl->fl_flags =FL_DELEG ; fl->fl_type = flag ==NFS4_OPEN_DELEGATE_READ ?F_RDLCK :F_WRLCK ; fl->fl_end =OFFSET_MAX ; - fl->fl_owner = (fl_owner_t )fp; + fl->fl_owner = fp; fl->fl_pid = current->tgid;return fl; }
@@ -5563,8 +5563,8 @@ nfs4_transform_lock_offset(struct file_lock *lock) lock->fl_end =OFFSET_MAX ; } -static fl_owner_t -nfsd4_fl_get_owner (fl_owner_t owner) +static void * +nfsd4_fl_get_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;
@@ -5573,7 +5573,7 @@ nfsd4_fl_get_owner(fl_owner_t owner) }static void -nfsd4_fl_put_owner (fl_owner_t owner) +nfsd4_fl_put_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;
@@ -6008,7 +6008,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, file_lock = &nbl->nbl_lock; file_lock->fl_type = fl_type; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags = fl_flags;
@@ -6162,7 +6162,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, lo =find_lockowner_str (cstate->clp, &lockt->lt_owner);if (lo) - file_lock->fl_owner = (fl_owner_t )lo; + file_lock->fl_owner = lo; file_lock->fl_pid = current->tgid; file_lock->fl_flags =FL_POSIX ;
@@ -6224,7 +6224,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, } file_lock->fl_type =F_UNLCK ; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (stp->st_stateowner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (stp->st_stateowner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags =FL_POSIX ;
@@ -6283,7 +6283,7 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)if (flctx && !list_empty_careful (&flctx->flc_posix)) {spin_lock (&flctx->flc_lock);list_for_each_entry (fl, &flctx->flc_posix, fl_list) { -if (fl->fl_owner == (fl_owner_t )lowner) { +if (fl->fl_owner == lowner) { status = true;break ; }
fs/notify/dnotify/dnotify.c +3 -3
@@ -145,7 +145,7 @@ static const struct fsnotify_ops dnotify_fsnotify_ops = {* dnotify_struct. If that was the last dnotify_struct also remove the * fsnotify_mark. */ -void dnotify_flush (struct file *filp,fl_owner_t id) +void dnotify_flush (struct file *filp,void *id) {struct fsnotify_mark *fsn_mark;struct dnotify_mark *dn_mark;
@@ -223,7 +223,7 @@ static __u32 convert_arg(unsigned long arg)* that list, or it |= the mask onto an existing dnofiy_struct. */ static int attach_dn (struct dnotify_struct *dn,struct dnotify_mark *dn_mark, -fl_owner_t id,int fd,struct file *filp,__u32 mask) +void *id,int fd,struct file *filp,__u32 mask) {struct dnotify_struct *odn;
@@ -259,7 +259,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)struct fsnotify_mark *new_fsn_mark, *fsn_mark;struct dnotify_struct *dn;struct inode *inode; -fl_owner_t id = current->files; +void *id = current->files;struct file *f;int destroy =0 , error =0 ;__u32 mask;
fs/open.c +1 -1
@@ -1123,7 +1123,7 @@ SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)* "id" is the POSIX thread ID. We use the * files pointer for this.. */ -int filp_close (struct file *filp,fl_owner_t id) +int filp_close (struct file *filp,void *id) {int retval =0 ;
include/linux/dnotify.h +3 -3
@@ -14,7 +14,7 @@ struct dnotify_struct {__u32 dn_mask;int dn_fd;struct file * dn_filp; -fl_owner_t dn_owner; +void * dn_owner; };#ifdef __KERNEL__
@@ -30,12 +30,12 @@ struct dnotify_struct { FS_MOVED_FROM | FS_MOVED_TO)extern int dir_notify_enable; -extern void dnotify_flush (struct file *,fl_owner_t ); +extern void dnotify_flush (struct file *,void *);extern int fcntl_dirnotify (int ,struct file *,unsigned long );#else -static inline void dnotify_flush (struct file *filp,fl_owner_t id) +static inline void dnotify_flush (struct file *filp,void *id) { }
include/linux/fs.h +7 -10
@@ -942,9 +942,6 @@ static inline struct file *get_file(struct file *f)*/ #define FILE_LOCK_DEFERRED 1 -/* legacy typedef, should eventually be removed */ -typedef void *fl_owner_t ; -struct file_lock ;struct file_lock_operations {
@@ -955,8 +952,8 @@ struct file_lock_operations {struct lock_manager_operations {int (*lm_compare_owner)(struct file_lock *,struct file_lock *);unsigned long (*lm_owner_key)(struct file_lock *); -fl_owner_t (*lm_get_owner)(fl_owner_t ); -void (*lm_put_owner)(fl_owner_t ); +void *(*lm_get_owner)(void *); +void (*lm_put_owner)(void *);void (*lm_notify)(struct file_lock *);/* unblock callback */ int (*lm_grant)(struct file_lock *,int );bool (*lm_break)(struct file_lock *);
@@ -1004,7 +1001,7 @@ struct file_lock {struct list_head fl_list;/* link into file_lock_context */ struct hlist_node fl_link;/* node in global lists */ struct list_head fl_block;/* circular list of blocked processes */ -fl_owner_t fl_owner; +void *fl_owner;unsigned int fl_flags;unsigned char fl_type;unsigned int fl_pid;
@@ -1080,7 +1077,7 @@ extern void locks_init_lock(struct file_lock *);extern struct file_lock *locks_alloc_lock (void );extern void locks_copy_lock (struct file_lock *,struct file_lock *);extern void locks_copy_conflock (struct file_lock *,struct file_lock *); -extern void locks_remove_posix (struct file *,fl_owner_t ); +extern void locks_remove_posix (struct file *,void *);extern void locks_remove_file (struct file *);extern void locks_release_private (struct file_lock *);extern void posix_test_lock (struct file *,struct file_lock *);
@@ -1154,7 +1151,7 @@ static inline void locks_copy_lock(struct file_lock *new, struct file_lock *fl)return ; } -static inline void locks_remove_posix (struct file *filp,fl_owner_t owner) +static inline void locks_remove_posix (struct file *filp,void *owner) {return ; }
@@ -1713,7 +1710,7 @@ struct file_operations {int (*mmap) (struct file *,struct vm_area_struct *);unsigned long mmap_supported_flags;int (*open) (struct inode *,struct file *); -int (*flush) (struct file *,fl_owner_t id); +int (*flush) (struct file *,void *id);int (*release) (struct inode *,struct file *);int (*fsync) (struct file *,loff_t ,loff_t ,int datasync);int (*fasync) (int ,struct file *,int );
@@ -2397,7 +2394,7 @@ extern struct file *filp_open(const char *, int, umode_t);extern struct file *file_open_root (struct dentry *,struct vfsmount *,const char *,int ,umode_t );extern struct file *dentry_open (const struct path *,int ,const struct cred *); -extern int filp_close (struct file *,fl_owner_t id); +extern int filp_close (struct file *,void *id);extern struct filename *getname_flags (const char __user *,int ,int *);extern struct filename *getname (const char __user *);
include/linux/lockd/lockd.h +2 -2
@@ -119,14 +119,14 @@ static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host) }/* -* Map an fl_owner_t into a unique 32-bit "pid" +* Map a lock owner into a unique 32-bit "pid" */ struct nlm_lockowner {struct list_head list;refcount_t count;struct nlm_host *host; -fl_owner_t owner; +void *owner;uint32_t pid; };
include/linux/nfs_fs.h +2 -2
@@ -60,14 +60,14 @@ struct nfs_lock_context {refcount_t count;struct list_head list;struct nfs_open_context *open_context; -fl_owner_t lockowner; +void *lockowner;atomic_t io_count; };struct nfs4_state ;struct nfs_open_context {struct nfs_lock_context lock_context; -fl_owner_t flock_owner; +void *flock_owner;struct dentry *dentry;struct rpc_cred *cred;struct nfs4_state *state;
include/trace/events/filelock.h +3 -3
@@ -69,7 +69,7 @@ DECLARE_EVENT_CLASS(filelock_lock, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_pid) __field(unsigned int, fl_flags) __field(unsigned char, fl_type)
@@ -123,7 +123,7 @@ DECLARE_EVENT_CLASS(filelock_lease, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) __field(unsigned long, fl_break_time)
@@ -176,7 +176,7 @@ TRACE_EVENT(generic_add_lease, __field(int, dcount) __field(int, icount) __field(dev_t, s_dev) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) ),
ipc/mqueue.c +1 -1
@@ -557,7 +557,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,return ret; } -static int mqueue_flush_file (struct file *filp,fl_owner_t id) +static int mqueue_flush_file (struct file *filp,void *id) {struct mqueue_inode_info *info =MQUEUE_I (file_inode (filp));
Quoted 824 lines · J. Bruce Fields
This is a pretty simple patch that touches a lot of files. What's the procedure for handling patches like this? I haven't had to do this before.
--b.
commit
4e446db46b83Author: J. Bruce Fields <[email protected]> Date: Thu Sep 7 17:45:21 2017 -0400vfs: remove unnecessary
fl_owner_ttypedefThe convention is to avoid this kind of typedef. It doesn't seem useful, and it requires a lot of casts.
Reviewed-by NeilBrown <[email protected]>Signed-off-by J. Bruce Fields <[email protected]>Documentation/filesystems/vfs.txt +1
-1@@ -862,7 +862,7 @@ struct file_operations { int (*mmap) (struct file *, struct vm_area_struct *); int (*mremap)(struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); - int (*flush) (struct file *, fl_owner_t id); + int (*flush) (struct file *, void *id); int (*release) (struct inode *, struct file *); int (*fsync) (struct file *, loff_t, loff_t, int datasync); int (*fasync) (int, struct file *, int);arch/ia64/kernel/perfmon.c +1
-1@@ -1809,7 +1809,7 @@ pfm_syswide_cleanup_other_cpu(pfm_context_t *ctx)* When caller is self-monitoring, the context is unloaded. */ static int -pfm_flush (struct file *filp,fl_owner_t id) +pfm_flush (struct file *filp,void *id) {pfm_context_t *ctx;struct task_struct *task;arch/powerpc/platforms/cell/spufs/file.c +1
-1@@ -1720,7 +1720,7 @@ static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)return mask; } -static int spufs_mfc_flush (struct file *file,fl_owner_t id) +static int spufs_mfc_flush (struct file *file,void *id) {struct spu_context *ctx = file->private_data;int ret;arch/tile/kernel/hardwall.c +1
-1@@ -1030,7 +1030,7 @@ static long hardwall_compat_ioctl(struct file *file,#endif /* The user process closed the file; revoke access to user networks. */ -static int hardwall_flush (struct file *file,fl_owner_t owner) +static int hardwall_flush (struct file *file,void *owner) {struct hardwall_info *info = file->private_data;struct task_struct *task, *tmp;drivers/android/binder.c +1
-1@@ -4776,7 +4776,7 @@ static int binder_open(struct inode *nodp, struct file *filp)return 0 ; } -static int binder_flush (struct file *filp,fl_owner_t id) +static int binder_flush (struct file *filp,void *id) {struct binder_proc *proc = filp->private_data;drivers/char/ps3flash.c +1
-1@@ -281,7 +281,7 @@ static ssize_t ps3flash_kernel_write(const void *buf, size_t count,return res; } -static int ps3flash_flush (struct file *file,fl_owner_t id) +static int ps3flash_flush (struct file *file,void *id) {return ps3flash_writeback (ps3flash_dev); }drivers/char/xillybus/xillybus_core.c +1
-1@@ -1156,7 +1156,7 @@ static int xillybus_myflush(struct xilly_channel *channel, long timeout)return rc; } -static int xillybus_flush (struct file *filp,fl_owner_t id) +static int xillybus_flush (struct file *filp,void *id) {if (!(filp->f_mode &FMODE_WRITE ))return 0 ;drivers/firmware/efi/capsule-loader.c +1
-1@@ -246,7 +246,7 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,* will be treated as upload termination and will free those completed * buffer pages and -ECANCELED will be returned. **/ -static int efi_capsule_flush (struct file *file,fl_owner_t id) +static int efi_capsule_flush (struct file *file,void *id) {int ret =0 ;struct capsule_info *cap_info = file->private_data;drivers/input/evdev.c +1
-1@@ -348,7 +348,7 @@ static int evdev_fasync(int fd, struct file *file, int on)return fasync_helper (fd, file, on, &client->fasync); } -static int evdev_flush (struct file *file,fl_owner_t id) +static int evdev_flush (struct file *file,void *id) {struct evdev_client *client = file->private_data;struct evdev *evdev = client->evdev;drivers/misc/mic/scif/scif_fd.c +1
-1@@ -48,7 +48,7 @@ static __poll_t scif_fdpoll(struct file *f, poll_table *wait)return __scif_pollfd (f, wait, priv); } -static int scif_fdflush (struct file *f,fl_owner_t id) +static int scif_fdflush (struct file *f,void *id) {struct scif_endpt *ep = f->private_data;drivers/scsi/osst.c +1
-1@@ -4822,7 +4822,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)/* Flush the tape buffer before close */ -static int os_scsi_tape_flush (struct file * filp,fl_owner_t id) +static int os_scsi_tape_flush (struct file * filp,void *id) {int result =0 , result2;struct osst_tape * STp = filp->private_data;drivers/scsi/st.c +1
-1@@ -1338,7 +1338,7 @@ static int st_open(struct inode *inode, struct file *filp)/* Flush the tape buffer before close */ -static int st_flush (struct file *filp,fl_owner_t id) +static int st_flush (struct file *filp,void *id) {int result =0 , result2;drivers/scsi/st.c +0
-0unsigned char cmd[MAX_COMMAND_SIZE ];drivers/staging/lustre/lustre/llite/file.c +1
-1@@ -2281,7 +2281,7 @@ static loff_t ll_file_seek(struct file *file, loff_t offset, int origin) ll_file_maxbytes(inode), eof); } -static int ll_flush (struct file *file,fl_owner_t id) +static int ll_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct ll_inode_info *lli =ll_i2info (inode);drivers/usb/class/cdc-wdm.c +1
-1@@ -581,7 +581,7 @@ static ssize_t wdm_readreturn rv; } -static int wdm_flush (struct file *file,fl_owner_t id) +static int wdm_flush (struct file *file,void *id) {struct wdm_device *desc = file->private_data;drivers/usb/usb-skeleton.c +1
-1@@ -132,7 +132,7 @@ static int skel_release(struct inode *inode, struct file *file)return 0 ; } -static int skel_flush (struct file *file,fl_owner_t id) +static int skel_flush (struct file *file,void *id) {struct usb_skel *dev;int res;fs/afs/internal.h +1
-1@@ -947,7 +947,7 @@ extern int afs_writepage(struct page *, struct writeback_control *);extern int afs_writepages (struct address_space *,struct writeback_control *);extern void afs_pages_written_back (struct afs_vnode *,struct afs_call *);extern ssize_t afs_file_write (struct kiocb *,struct iov_iter *); -extern int afs_flush (struct file *,fl_owner_t ); +extern int afs_flush (struct file *,void *);extern int afs_fsync (struct file *,loff_t ,loff_t ,int );extern int afs_page_mkwrite (struct vm_fault *);extern void afs_prune_wb_keys (struct afs_vnode *);fs/afs/write.c +1
-1@@ -737,7 +737,7 @@ int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* Flush out all outstanding writes on a file opened for writing when it is * closed. */ -int afs_flush (struct file *file,fl_owner_t id) +int afs_flush (struct file *file,void *id) {_enter ("" );fs/cifs/cifsfs.h +1
-1@@ -108,7 +108,7 @@ extern ssize_t cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from);extern int cifs_lock (struct file *,int ,struct file_lock *);extern int cifs_fsync (struct file *,loff_t ,loff_t ,int );extern int cifs_strict_fsync (struct file *,loff_t ,loff_t ,int ); -extern int cifs_flush (struct file *,fl_owner_t id); +extern int cifs_flush (struct file *,void *id);extern int cifs_file_mmap (struct file * ,struct vm_area_struct *);extern int cifs_file_strict_mmap (struct file * ,struct vm_area_struct *);extern const struct file_operations cifs_dir_ops;fs/cifs/file.c +2
-2@@ -1174,7 +1174,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) }static __u32 -hash_lockowner (fl_owner_t owner) +hash_lockowner (void *owner) {return cifs_lock_secret ^hash32_ptr ((const void *)owner); }@@ -2393,7 +2393,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* As file closes, flush all cached write data for this inode checking * for write behind errors. */ -int cifs_flush (struct file *file,fl_owner_t id) +int cifs_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);int rc =0 ;fs/ecryptfs/file.c +1
-1@@ -290,7 +290,7 @@ static int ecryptfs_dir_open(struct inode *inode, struct file *file)return 0 ; } -static int ecryptfs_flush (struct file *file,fl_owner_t td) +static int ecryptfs_flush (struct file *file,void *td) {struct file *lower_file =ecryptfs_file_to_lower (file);fs/exofs/file.c +1
-1@@ -58,7 +58,7 @@ static int exofs_file_fsync(struct file *filp, loff_t start, loff_t end,return ret; } -static int exofs_flush (struct file *file,fl_owner_t id) +static int exofs_flush (struct file *file,void *id) {int ret =vfs_fsync (file,0 );/* TODO: Flush the OSD target */ fs/fuse/file.c +6
-7@@ -254,8 +254,7 @@ void fuse_release_common(struct file *file, int opcode)if (ff->flock) {struct fuse_release_in *inarg = &req->misc.release.in; inarg->release_flags |=FUSE_RELEASE_FLOCK_UNLOCK ; - inarg->lock_owner =fuse_lock_owner_id (ff->fc, - (fl_owner_t ) file); + inarg->lock_owner =fuse_lock_owner_id (ff->fc, file); }/* Hold inode until release is finished */ req->misc.release.inode =igrab (file_inode (file));@@ -307,7 +306,7 @@ EXPORT_SYMBOL_GPL(fuse_sync_release);* Scramble the ID space with XTEA, so that the value of the files_struct * pointer is not exposed to userspace. */ -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id) +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id) {u32 *k = fc->scramble_key;u64 v = (unsigned long ) id;@@ -390,7 +389,7 @@ static void fuse_sync_writes(struct inode *inode)fuse_release_nowrite (inode); } -static int fuse_flush (struct file *file,fl_owner_t id) +static int fuse_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct fuse_conn *fc =get_fuse_conn (inode);@@ -643,7 +642,7 @@ static size_t fuse_async_req_send(struct fuse_conn *fc, struct fuse_req *req, }static size_t fuse_send_read (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct file *file = io->iocb->ki_filp;struct fuse_file *ff = file->private_data;@@ -958,7 +957,7 @@ static void fuse_write_fill(struct fuse_req *req, struct fuse_file *ff, }static size_t fuse_send_write (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct kiocb *iocb = io->iocb;struct file *file = iocb->ki_filp;@@ -1358,7 +1357,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter, io->should_dirty = !write &&iter_is_iovec (iter);while (count) {size_t nres; -fl_owner_t owner = current->files; +void *owner = current->files;size_t nbytes =min (count, nmax); err =fuse_get_user_pages (req, iter, &nbytes, write);if (err && !nbytes)fs/fuse/fuse_i.h +1
-1@@ -900,7 +900,7 @@ int fuse_valid_type(int m);*/ int fuse_allow_current_process (struct fuse_conn *fc); -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id); +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id);void fuse_update_ctime (struct inode *inode);fs/lockd/clntproc.c +2
-2@@ -81,7 +81,7 @@ static inline uint32_t __nlm_alloc_pid(struct nlm_host *host)return res; } -static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *lockowner;list_for_each_entry (lockowner, &host->h_lockowners, list) {@@ -92,7 +92,7 @@ static struct nlm_lockowner *__nlm_find_lockowner(struct nlm_host *host, fl_ownereturn NULL ; } -static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *res, *new =NULL ;fs/lockd/svc4proc.c +1
-1@@ -46,7 +46,7 @@ nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }fs/lockd/svcproc.c +1
-1@@ -76,7 +76,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }fs/locks.c +1
-1@@ -2462,7 +2462,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,* from the task's fd array. POSIX locks belonging to this task * are deleted at this time. */ -void locks_remove_posix (struct file *filp,fl_owner_t owner) +void locks_remove_posix (struct file *filp,void *owner) {int error;struct inode *inode =locks_inode (filp);fs/nfs/file.c +1
-1@@ -136,7 +136,7 @@ EXPORT_SYMBOL_GPL(nfs_file_llseek);* Flush all dirty pages, and check for write errors. */ static int -nfs_file_flush (struct file *file,fl_owner_t id) +nfs_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);fs/nfs/inode.c +1
-1@@ -927,7 +927,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, ctx->mode = f_mode; ctx->flags =0 ; ctx->error =0 ; - ctx->flock_owner = (fl_owner_t )filp; + ctx->flock_owner = filp;nfs_init_lock_context (&ctx->lock_context); ctx->lock_context.open_context = ctx;INIT_LIST_HEAD (&ctx->list);fs/nfs/nfs4_fs.h +1
-1@@ -146,7 +146,7 @@ struct nfs4_lock_state {struct nfs_seqid_counter ls_seqid;nfs4_stateid ls_stateid;refcount_t ls_count; -fl_owner_t ls_owner; +void * ls_owner; };/* bits for nfs4_state->flags */ fs/nfs/nfs4file.c +1
-1@@ -107,7 +107,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)* Flush all dirty pages, and check for write errors. */ static int -nfs4_file_flush (struct file *file,fl_owner_t id) +nfs4_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);fs/nfs/nfs4state.c +4
-4@@ -822,7 +822,7 @@ void nfs4_close_sync(struct nfs4_state *state, fmode_t fmode)*/ static struct nfs4_lock_state *__nfs4_find_lock_state (struct nfs4_state *state, -fl_owner_t fl_owner,fl_owner_t fl_owner2) +void *fl_owner,void *fl_owner2) {struct nfs4_lock_state *pos, *ret =NULL ;list_for_each_entry (pos, &state->lock_states, ls_locks) {@@ -843,7 +843,7 @@ __nfs4_find_lock_state(struct nfs4_state *state,* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,fl_owner_t fl_owner) +static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,void *fl_owner) {struct nfs4_lock_state *lsp;struct nfs_server *server = state->owner->so_server;@@ -877,7 +877,7 @@ void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,fl_owner_t owner) +static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,void *owner) {struct nfs4_lock_state *lsp, *new =NULL ;@@ -968,7 +968,7 @@ static int nfs4_copy_lock_stateid(nfs4_stateid *dst, const struct nfs_lock_context *l_ctx) {struct nfs4_lock_state *lsp; -fl_owner_t fl_owner, fl_flock_owner; +void *fl_owner, *fl_flock_owner;int ret = -ENOENT ;if (l_ctx ==NULL )fs/nfsd/nfs4state.c +9
-9@@ -1204,7 +1204,7 @@ static void nfs4_free_lock_stateid(struct nfs4_stid *stid) file =find_any_file (stp->st_stid.sc_file);if (file) -filp_close (file, (fl_owner_t )lo); +filp_close (file, lo);nfs4_free_ol_stateid (stid); }@@ -4268,7 +4268,7 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_file *fp, int flag) fl->fl_flags =FL_DELEG ; fl->fl_type = flag ==NFS4_OPEN_DELEGATE_READ ?F_RDLCK :F_WRLCK ; fl->fl_end =OFFSET_MAX ; - fl->fl_owner = (fl_owner_t )fp; + fl->fl_owner = fp; fl->fl_pid = current->tgid;return fl; }@@ -5563,8 +5563,8 @@ nfs4_transform_lock_offset(struct file_lock *lock) lock->fl_end =OFFSET_MAX ; } -static fl_owner_t -nfsd4_fl_get_owner (fl_owner_t owner) +static void * +nfsd4_fl_get_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;@@ -5573,7 +5573,7 @@ nfsd4_fl_get_owner(fl_owner_t owner) }static void -nfsd4_fl_put_owner (fl_owner_t owner) +nfsd4_fl_put_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;@@ -6008,7 +6008,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, file_lock = &nbl->nbl_lock; file_lock->fl_type = fl_type; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags = fl_flags;@@ -6162,7 +6162,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, lo =find_lockowner_str (cstate->clp, &lockt->lt_owner);if (lo) - file_lock->fl_owner = (fl_owner_t )lo; + file_lock->fl_owner = lo; file_lock->fl_pid = current->tgid; file_lock->fl_flags =FL_POSIX ;@@ -6224,7 +6224,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, } file_lock->fl_type =F_UNLCK ; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (stp->st_stateowner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (stp->st_stateowner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags =FL_POSIX ;@@ -6283,7 +6283,7 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)if (flctx && !list_empty_careful (&flctx->flc_posix)) {spin_lock (&flctx->flc_lock);list_for_each_entry (fl, &flctx->flc_posix, fl_list) { -if (fl->fl_owner == (fl_owner_t )lowner) { +if (fl->fl_owner == lowner) { status = true;break ; }fs/notify/dnotify/dnotify.c +3
-3@@ -145,7 +145,7 @@ static const struct fsnotify_ops dnotify_fsnotify_ops = {* dnotify_struct. If that was the last dnotify_struct also remove the * fsnotify_mark. */ -void dnotify_flush (struct file *filp,fl_owner_t id) +void dnotify_flush (struct file *filp,void *id) {struct fsnotify_mark *fsn_mark;struct dnotify_mark *dn_mark;@@ -223,7 +223,7 @@ static __u32 convert_arg(unsigned long arg)* that list, or it |= the mask onto an existing dnofiy_struct. */ static int attach_dn (struct dnotify_struct *dn,struct dnotify_mark *dn_mark, -fl_owner_t id,int fd,struct file *filp,__u32 mask) +void *id,int fd,struct file *filp,__u32 mask) {struct dnotify_struct *odn;@@ -259,7 +259,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)struct fsnotify_mark *new_fsn_mark, *fsn_mark;struct dnotify_struct *dn;struct inode *inode; -fl_owner_t id = current->files; +void *id = current->files;struct file *f;int destroy =0 , error =0 ;__u32 mask;fs/open.c +1
-1@@ -1123,7 +1123,7 @@ SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)* "id" is the POSIX thread ID. We use the * files pointer for this.. */ -int filp_close (struct file *filp,fl_owner_t id) +int filp_close (struct file *filp,void *id) {int retval =0 ;include/linux/dnotify.h +3
-3@@ -14,7 +14,7 @@ struct dnotify_struct {__u32 dn_mask;int dn_fd;struct file * dn_filp; -fl_owner_t dn_owner; +void * dn_owner; };#ifdef __KERNEL__@@ -30,12 +30,12 @@ struct dnotify_struct { FS_MOVED_FROM | FS_MOVED_TO)extern int dir_notify_enable; -extern void dnotify_flush (struct file *,fl_owner_t ); +extern void dnotify_flush (struct file *,void *);extern int fcntl_dirnotify (int ,struct file *,unsigned long );#else -static inline void dnotify_flush (struct file *filp,fl_owner_t id) +static inline void dnotify_flush (struct file *filp,void *id) { }include/linux/fs.h +7
-10@@ -942,9 +942,6 @@ static inline struct file *get_file(struct file *f)*/ #define FILE_LOCK_DEFERRED 1 -/* legacy typedef, should eventually be removed */ -typedef void *fl_owner_t ; -struct file_lock ;struct file_lock_operations {@@ -955,8 +952,8 @@ struct file_lock_operations {struct lock_manager_operations {int (*lm_compare_owner)(struct file_lock *,struct file_lock *);unsigned long (*lm_owner_key)(struct file_lock *); -fl_owner_t (*lm_get_owner)(fl_owner_t ); -void (*lm_put_owner)(fl_owner_t ); +void *(*lm_get_owner)(void *); +void (*lm_put_owner)(void *);void (*lm_notify)(struct file_lock *);/* unblock callback */ int (*lm_grant)(struct file_lock *,int );bool (*lm_break)(struct file_lock *);@@ -1004,7 +1001,7 @@ struct file_lock {struct list_head fl_list;/* link into file_lock_context */ struct hlist_node fl_link;/* node in global lists */ struct list_head fl_block;/* circular list of blocked processes */ -fl_owner_t fl_owner; +void *fl_owner;unsigned int fl_flags;unsigned char fl_type;unsigned int fl_pid;@@ -1080,7 +1077,7 @@ extern void locks_init_lock(struct file_lock *);extern struct file_lock *locks_alloc_lock (void );extern void locks_copy_lock (struct file_lock *,struct file_lock *);extern void locks_copy_conflock (struct file_lock *,struct file_lock *); -extern void locks_remove_posix (struct file *,fl_owner_t ); +extern void locks_remove_posix (struct file *,void *);extern void locks_remove_file (struct file *);extern void locks_release_private (struct file_lock *);extern void posix_test_lock (struct file *,struct file_lock *);@@ -1154,7 +1151,7 @@ static inline void locks_copy_lock(struct file_lock *new, struct file_lock *fl)return ; } -static inline void locks_remove_posix (struct file *filp,fl_owner_t owner) +static inline void locks_remove_posix (struct file *filp,void *owner) {return ; }@@ -1713,7 +1710,7 @@ struct file_operations {int (*mmap) (struct file *,struct vm_area_struct *);unsigned long mmap_supported_flags;int (*open) (struct inode *,struct file *); -int (*flush) (struct file *,fl_owner_t id); +int (*flush) (struct file *,void *id);int (*release) (struct inode *,struct file *);int (*fsync) (struct file *,loff_t ,loff_t ,int datasync);int (*fasync) (int ,struct file *,int );@@ -2397,7 +2394,7 @@ extern struct file *filp_open(const char *, int, umode_t);extern struct file *file_open_root (struct dentry *,struct vfsmount *,const char *,int ,umode_t );extern struct file *dentry_open (const struct path *,int ,const struct cred *); -extern int filp_close (struct file *,fl_owner_t id); +extern int filp_close (struct file *,void *id);extern struct filename *getname_flags (const char __user *,int ,int *);extern struct filename *getname (const char __user *);include/linux/lockd/lockd.h +2
-2@@ -119,14 +119,14 @@ static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host) }/* -* Map an fl_owner_t into a unique 32-bit "pid" +* Map a lock owner into a unique 32-bit "pid" */ struct nlm_lockowner {struct list_head list;refcount_t count;struct nlm_host *host; -fl_owner_t owner; +void *owner;uint32_t pid; };include/linux/nfs_fs.h +2
-2@@ -60,14 +60,14 @@ struct nfs_lock_context {refcount_t count;struct list_head list;struct nfs_open_context *open_context; -fl_owner_t lockowner; +void *lockowner;atomic_t io_count; };struct nfs4_state ;struct nfs_open_context {struct nfs_lock_context lock_context; -fl_owner_t flock_owner; +void *flock_owner;struct dentry *dentry;struct rpc_cred *cred;struct nfs4_state *state;include/trace/events/filelock.h +3
-3@@ -69,7 +69,7 @@ DECLARE_EVENT_CLASS(filelock_lock, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_pid) __field(unsigned int, fl_flags) __field(unsigned char, fl_type)@@ -123,7 +123,7 @@ DECLARE_EVENT_CLASS(filelock_lease, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) __field(unsigned long, fl_break_time)@@ -176,7 +176,7 @@ TRACE_EVENT(generic_add_lease, __field(int, dcount) __field(int, icount) __field(dev_t, s_dev) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) ),ipc/mqueue.c +0
-0
ipc/mqueue.c static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, · line 563
Quoted 8 lines
ipc/mqueue.c +1
-1@@ -557,7 +557,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,return ret; } -static int mqueue_flush_file (struct file *filp,fl_owner_t id) +static int mqueue_flush_file (struct file *filp,void *id) {struct mqueue_inode_info *info =MQUEUE_I (file_inode (filp));
Looks straightforward enough:
Al Viro
maintainerQuoted 3 lines · J. Bruce Fields
This is a pretty simple patch that touches a lot of files. What's the procedure for handling patches like this? I haven't had to do this before.
I'm not sure it's a good idea. We want it opaque - if anything, I would prefer to have anything mistakenly passing it to a function that takes a pointer scream like hell at build time. The current variant doesn't have such protection, but it can at least be grepped for. void * can't.
Quoted 6 lines · J. Bruce Fields
This is a pretty simple patch that touches a lot of files. What's the procedure for handling patches like this? I haven't had to do this before.
--b.
Quoted 8 lines
commit
4e446db46b83Author: J. Bruce Fields <[email protected]> Date: Thu Sep 7 17:45:21 2017 -0400vfs: remove unnecessary
fl_owner_ttypedefThe convention is to avoid this kind of typedef. It doesn't seem useful, and it requires a lot of casts.
Does it requires a lot of casts?
I just tried removing a couple of casts and gcc didn't complain.
NeilBrown
Quoted 818 lines
Reviewed-by NeilBrown <[email protected]>Signed-off-by J. Bruce Fields <[email protected]>Documentation/filesystems/vfs.txt +1
-1@@ -862,7 +862,7 @@ struct file_operations { int (*mmap) (struct file *, struct vm_area_struct *); int (*mremap)(struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); - int (*flush) (struct file *, fl_owner_t id); + int (*flush) (struct file *, void *id); int (*release) (struct inode *, struct file *); int (*fsync) (struct file *, loff_t, loff_t, int datasync); int (*fasync) (int, struct file *, int);arch/ia64/kernel/perfmon.c +1
-1@@ -1809,7 +1809,7 @@ pfm_syswide_cleanup_other_cpu(pfm_context_t *ctx)* When caller is self-monitoring, the context is unloaded. */ static int -pfm_flush (struct file *filp,fl_owner_t id) +pfm_flush (struct file *filp,void *id) {pfm_context_t *ctx;struct task_struct *task;arch/powerpc/platforms/cell/spufs/file.c +1
-1@@ -1720,7 +1720,7 @@ static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)return mask; } -static int spufs_mfc_flush (struct file *file,fl_owner_t id) +static int spufs_mfc_flush (struct file *file,void *id) {struct spu_context *ctx = file->private_data;int ret;arch/tile/kernel/hardwall.c +1
-1@@ -1030,7 +1030,7 @@ static long hardwall_compat_ioctl(struct file *file,#endif /* The user process closed the file; revoke access to user networks. */ -static int hardwall_flush (struct file *file,fl_owner_t owner) +static int hardwall_flush (struct file *file,void *owner) {struct hardwall_info *info = file->private_data;struct task_struct *task, *tmp;drivers/android/binder.c +1
-1@@ -4776,7 +4776,7 @@ static int binder_open(struct inode *nodp, struct file *filp)return 0 ; } -static int binder_flush (struct file *filp,fl_owner_t id) +static int binder_flush (struct file *filp,void *id) {struct binder_proc *proc = filp->private_data;drivers/char/ps3flash.c +1
-1@@ -281,7 +281,7 @@ static ssize_t ps3flash_kernel_write(const void *buf, size_t count,return res; } -static int ps3flash_flush (struct file *file,fl_owner_t id) +static int ps3flash_flush (struct file *file,void *id) {return ps3flash_writeback (ps3flash_dev); }drivers/char/xillybus/xillybus_core.c +1
-1@@ -1156,7 +1156,7 @@ static int xillybus_myflush(struct xilly_channel *channel, long timeout)return rc; } -static int xillybus_flush (struct file *filp,fl_owner_t id) +static int xillybus_flush (struct file *filp,void *id) {if (!(filp->f_mode &FMODE_WRITE ))return 0 ;drivers/firmware/efi/capsule-loader.c +1
-1@@ -246,7 +246,7 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,* will be treated as upload termination and will free those completed * buffer pages and -ECANCELED will be returned. **/ -static int efi_capsule_flush (struct file *file,fl_owner_t id) +static int efi_capsule_flush (struct file *file,void *id) {int ret =0 ;struct capsule_info *cap_info = file->private_data;drivers/input/evdev.c +1
-1@@ -348,7 +348,7 @@ static int evdev_fasync(int fd, struct file *file, int on)return fasync_helper (fd, file, on, &client->fasync); } -static int evdev_flush (struct file *file,fl_owner_t id) +static int evdev_flush (struct file *file,void *id) {struct evdev_client *client = file->private_data;struct evdev *evdev = client->evdev;drivers/misc/mic/scif/scif_fd.c +1
-1@@ -48,7 +48,7 @@ static __poll_t scif_fdpoll(struct file *f, poll_table *wait)return __scif_pollfd (f, wait, priv); } -static int scif_fdflush (struct file *f,fl_owner_t id) +static int scif_fdflush (struct file *f,void *id) {struct scif_endpt *ep = f->private_data;drivers/scsi/osst.c +1
-1@@ -4822,7 +4822,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)/* Flush the tape buffer before close */ -static int os_scsi_tape_flush (struct file * filp,fl_owner_t id) +static int os_scsi_tape_flush (struct file * filp,void *id) {int result =0 , result2;struct osst_tape * STp = filp->private_data;drivers/scsi/st.c +1
-1@@ -1338,7 +1338,7 @@ static int st_open(struct inode *inode, struct file *filp)/* Flush the tape buffer before close */ -static int st_flush (struct file *filp,fl_owner_t id) +static int st_flush (struct file *filp,void *id) {int result =0 , result2;drivers/scsi/st.c +0
-0unsigned char cmd[MAX_COMMAND_SIZE ];drivers/staging/lustre/lustre/llite/file.c +1
-1@@ -2281,7 +2281,7 @@ static loff_t ll_file_seek(struct file *file, loff_t offset, int origin) ll_file_maxbytes(inode), eof); } -static int ll_flush (struct file *file,fl_owner_t id) +static int ll_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct ll_inode_info *lli =ll_i2info (inode);drivers/usb/class/cdc-wdm.c +1
-1@@ -581,7 +581,7 @@ static ssize_t wdm_readreturn rv; } -static int wdm_flush (struct file *file,fl_owner_t id) +static int wdm_flush (struct file *file,void *id) {struct wdm_device *desc = file->private_data;drivers/usb/usb-skeleton.c +1
-1@@ -132,7 +132,7 @@ static int skel_release(struct inode *inode, struct file *file)return 0 ; } -static int skel_flush (struct file *file,fl_owner_t id) +static int skel_flush (struct file *file,void *id) {struct usb_skel *dev;int res;fs/afs/internal.h +1
-1@@ -947,7 +947,7 @@ extern int afs_writepage(struct page *, struct writeback_control *);extern int afs_writepages (struct address_space *,struct writeback_control *);extern void afs_pages_written_back (struct afs_vnode *,struct afs_call *);extern ssize_t afs_file_write (struct kiocb *,struct iov_iter *); -extern int afs_flush (struct file *,fl_owner_t ); +extern int afs_flush (struct file *,void *);extern int afs_fsync (struct file *,loff_t ,loff_t ,int );extern int afs_page_mkwrite (struct vm_fault *);extern void afs_prune_wb_keys (struct afs_vnode *);fs/afs/write.c +1
-1@@ -737,7 +737,7 @@ int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* Flush out all outstanding writes on a file opened for writing when it is * closed. */ -int afs_flush (struct file *file,fl_owner_t id) +int afs_flush (struct file *file,void *id) {_enter ("" );fs/cifs/cifsfs.h +1
-1@@ -108,7 +108,7 @@ extern ssize_t cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from);extern int cifs_lock (struct file *,int ,struct file_lock *);extern int cifs_fsync (struct file *,loff_t ,loff_t ,int );extern int cifs_strict_fsync (struct file *,loff_t ,loff_t ,int ); -extern int cifs_flush (struct file *,fl_owner_t id); +extern int cifs_flush (struct file *,void *id);extern int cifs_file_mmap (struct file * ,struct vm_area_struct *);extern int cifs_file_strict_mmap (struct file * ,struct vm_area_struct *);extern const struct file_operations cifs_dir_ops;fs/cifs/file.c +2
-2@@ -1174,7 +1174,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) }static __u32 -hash_lockowner (fl_owner_t owner) +hash_lockowner (void *owner) {return cifs_lock_secret ^hash32_ptr ((const void *)owner); }@@ -2393,7 +2393,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* As file closes, flush all cached write data for this inode checking * for write behind errors. */ -int cifs_flush (struct file *file,fl_owner_t id) +int cifs_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);int rc =0 ;fs/ecryptfs/file.c +1
-1@@ -290,7 +290,7 @@ static int ecryptfs_dir_open(struct inode *inode, struct file *file)return 0 ; } -static int ecryptfs_flush (struct file *file,fl_owner_t td) +static int ecryptfs_flush (struct file *file,void *td) {struct file *lower_file =ecryptfs_file_to_lower (file);fs/exofs/file.c +1
-1@@ -58,7 +58,7 @@ static int exofs_file_fsync(struct file *filp, loff_t start, loff_t end,return ret; } -static int exofs_flush (struct file *file,fl_owner_t id) +static int exofs_flush (struct file *file,void *id) {int ret =vfs_fsync (file,0 );/* TODO: Flush the OSD target */ fs/fuse/file.c +6
-7@@ -254,8 +254,7 @@ void fuse_release_common(struct file *file, int opcode)if (ff->flock) {struct fuse_release_in *inarg = &req->misc.release.in; inarg->release_flags |=FUSE_RELEASE_FLOCK_UNLOCK ; - inarg->lock_owner =fuse_lock_owner_id (ff->fc, - (fl_owner_t ) file); + inarg->lock_owner =fuse_lock_owner_id (ff->fc, file); }/* Hold inode until release is finished */ req->misc.release.inode =igrab (file_inode (file));@@ -307,7 +306,7 @@ EXPORT_SYMBOL_GPL(fuse_sync_release);* Scramble the ID space with XTEA, so that the value of the files_struct * pointer is not exposed to userspace. */ -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id) +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id) {u32 *k = fc->scramble_key;u64 v = (unsigned long ) id;@@ -390,7 +389,7 @@ static void fuse_sync_writes(struct inode *inode)fuse_release_nowrite (inode); } -static int fuse_flush (struct file *file,fl_owner_t id) +static int fuse_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct fuse_conn *fc =get_fuse_conn (inode);@@ -643,7 +642,7 @@ static size_t fuse_async_req_send(struct fuse_conn *fc, struct fuse_req *req, }static size_t fuse_send_read (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct file *file = io->iocb->ki_filp;struct fuse_file *ff = file->private_data;@@ -958,7 +957,7 @@ static void fuse_write_fill(struct fuse_req *req, struct fuse_file *ff, }static size_t fuse_send_write (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct kiocb *iocb = io->iocb;struct file *file = iocb->ki_filp;@@ -1358,7 +1357,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter, io->should_dirty = !write &&iter_is_iovec (iter);while (count) {size_t nres; -fl_owner_t owner = current->files; +void *owner = current->files;size_t nbytes =min (count, nmax); err =fuse_get_user_pages (req, iter, &nbytes, write);if (err && !nbytes)fs/fuse/fuse_i.h +1
-1@@ -900,7 +900,7 @@ int fuse_valid_type(int m);*/ int fuse_allow_current_process (struct fuse_conn *fc); -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id); +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id);void fuse_update_ctime (struct inode *inode);fs/lockd/clntproc.c +2
-2@@ -81,7 +81,7 @@ static inline uint32_t __nlm_alloc_pid(struct nlm_host *host)return res; } -static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *lockowner;list_for_each_entry (lockowner, &host->h_lockowners, list) {@@ -92,7 +92,7 @@ static struct nlm_lockowner *__nlm_find_lockowner(struct nlm_host *host, fl_ownereturn NULL ; } -static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *res, *new =NULL ;fs/lockd/svc4proc.c +1
-1@@ -46,7 +46,7 @@ nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }fs/lockd/svcproc.c +1
-1@@ -76,7 +76,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }fs/locks.c +1
-1@@ -2462,7 +2462,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,* from the task's fd array. POSIX locks belonging to this task * are deleted at this time. */ -void locks_remove_posix (struct file *filp,fl_owner_t owner) +void locks_remove_posix (struct file *filp,void *owner) {int error;struct inode *inode =locks_inode (filp);fs/nfs/file.c +1
-1@@ -136,7 +136,7 @@ EXPORT_SYMBOL_GPL(nfs_file_llseek);* Flush all dirty pages, and check for write errors. */ static int -nfs_file_flush (struct file *file,fl_owner_t id) +nfs_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);fs/nfs/inode.c +1
-1@@ -927,7 +927,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, ctx->mode = f_mode; ctx->flags =0 ; ctx->error =0 ; - ctx->flock_owner = (fl_owner_t )filp; + ctx->flock_owner = filp;nfs_init_lock_context (&ctx->lock_context); ctx->lock_context.open_context = ctx;INIT_LIST_HEAD (&ctx->list);fs/nfs/nfs4_fs.h +1
-1@@ -146,7 +146,7 @@ struct nfs4_lock_state {struct nfs_seqid_counter ls_seqid;nfs4_stateid ls_stateid;refcount_t ls_count; -fl_owner_t ls_owner; +void * ls_owner; };/* bits for nfs4_state->flags */ fs/nfs/nfs4file.c +1
-1@@ -107,7 +107,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)* Flush all dirty pages, and check for write errors. */ static int -nfs4_file_flush (struct file *file,fl_owner_t id) +nfs4_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);fs/nfs/nfs4state.c +4
-4@@ -822,7 +822,7 @@ void nfs4_close_sync(struct nfs4_state *state, fmode_t fmode)*/ static struct nfs4_lock_state *__nfs4_find_lock_state (struct nfs4_state *state, -fl_owner_t fl_owner,fl_owner_t fl_owner2) +void *fl_owner,void *fl_owner2) {struct nfs4_lock_state *pos, *ret =NULL ;list_for_each_entry (pos, &state->lock_states, ls_locks) {@@ -843,7 +843,7 @@ __nfs4_find_lock_state(struct nfs4_state *state,* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,fl_owner_t fl_owner) +static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,void *fl_owner) {struct nfs4_lock_state *lsp;struct nfs_server *server = state->owner->so_server;@@ -877,7 +877,7 @@ void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,fl_owner_t owner) +static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,void *owner) {struct nfs4_lock_state *lsp, *new =NULL ;@@ -968,7 +968,7 @@ static int nfs4_copy_lock_stateid(nfs4_stateid *dst, const struct nfs_lock_context *l_ctx) {struct nfs4_lock_state *lsp; -fl_owner_t fl_owner, fl_flock_owner; +void *fl_owner, *fl_flock_owner;int ret = -ENOENT ;if (l_ctx ==NULL )fs/nfsd/nfs4state.c +9
-9@@ -1204,7 +1204,7 @@ static void nfs4_free_lock_stateid(struct nfs4_stid *stid) file =find_any_file (stp->st_stid.sc_file);if (file) -filp_close (file, (fl_owner_t )lo); +filp_close (file, lo);nfs4_free_ol_stateid (stid); }@@ -4268,7 +4268,7 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_file *fp, int flag) fl->fl_flags =FL_DELEG ; fl->fl_type = flag ==NFS4_OPEN_DELEGATE_READ ?F_RDLCK :F_WRLCK ; fl->fl_end =OFFSET_MAX ; - fl->fl_owner = (fl_owner_t )fp; + fl->fl_owner = fp; fl->fl_pid = current->tgid;return fl; }@@ -5563,8 +5563,8 @@ nfs4_transform_lock_offset(struct file_lock *lock) lock->fl_end =OFFSET_MAX ; } -static fl_owner_t -nfsd4_fl_get_owner (fl_owner_t owner) +static void * +nfsd4_fl_get_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;@@ -5573,7 +5573,7 @@ nfsd4_fl_get_owner(fl_owner_t owner) }static void -nfsd4_fl_put_owner (fl_owner_t owner) +nfsd4_fl_put_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;@@ -6008,7 +6008,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, file_lock = &nbl->nbl_lock; file_lock->fl_type = fl_type; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags = fl_flags;@@ -6162,7 +6162,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, lo =find_lockowner_str (cstate->clp, &lockt->lt_owner);if (lo) - file_lock->fl_owner = (fl_owner_t )lo; + file_lock->fl_owner = lo; file_lock->fl_pid = current->tgid; file_lock->fl_flags =FL_POSIX ;@@ -6224,7 +6224,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, } file_lock->fl_type =F_UNLCK ; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (stp->st_stateowner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (stp->st_stateowner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags =FL_POSIX ;@@ -6283,7 +6283,7 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)if (flctx && !list_empty_careful (&flctx->flc_posix)) {spin_lock (&flctx->flc_lock);list_for_each_entry (fl, &flctx->flc_posix, fl_list) { -if (fl->fl_owner == (fl_owner_t )lowner) { +if (fl->fl_owner == lowner) { status = true;break ; }fs/notify/dnotify/dnotify.c +3
-3@@ -145,7 +145,7 @@ static const struct fsnotify_ops dnotify_fsnotify_ops = {* dnotify_struct. If that was the last dnotify_struct also remove the * fsnotify_mark. */ -void dnotify_flush (struct file *filp,fl_owner_t id) +void dnotify_flush (struct file *filp,void *id) {struct fsnotify_mark *fsn_mark;struct dnotify_mark *dn_mark;@@ -223,7 +223,7 @@ static __u32 convert_arg(unsigned long arg)* that list, or it |= the mask onto an existing dnofiy_struct. */ static int attach_dn (struct dnotify_struct *dn,struct dnotify_mark *dn_mark, -fl_owner_t id,int fd,struct file *filp,__u32 mask) +void *id,int fd,struct file *filp,__u32 mask) {struct dnotify_struct *odn;@@ -259,7 +259,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)struct fsnotify_mark *new_fsn_mark, *fsn_mark;struct dnotify_struct *dn;struct inode *inode; -fl_owner_t id = current->files; +void *id = current->files;struct file *f;int destroy =0 , error =0 ;__u32 mask;fs/open.c +1
-1@@ -1123,7 +1123,7 @@ SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)* "id" is the POSIX thread ID. We use the * files pointer for this.. */ -int filp_close (struct file *filp,fl_owner_t id) +int filp_close (struct file *filp,void *id) {int retval =0 ;include/linux/dnotify.h +3
-3@@ -14,7 +14,7 @@ struct dnotify_struct {__u32 dn_mask;int dn_fd;struct file * dn_filp; -fl_owner_t dn_owner; +void * dn_owner; };#ifdef __KERNEL__@@ -30,12 +30,12 @@ struct dnotify_struct { FS_MOVED_FROM | FS_MOVED_TO)extern int dir_notify_enable; -extern void dnotify_flush (struct file *,fl_owner_t ); +extern void dnotify_flush (struct file *,void *);extern int fcntl_dirnotify (int ,struct file *,unsigned long );#else -static inline void dnotify_flush (struct file *filp,fl_owner_t id) +static inline void dnotify_flush (struct file *filp,void *id) { }include/linux/fs.h +7
-10@@ -942,9 +942,6 @@ static inline struct file *get_file(struct file *f)*/ #define FILE_LOCK_DEFERRED 1 -/* legacy typedef, should eventually be removed */ -typedef void *fl_owner_t ; -struct file_lock ;struct file_lock_operations {@@ -955,8 +952,8 @@ struct file_lock_operations {struct lock_manager_operations {int (*lm_compare_owner)(struct file_lock *,struct file_lock *);unsigned long (*lm_owner_key)(struct file_lock *); -fl_owner_t (*lm_get_owner)(fl_owner_t ); -void (*lm_put_owner)(fl_owner_t ); +void *(*lm_get_owner)(void *); +void (*lm_put_owner)(void *);void (*lm_notify)(struct file_lock *);/* unblock callback */ int (*lm_grant)(struct file_lock *,int );bool (*lm_break)(struct file_lock *);@@ -1004,7 +1001,7 @@ struct file_lock {struct list_head fl_list;/* link into file_lock_context */ struct hlist_node fl_link;/* node in global lists */ struct list_head fl_block;/* circular list of blocked processes */ -fl_owner_t fl_owner; +void *fl_owner;unsigned int fl_flags;unsigned char fl_type;unsigned int fl_pid;@@ -1080,7 +1077,7 @@ extern void locks_init_lock(struct file_lock *);extern struct file_lock *locks_alloc_lock (void );extern void locks_copy_lock (struct file_lock *,struct file_lock *);extern void locks_copy_conflock (struct file_lock *,struct file_lock *); -extern void locks_remove_posix (struct file *,fl_owner_t ); +extern void locks_remove_posix (struct file *,void *);extern void locks_remove_file (struct file *);extern void locks_release_private (struct file_lock *);extern void posix_test_lock (struct file *,struct file_lock *);@@ -1154,7 +1151,7 @@ static inline void locks_copy_lock(struct file_lock *new, struct file_lock *fl)return ; } -static inline void locks_remove_posix (struct file *filp,fl_owner_t owner) +static inline void locks_remove_posix (struct file *filp,void *owner) {return ; }@@ -1713,7 +1710,7 @@ struct file_operations {int (*mmap) (struct file *,struct vm_area_struct *);unsigned long mmap_supported_flags;int (*open) (struct inode *,struct file *); -int (*flush) (struct file *,fl_owner_t id); +int (*flush) (struct file *,void *id);int (*release) (struct inode *,struct file *);int (*fsync) (struct file *,loff_t ,loff_t ,int datasync);int (*fasync) (int ,struct file *,int );@@ -2397,7 +2394,7 @@ extern struct file *filp_open(const char *, int, umode_t);extern struct file *file_open_root (struct dentry *,struct vfsmount *,const char *,int ,umode_t );extern struct file *dentry_open (const struct path *,int ,const struct cred *); -extern int filp_close (struct file *,fl_owner_t id); +extern int filp_close (struct file *,void *id);extern struct filename *getname_flags (const char __user *,int ,int *);extern struct filename *getname (const char __user *);include/linux/lockd/lockd.h +2
-2@@ -119,14 +119,14 @@ static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host) }/* -* Map an fl_owner_t into a unique 32-bit "pid" +* Map a lock owner into a unique 32-bit "pid" */ struct nlm_lockowner {struct list_head list;refcount_t count;struct nlm_host *host; -fl_owner_t owner; +void *owner;uint32_t pid; };include/linux/nfs_fs.h +2
-2@@ -60,14 +60,14 @@ struct nfs_lock_context {refcount_t count;struct list_head list;struct nfs_open_context *open_context; -fl_owner_t lockowner; +void *lockowner;atomic_t io_count; };struct nfs4_state ;struct nfs_open_context {struct nfs_lock_context lock_context; -fl_owner_t flock_owner; +void *flock_owner;struct dentry *dentry;struct rpc_cred *cred;struct nfs4_state *state;include/trace/events/filelock.h +3
-3@@ -69,7 +69,7 @@ DECLARE_EVENT_CLASS(filelock_lock, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_pid) __field(unsigned int, fl_flags) __field(unsigned char, fl_type)@@ -123,7 +123,7 @@ DECLARE_EVENT_CLASS(filelock_lease, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) __field(unsigned long, fl_break_time)@@ -176,7 +176,7 @@ TRACE_EVENT(generic_add_lease, __field(int, dcount) __field(int, icount) __field(dev_t, s_dev) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) ),ipc/mqueue.c +1
-1@@ -557,7 +557,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,return ret; } -static int mqueue_flush_file (struct file *filp,fl_owner_t id) +static int mqueue_flush_file (struct file *filp,void *id) {struct mqueue_inode_info *info =MQUEUE_I (file_inode (filp));
Quoted 9 lines · Al Viro
Quoted 3 lines · J. Bruce Fields
This is a pretty simple patch that touches a lot of files. What's the procedure for handling patches like this? I haven't had to do this before.
I'm not sure it's a good idea. We want it opaque - if anything, I would prefer to have anything mistakenly passing it to a function that takes a pointer scream like hell at build time. The current variant doesn't have such protection, but it can at least be grepped for. void * can't.
OK; dropping for now.
--b.
Quoted 12 lines · NeilBrown
Quoted 10 lines · J. Bruce Fields
This is a pretty simple patch that touches a lot of files. What's the procedure for handling patches like this? I haven't had to do this before.
--b.
commit
4e446db46b83Author: J. Bruce Fields <[email protected]> Date: Thu Sep 7 17:45:21 2017 -0400
Quoted 7 lines
Quoted 4 lines
vfs: remove unnecessary
fl_owner_ttypedefThe convention is to avoid this kind of typedef. It doesn't seem useful, and it requires a lot of casts.
Does it requires a lot of casts?
I just tried removing a couple of casts and gcc didn't complain.
Oops. So maybe we should just be removing some of those casts.
--b.
Quoted 821 lines
NeilBrown
Quoted 817 lines
Reviewed-by NeilBrown <[email protected]>Signed-off-by J. Bruce Fields <[email protected]>Documentation/filesystems/vfs.txt +1
-1@@ -862,7 +862,7 @@ struct file_operations { int (*mmap) (struct file *, struct vm_area_struct *); int (*mremap)(struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); - int (*flush) (struct file *, fl_owner_t id); + int (*flush) (struct file *, void *id); int (*release) (struct inode *, struct file *); int (*fsync) (struct file *, loff_t, loff_t, int datasync); int (*fasync) (int, struct file *, int);arch/ia64/kernel/perfmon.c +1
-1@@ -1809,7 +1809,7 @@ pfm_syswide_cleanup_other_cpu(pfm_context_t *ctx)* When caller is self-monitoring, the context is unloaded. */ static int -pfm_flush (struct file *filp,fl_owner_t id) +pfm_flush (struct file *filp,void *id) {pfm_context_t *ctx;struct task_struct *task;arch/powerpc/platforms/cell/spufs/file.c +1
-1@@ -1720,7 +1720,7 @@ static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)return mask; } -static int spufs_mfc_flush (struct file *file,fl_owner_t id) +static int spufs_mfc_flush (struct file *file,void *id) {struct spu_context *ctx = file->private_data;int ret;arch/tile/kernel/hardwall.c +1
-1@@ -1030,7 +1030,7 @@ static long hardwall_compat_ioctl(struct file *file,#endif /* The user process closed the file; revoke access to user networks. */ -static int hardwall_flush (struct file *file,fl_owner_t owner) +static int hardwall_flush (struct file *file,void *owner) {struct hardwall_info *info = file->private_data;struct task_struct *task, *tmp;drivers/android/binder.c +1
-1@@ -4776,7 +4776,7 @@ static int binder_open(struct inode *nodp, struct file *filp)return 0 ; } -static int binder_flush (struct file *filp,fl_owner_t id) +static int binder_flush (struct file *filp,void *id) {struct binder_proc *proc = filp->private_data;drivers/char/ps3flash.c +1
-1@@ -281,7 +281,7 @@ static ssize_t ps3flash_kernel_write(const void *buf, size_t count,return res; } -static int ps3flash_flush (struct file *file,fl_owner_t id) +static int ps3flash_flush (struct file *file,void *id) {return ps3flash_writeback (ps3flash_dev); }drivers/char/xillybus/xillybus_core.c +1
-1@@ -1156,7 +1156,7 @@ static int xillybus_myflush(struct xilly_channel *channel, long timeout)return rc; } -static int xillybus_flush (struct file *filp,fl_owner_t id) +static int xillybus_flush (struct file *filp,void *id) {if (!(filp->f_mode &FMODE_WRITE ))return 0 ;drivers/firmware/efi/capsule-loader.c +1
-1@@ -246,7 +246,7 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,* will be treated as upload termination and will free those completed * buffer pages and -ECANCELED will be returned. **/ -static int efi_capsule_flush (struct file *file,fl_owner_t id) +static int efi_capsule_flush (struct file *file,void *id) {int ret =0 ;struct capsule_info *cap_info = file->private_data;drivers/input/evdev.c +1
-1@@ -348,7 +348,7 @@ static int evdev_fasync(int fd, struct file *file, int on)return fasync_helper (fd, file, on, &client->fasync); } -static int evdev_flush (struct file *file,fl_owner_t id) +static int evdev_flush (struct file *file,void *id) {struct evdev_client *client = file->private_data;struct evdev *evdev = client->evdev;drivers/misc/mic/scif/scif_fd.c +1
-1@@ -48,7 +48,7 @@ static __poll_t scif_fdpoll(struct file *f, poll_table *wait)return __scif_pollfd (f, wait, priv); } -static int scif_fdflush (struct file *f,fl_owner_t id) +static int scif_fdflush (struct file *f,void *id) {struct scif_endpt *ep = f->private_data;drivers/scsi/osst.c +1
-1@@ -4822,7 +4822,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)/* Flush the tape buffer before close */ -static int os_scsi_tape_flush (struct file * filp,fl_owner_t id) +static int os_scsi_tape_flush (struct file * filp,void *id) {int result =0 , result2;struct osst_tape * STp = filp->private_data;drivers/scsi/st.c +1
-1@@ -1338,7 +1338,7 @@ static int st_open(struct inode *inode, struct file *filp)/* Flush the tape buffer before close */ -static int st_flush (struct file *filp,fl_owner_t id) +static int st_flush (struct file *filp,void *id) {int result =0 , result2;unsigned char cmd[MAX_COMMAND_SIZE ];drivers/staging/lustre/lustre/llite/file.c +1
-1@@ -2281,7 +2281,7 @@ static loff_t ll_file_seek(struct file *file, loff_t offset, int origin) ll_file_maxbytes(inode), eof); } -static int ll_flush (struct file *file,fl_owner_t id) +static int ll_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct ll_inode_info *lli =ll_i2info (inode);drivers/usb/class/cdc-wdm.c +1
-1@@ -581,7 +581,7 @@ static ssize_t wdm_readreturn rv; } -static int wdm_flush (struct file *file,fl_owner_t id) +static int wdm_flush (struct file *file,void *id) {struct wdm_device *desc = file->private_data;drivers/usb/usb-skeleton.c +1
-1@@ -132,7 +132,7 @@ static int skel_release(struct inode *inode, struct file *file)return 0 ; } -static int skel_flush (struct file *file,fl_owner_t id) +static int skel_flush (struct file *file,void *id) {struct usb_skel *dev;int res;fs/afs/internal.h +1
-1@@ -947,7 +947,7 @@ extern int afs_writepage(struct page *, struct writeback_control *);extern int afs_writepages (struct address_space *,struct writeback_control *);extern void afs_pages_written_back (struct afs_vnode *,struct afs_call *);extern ssize_t afs_file_write (struct kiocb *,struct iov_iter *); -extern int afs_flush (struct file *,fl_owner_t ); +extern int afs_flush (struct file *,void *);extern int afs_fsync (struct file *,loff_t ,loff_t ,int );extern int afs_page_mkwrite (struct vm_fault *);extern void afs_prune_wb_keys (struct afs_vnode *);fs/afs/write.c +1
-1@@ -737,7 +737,7 @@ int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* Flush out all outstanding writes on a file opened for writing when it is * closed. */ -int afs_flush (struct file *file,fl_owner_t id) +int afs_flush (struct file *file,void *id) {_enter ("" );fs/cifs/cifsfs.h +1
-1@@ -108,7 +108,7 @@ extern ssize_t cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from);extern int cifs_lock (struct file *,int ,struct file_lock *);extern int cifs_fsync (struct file *,loff_t ,loff_t ,int );extern int cifs_strict_fsync (struct file *,loff_t ,loff_t ,int ); -extern int cifs_flush (struct file *,fl_owner_t id); +extern int cifs_flush (struct file *,void *id);extern int cifs_file_mmap (struct file * ,struct vm_area_struct *);extern int cifs_file_strict_mmap (struct file * ,struct vm_area_struct *);extern const struct file_operations cifs_dir_ops;fs/cifs/file.c +2
-2@@ -1174,7 +1174,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile) }static __u32 -hash_lockowner (fl_owner_t owner) +hash_lockowner (void *owner) {return cifs_lock_secret ^hash32_ptr ((const void *)owner); }@@ -2393,7 +2393,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* As file closes, flush all cached write data for this inode checking * for write behind errors. */ -int cifs_flush (struct file *file,fl_owner_t id) +int cifs_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);int rc =0 ;fs/ecryptfs/file.c +1
-1@@ -290,7 +290,7 @@ static int ecryptfs_dir_open(struct inode *inode, struct file *file)return 0 ; } -static int ecryptfs_flush (struct file *file,fl_owner_t td) +static int ecryptfs_flush (struct file *file,void *td) {struct file *lower_file =ecryptfs_file_to_lower (file);fs/exofs/file.c +1
-1@@ -58,7 +58,7 @@ static int exofs_file_fsync(struct file *filp, loff_t start, loff_t end,return ret; } -static int exofs_flush (struct file *file,fl_owner_t id) +static int exofs_flush (struct file *file,void *id) {int ret =vfs_fsync (file,0 );/* TODO: Flush the OSD target */ fs/fuse/file.c +6
-7@@ -254,8 +254,7 @@ void fuse_release_common(struct file *file, int opcode)if (ff->flock) {struct fuse_release_in *inarg = &req->misc.release.in; inarg->release_flags |=FUSE_RELEASE_FLOCK_UNLOCK ; - inarg->lock_owner =fuse_lock_owner_id (ff->fc, - (fl_owner_t ) file); + inarg->lock_owner =fuse_lock_owner_id (ff->fc, file); }/* Hold inode until release is finished */ req->misc.release.inode =igrab (file_inode (file));@@ -307,7 +306,7 @@ EXPORT_SYMBOL_GPL(fuse_sync_release);* Scramble the ID space with XTEA, so that the value of the files_struct * pointer is not exposed to userspace. */ -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id) +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id) {u32 *k = fc->scramble_key;u64 v = (unsigned long ) id;@@ -390,7 +389,7 @@ static void fuse_sync_writes(struct inode *inode)fuse_release_nowrite (inode); } -static int fuse_flush (struct file *file,fl_owner_t id) +static int fuse_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);struct fuse_conn *fc =get_fuse_conn (inode);@@ -643,7 +642,7 @@ static size_t fuse_async_req_send(struct fuse_conn *fc, struct fuse_req *req, }static size_t fuse_send_read (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct file *file = io->iocb->ki_filp;struct fuse_file *ff = file->private_data;@@ -958,7 +957,7 @@ static void fuse_write_fill(struct fuse_req *req, struct fuse_file *ff, }static size_t fuse_send_write (struct fuse_req *req,struct fuse_io_priv *io, -loff_t pos,size_t count,fl_owner_t owner) +loff_t pos,size_t count,void *owner) {struct kiocb *iocb = io->iocb;struct file *file = iocb->ki_filp;@@ -1358,7 +1357,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter, io->should_dirty = !write &&iter_is_iovec (iter);while (count) {size_t nres; -fl_owner_t owner = current->files; +void *owner = current->files;size_t nbytes =min (count, nmax); err =fuse_get_user_pages (req, iter, &nbytes, write);if (err && !nbytes)fs/fuse/fuse_i.h +1
-1@@ -900,7 +900,7 @@ int fuse_valid_type(int m);*/ int fuse_allow_current_process (struct fuse_conn *fc); -u64 fuse_lock_owner_id (struct fuse_conn *fc,fl_owner_t id); +u64 fuse_lock_owner_id (struct fuse_conn *fc,void *id);void fuse_update_ctime (struct inode *inode);fs/lockd/clntproc.c +2
-2@@ -81,7 +81,7 @@ static inline uint32_t __nlm_alloc_pid(struct nlm_host *host)return res; } -static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *__nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *lockowner;list_for_each_entry (lockowner, &host->h_lockowners, list) {@@ -92,7 +92,7 @@ static struct nlm_lockowner *__nlm_find_lockowner(struct nlm_host *host, fl_ownereturn NULL ; } -static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,fl_owner_t owner) +static struct nlm_lockowner *nlm_find_lockowner (struct nlm_host *host,void *owner) {struct nlm_lockowner *res, *new =NULL ;fs/lockd/svc4proc.c +1
-1@@ -46,7 +46,7 @@ nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }fs/lockd/svcproc.c +1
-1@@ -76,7 +76,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,/* Set up the missing parts of the file_lock structure */ lock->fl.fl_file = file->f_file; - lock->fl.fl_owner = (fl_owner_t ) host; + lock->fl.fl_owner = host; lock->fl.fl_lmops = &nlmsvc_lock_operations; }fs/locks.c +1
-1@@ -2462,7 +2462,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,* from the task's fd array. POSIX locks belonging to this task * are deleted at this time. */ -void locks_remove_posix (struct file *filp,fl_owner_t owner) +void locks_remove_posix (struct file *filp,void *owner) {int error;struct inode *inode =locks_inode (filp);fs/nfs/file.c +1
-1@@ -136,7 +136,7 @@ EXPORT_SYMBOL_GPL(nfs_file_llseek);* Flush all dirty pages, and check for write errors. */ static int -nfs_file_flush (struct file *file,fl_owner_t id) +nfs_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);fs/nfs/inode.c +1
-1@@ -927,7 +927,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, ctx->mode = f_mode; ctx->flags =0 ; ctx->error =0 ; - ctx->flock_owner = (fl_owner_t )filp; + ctx->flock_owner = filp;nfs_init_lock_context (&ctx->lock_context); ctx->lock_context.open_context = ctx;INIT_LIST_HEAD (&ctx->list);fs/nfs/nfs4_fs.h +1
-1@@ -146,7 +146,7 @@ struct nfs4_lock_state {struct nfs_seqid_counter ls_seqid;nfs4_stateid ls_stateid;refcount_t ls_count; -fl_owner_t ls_owner; +void * ls_owner; };/* bits for nfs4_state->flags */ fs/nfs/nfs4file.c +1
-1@@ -107,7 +107,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)* Flush all dirty pages, and check for write errors. */ static int -nfs4_file_flush (struct file *file,fl_owner_t id) +nfs4_file_flush (struct file *file,void *id) {struct inode *inode =file_inode (file);fs/nfs/nfs4state.c +4
-4@@ -822,7 +822,7 @@ void nfs4_close_sync(struct nfs4_state *state, fmode_t fmode)*/ static struct nfs4_lock_state *__nfs4_find_lock_state (struct nfs4_state *state, -fl_owner_t fl_owner,fl_owner_t fl_owner2) +void *fl_owner,void *fl_owner2) {struct nfs4_lock_state *pos, *ret =NULL ;list_for_each_entry (pos, &state->lock_states, ls_locks) {@@ -843,7 +843,7 @@ __nfs4_find_lock_state(struct nfs4_state *state,* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,fl_owner_t fl_owner) +static struct nfs4_lock_state *nfs4_alloc_lock_state (struct nfs4_state *state,void *fl_owner) {struct nfs4_lock_state *lsp;struct nfs_server *server = state->owner->so_server;@@ -877,7 +877,7 @@ void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp* exists, return an uninitialized one. * */ -static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,fl_owner_t owner) +static struct nfs4_lock_state *nfs4_get_lock_state (struct nfs4_state *state,void *owner) {struct nfs4_lock_state *lsp, *new =NULL ;@@ -968,7 +968,7 @@ static int nfs4_copy_lock_stateid(nfs4_stateid *dst, const struct nfs_lock_context *l_ctx) {struct nfs4_lock_state *lsp; -fl_owner_t fl_owner, fl_flock_owner; +void *fl_owner, *fl_flock_owner;int ret = -ENOENT ;if (l_ctx ==NULL )fs/nfsd/nfs4state.c +9
-9@@ -1204,7 +1204,7 @@ static void nfs4_free_lock_stateid(struct nfs4_stid *stid) file =find_any_file (stp->st_stid.sc_file);if (file) -filp_close (file, (fl_owner_t )lo); +filp_close (file, lo);nfs4_free_ol_stateid (stid); }@@ -4268,7 +4268,7 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_file *fp, int flag) fl->fl_flags =FL_DELEG ; fl->fl_type = flag ==NFS4_OPEN_DELEGATE_READ ?F_RDLCK :F_WRLCK ; fl->fl_end =OFFSET_MAX ; - fl->fl_owner = (fl_owner_t )fp; + fl->fl_owner = fp; fl->fl_pid = current->tgid;return fl; }@@ -5563,8 +5563,8 @@ nfs4_transform_lock_offset(struct file_lock *lock) lock->fl_end =OFFSET_MAX ; } -static fl_owner_t -nfsd4_fl_get_owner (fl_owner_t owner) +static void * +nfsd4_fl_get_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;@@ -5573,7 +5573,7 @@ nfsd4_fl_get_owner(fl_owner_t owner) }static void -nfsd4_fl_put_owner (fl_owner_t owner) +nfsd4_fl_put_owner (void *owner) {struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;@@ -6008,7 +6008,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, file_lock = &nbl->nbl_lock; file_lock->fl_type = fl_type; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (&lock_sop->lo_owner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags = fl_flags;@@ -6162,7 +6162,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, lo =find_lockowner_str (cstate->clp, &lockt->lt_owner);if (lo) - file_lock->fl_owner = (fl_owner_t )lo; + file_lock->fl_owner = lo; file_lock->fl_pid = current->tgid; file_lock->fl_flags =FL_POSIX ;@@ -6224,7 +6224,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, } file_lock->fl_type =F_UNLCK ; - file_lock->fl_owner = (fl_owner_t )lockowner (nfs4_get_stateowner (stp->st_stateowner)); + file_lock->fl_owner =lockowner (nfs4_get_stateowner (stp->st_stateowner)); file_lock->fl_pid = current->tgid; file_lock->fl_file = filp; file_lock->fl_flags =FL_POSIX ;@@ -6283,7 +6283,7 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)if (flctx && !list_empty_careful (&flctx->flc_posix)) {spin_lock (&flctx->flc_lock);list_for_each_entry (fl, &flctx->flc_posix, fl_list) { -if (fl->fl_owner == (fl_owner_t )lowner) { +if (fl->fl_owner == lowner) { status = true;break ; }fs/notify/dnotify/dnotify.c +3
-3@@ -145,7 +145,7 @@ static const struct fsnotify_ops dnotify_fsnotify_ops = {* dnotify_struct. If that was the last dnotify_struct also remove the * fsnotify_mark. */ -void dnotify_flush (struct file *filp,fl_owner_t id) +void dnotify_flush (struct file *filp,void *id) {struct fsnotify_mark *fsn_mark;struct dnotify_mark *dn_mark;@@ -223,7 +223,7 @@ static __u32 convert_arg(unsigned long arg)* that list, or it |= the mask onto an existing dnofiy_struct. */ static int attach_dn (struct dnotify_struct *dn,struct dnotify_mark *dn_mark, -fl_owner_t id,int fd,struct file *filp,__u32 mask) +void *id,int fd,struct file *filp,__u32 mask) {struct dnotify_struct *odn;@@ -259,7 +259,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)struct fsnotify_mark *new_fsn_mark, *fsn_mark;struct dnotify_struct *dn;struct inode *inode; -fl_owner_t id = current->files; +void *id = current->files;struct file *f;int destroy =0 , error =0 ;__u32 mask;fs/open.c +1
-1@@ -1123,7 +1123,7 @@ SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)* "id" is the POSIX thread ID. We use the * files pointer for this.. */ -int filp_close (struct file *filp,fl_owner_t id) +int filp_close (struct file *filp,void *id) {int retval =0 ;include/linux/dnotify.h +3
-3@@ -14,7 +14,7 @@ struct dnotify_struct {__u32 dn_mask;int dn_fd;struct file * dn_filp; -fl_owner_t dn_owner; +void * dn_owner; };#ifdef __KERNEL__@@ -30,12 +30,12 @@ struct dnotify_struct { FS_MOVED_FROM | FS_MOVED_TO)extern int dir_notify_enable; -extern void dnotify_flush (struct file *,fl_owner_t ); +extern void dnotify_flush (struct file *,void *);extern int fcntl_dirnotify (int ,struct file *,unsigned long );#else -static inline void dnotify_flush (struct file *filp,fl_owner_t id) +static inline void dnotify_flush (struct file *filp,void *id) { }include/linux/fs.h +7
-10@@ -942,9 +942,6 @@ static inline struct file *get_file(struct file *f)*/ #define FILE_LOCK_DEFERRED 1 -/* legacy typedef, should eventually be removed */ -typedef void *fl_owner_t ; -struct file_lock ;struct file_lock_operations {@@ -955,8 +952,8 @@ struct file_lock_operations {struct lock_manager_operations {int (*lm_compare_owner)(struct file_lock *,struct file_lock *);unsigned long (*lm_owner_key)(struct file_lock *); -fl_owner_t (*lm_get_owner)(fl_owner_t ); -void (*lm_put_owner)(fl_owner_t ); +void *(*lm_get_owner)(void *); +void (*lm_put_owner)(void *);void (*lm_notify)(struct file_lock *);/* unblock callback */ int (*lm_grant)(struct file_lock *,int );bool (*lm_break)(struct file_lock *);@@ -1004,7 +1001,7 @@ struct file_lock {struct list_head fl_list;/* link into file_lock_context */ struct hlist_node fl_link;/* node in global lists */ struct list_head fl_block;/* circular list of blocked processes */ -fl_owner_t fl_owner; +void *fl_owner;unsigned int fl_flags;unsigned char fl_type;unsigned int fl_pid;@@ -1080,7 +1077,7 @@ extern void locks_init_lock(struct file_lock *);extern struct file_lock *locks_alloc_lock (void );extern void locks_copy_lock (struct file_lock *,struct file_lock *);extern void locks_copy_conflock (struct file_lock *,struct file_lock *); -extern void locks_remove_posix (struct file *,fl_owner_t ); +extern void locks_remove_posix (struct file *,void *);extern void locks_remove_file (struct file *);extern void locks_release_private (struct file_lock *);extern void posix_test_lock (struct file *,struct file_lock *);@@ -1154,7 +1151,7 @@ static inline void locks_copy_lock(struct file_lock *new, struct file_lock *fl)return ; } -static inline void locks_remove_posix (struct file *filp,fl_owner_t owner) +static inline void locks_remove_posix (struct file *filp,void *owner) {return ; }@@ -1713,7 +1710,7 @@ struct file_operations {int (*mmap) (struct file *,struct vm_area_struct *);unsigned long mmap_supported_flags;int (*open) (struct inode *,struct file *); -int (*flush) (struct file *,fl_owner_t id); +int (*flush) (struct file *,void *id);int (*release) (struct inode *,struct file *);int (*fsync) (struct file *,loff_t ,loff_t ,int datasync);int (*fasync) (int ,struct file *,int );@@ -2397,7 +2394,7 @@ extern struct file *filp_open(const char *, int, umode_t);extern struct file *file_open_root (struct dentry *,struct vfsmount *,const char *,int ,umode_t );extern struct file *dentry_open (const struct path *,int ,const struct cred *); -extern int filp_close (struct file *,fl_owner_t id); +extern int filp_close (struct file *,void *id);extern struct filename *getname_flags (const char __user *,int ,int *);extern struct filename *getname (const char __user *);include/linux/lockd/lockd.h +2
-2@@ -119,14 +119,14 @@ static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host) }/* -* Map an fl_owner_t into a unique 32-bit "pid" +* Map a lock owner into a unique 32-bit "pid" */ struct nlm_lockowner {struct list_head list;refcount_t count;struct nlm_host *host; -fl_owner_t owner; +void *owner;uint32_t pid; };include/linux/nfs_fs.h +2
-2@@ -60,14 +60,14 @@ struct nfs_lock_context {refcount_t count;struct list_head list;struct nfs_open_context *open_context; -fl_owner_t lockowner; +void *lockowner;atomic_t io_count; };struct nfs4_state ;struct nfs_open_context {struct nfs_lock_context lock_context; -fl_owner_t flock_owner; +void *flock_owner;struct dentry *dentry;struct rpc_cred *cred;struct nfs4_state *state;include/trace/events/filelock.h +3
-3@@ -69,7 +69,7 @@ DECLARE_EVENT_CLASS(filelock_lock, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_pid) __field(unsigned int, fl_flags) __field(unsigned char, fl_type)@@ -123,7 +123,7 @@ DECLARE_EVENT_CLASS(filelock_lease, __field(unsigned long, i_ino) __field(dev_t, s_dev) __field(struct file_lock *, fl_next) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) __field(unsigned long, fl_break_time)@@ -176,7 +176,7 @@ TRACE_EVENT(generic_add_lease, __field(int, dcount) __field(int, icount) __field(dev_t, s_dev) - __field(fl_owner_t, fl_owner) + __field(void *, fl_owner) __field(unsigned int, fl_flags) __field(unsigned char, fl_type) ),ipc/mqueue.c +1
-1@@ -557,7 +557,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,return ret; } -static int mqueue_flush_file (struct file *filp,fl_owner_t id) +static int mqueue_flush_file (struct file *filp,void *id) {struct mqueue_inode_info *info =MQUEUE_I (file_inode (filp));