summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/lightnvm.c
Commit message (Expand)AuthorAgeFilesLines
* lightnvm: remove minor version check for 2.0Matias Bjørling2018-08-061-6/+0Star
* nvme: simplify the API for getting log pagesChristoph Hellwig2018-07-271-2/+3
* lightnvm: limit get chunk meta request sizeMatias Bjørling2018-07-131-2/+8
* lightnvm: Remove redundant rq->__data_len initializationBart Van Assche2018-07-131-4/+2Star
* lightnvm: remove function name in stringsMatias Bjørling2018-03-301-6/+6
* lightnvm: implement get log report chunk helpersJavier González2018-03-301-0/+74
* lightnvm: normalize geometry nomenclatureJavier González2018-03-301-27/+27
* lightnvm: complete geo structure with maxoc*Javier González2018-03-301-0/+17
* lightnvm: add shorten OCSSD version in geoJavier González2018-03-301-0/+6
* lightnvm: add minor version to generic geometryJavier González2018-03-301-5/+20
* lightnvm: simplify geometry structureJavier González2018-03-301-138/+199
* nvme: lightnvm: add late setup of block size and metadataMatias Bjørling2018-03-301-0/+8
* lightnvm: remove nvm_dev_ops->max_phys_sectMatias Bjørling2018-03-301-4/+1Star
* lightnvm: add 2.0 geometry identificationMatias Bjørling2018-03-301-49/+289
* lightnvm: flatten nvm_id_group into nvm_idMatias Bjørling2018-03-301-55/+51Star
* lightnvm: make 1.2 data structures explicitMatias Bjørling2018-03-301-41/+41
* lightnvm: remove multiple groups in 1.2 data structureMatias Bjørling2018-03-301-2/+3
* lightnvm: remove mlc pairs structureMatias Bjørling2018-03-301-13/+1Star
* lightnvm: remove chnl_offset in nvme_nvm_identityMatias Bjørling2018-03-301-3/+1Star
* lightnvm: make geometry structures 2.0 readyMatias Bjørling2018-01-051-29/+50
* lightnvm: remove lower page tablesMatias Bjørling2018-01-051-14/+0Star
* lightnvm: remove hybrid ocssd 1.2 supportMatias Bjørling2018-01-051-96/+0Star
* nvme: track shared namespacesChristoph Hellwig2017-11-111-7/+7
* lightnvm: implement generic path for sync I/OJavier González2017-10-131-14/+56
* lightnvm: fail fast on passthrough commandsJavier González2017-10-131-2/+0Star
* nvme: fix lightnvm checkChristoph Hellwig2017-09-111-26/+0Star
* block: replace bi_bdev with a gendisk pointer and partitions indexChristoph Hellwig2017-08-231-13/+2Star
* lightnvm: propagate right error code to targetJavier González2017-06-271-1/+1
* nvmet: use NVME_IDENTIFY_DATA_SIZEJohannes Thumshirn2017-06-151-1/+1
* block: introduce new block status code typeChristoph Hellwig2017-06-091-1/+1
* nvme-lightnvm: use blk_execute_rq in nvme_nvm_submit_user_cmdChristoph Hellwig2017-06-091-11/+1Star
* nvme: lightnvm: fix memory leakRakesh Pandit2017-05-101-1/+2
* lightnvm: remove unused rq parameter of nvme_nvm_rqtocmd() to kill warningGeert Uytterhoeven2017-05-081-3/+3
* lightnvm: create cmd before allocating requestJavier González2017-05-041-2/+2
* nvme-lightnvm: add missing endianess conversion in nvme_nvm_end_ioChristoph Hellwig2017-04-251-1/+1
* nvme: make nvme_error_status privateChristoph Hellwig2017-04-201-3/+3
* nvme: split nvme status from block req->errorsChristoph Hellwig2017-04-201-3/+6
* lightnvm: Use blk_init_request_from_bio() instead of open-coding itBart Van Assche2017-04-201-5/+1Star
* lightnvm: bad type conversion for nvme control bitsJavier González2017-04-161-1/+1
* lightnvm: enable nvme size compile assertsMatias Bjørling2017-04-161-2/+4
* lightnvm: submit erases using the I/O pathJavier González2017-04-161-22/+10Star
* nvme/lightnvm: Prevent small buffer overflow in nvme_nvm_identifyScott Bauer2017-04-161-1/+1
* lightnvm: use end_io callback instead of instanceMatias Bjørling2017-01-311-1/+2
* lightnvm: add ioctls for vector I/OsMatias Bjørling2017-01-311-0/+220
* lightnvm: reduce number of nvm_id groups to oneMatias Bjørling2017-01-311-45/+42Star
* lightnvm: merge gennvm with coreMatias Bjørling2017-01-311-4/+3Star
* lightnvm: eliminate nvm_lun abstraction in mmJavier González2016-11-291-0/+3
* lightnvm: move block provisioning to targetsJavier González2016-11-291-2/+9
* lightnvm: enable to send hint to erase commandJavier González2016-11-291-0/+1
* nvme: lightnvm: attach lightnvm sysfs to nvme block deviceMatias Bjørling2016-11-291-12/+163
n class="hl opt">; over: /* Ran out of filps - report that */ if (get_nr_files() > old_max) { pr_info("VFS: file-max limit %lu reached\n", get_max_files()); old_max = get_nr_files(); } return ERR_PTR(-ENFILE); } /** * alloc_file - allocate and initialize a 'struct file' * * @path: the (dentry, vfsmount) pair for the new file * @mode: the mode with which the new file will be opened * @fop: the 'struct file_operations' for the new file */ struct file *alloc_file(struct path *path, fmode_t mode, const struct file_operations *fop) { struct file *file; file = get_empty_filp(); if (IS_ERR(file)) return file; file->f_path = *path; file->f_inode = path->dentry->d_inode; file->f_mapping = path->dentry->d_inode->i_mapping; if ((mode & FMODE_READ) && likely(fop->read || fop->read_iter)) mode |= FMODE_CAN_READ; if ((mode & FMODE_WRITE) && likely(fop->write || fop->write_iter)) mode |= FMODE_CAN_WRITE; file->f_mode = mode; file->f_op = fop; if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) i_readcount_inc(path->dentry->d_inode); return file; } EXPORT_SYMBOL(alloc_file); /* the real guts of fput() - releasing the last reference to file */ static void __fput(struct file *file) { struct dentry *dentry = file->f_path.dentry; struct vfsmount *mnt = file->f_path.mnt; struct inode *inode = file->f_inode; might_sleep(); fsnotify_close(file); /* * The function eventpoll_release() should be the first called * in the file cleanup chain. */ eventpoll_release(file); locks_remove_file(file); if (unlikely(file->f_flags & FASYNC)) { if (file->f_op->fasync) file->f_op->fasync(-1, file, 0); } ima_file_free(file); if (file->f_op->release) file->f_op->release(inode, file); security_file_free(file); if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL && !(file->f_mode & FMODE_PATH))) { cdev_put(inode->i_cdev); } fops_put(file->f_op); put_pid(file->f_owner.pid); if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) i_readcount_dec(inode); if (file->f_mode & FMODE_WRITER) { put_write_access(inode); __mnt_drop_write(mnt); } file->f_path.dentry = NULL; file->f_path.mnt = NULL; file->f_inode = NULL; file_free(file); dput(dentry); mntput(mnt); } static LLIST_HEAD(delayed_fput_list); static void delayed_fput(struct work_struct *unused) { struct llist_node *node = llist_del_all(&delayed_fput_list); struct llist_node *next; for (; node; node = next) { next = llist_next(node); __fput(llist_entry(node, struct file, f_u.fu_llist)); } } static void ____fput(struct callback_head *work) { __fput(container_of(work, struct file, f_u.fu_rcuhead)); } /* * If kernel thread really needs to have the final fput() it has done * to complete, call this. The only user right now is the boot - we * *do* need to make sure our writes to binaries on initramfs has * not left us with opened struct file waiting for __fput() - execve() * won't work without that. Please, don't add more callers without * very good reasons; in particular, never call that with locks * held and never call that from a thread that might need to do * some work on any kind of umount. */ void flush_delayed_fput(void) { delayed_fput(NULL); } static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput); void fput(struct file *file) { if (atomic_long_dec_and_test(&file->f_count)) { struct task_struct *task = current; if (likely(!in_interrupt() && !(task->flags & PF_KTHREAD))) { init_task_work(&file->f_u.fu_rcuhead, ____fput); if (!task_work_add(task, &file->f_u.fu_rcuhead, true)) return; /* * After this task has run exit_task_work(), * task_work_add() will fail. Fall through to delayed * fput to avoid leaking *file. */ } if (llist_add(&file->f_u.fu_llist, &delayed_fput_list)) schedule_delayed_work(&delayed_fput_work, 1); } } /* * synchronous analog of fput(); for kernel threads that might be needed * in some umount() (and thus can't use flush_delayed_fput() without * risking deadlocks), need to wait for completion of __fput() and know * for this specific struct file it won't involve anything that would * need them. Use only if you really need it - at the very least, * don't blindly convert fput() by kernel thread to that. */ void __fput_sync(struct file *file) { if (atomic_long_dec_and_test(&file->f_count)) { struct task_struct *task = current; BUG_ON(!(task->flags & PF_KTHREAD)); __fput(file); } } EXPORT_SYMBOL(fput); void put_filp(struct file *file) { if (atomic_long_dec_and_test(&file->f_count)) { security_file_free(file); file_free(file); } } void __init files_init(unsigned long mempages) { unsigned long n; filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); /* * One file with associated inode and dcache is very roughly 1K. * Per default don't use more than 10% of our memory for files. */ n = (mempages * (PAGE_SIZE / 1024)) / 10; files_stat.max_files = max_t(unsigned long, n, NR_FILE); percpu_counter_init(&nr_files, 0, GFP_KERNEL); }