mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro,
Misc cleanups all over the place, mainly wrt /proc interfaces (switch
create_proc_entry to proc_create(), get rid of the deprecated
create_proc_read_entry() in favor of using proc_create_data() and
seq_file etc).
7kloc removed.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
don't bother with deferred freeing of fdtables
proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
proc: Make the PROC_I() and PDE() macros internal to procfs
proc: Supply a function to remove a proc entry by PDE
take cgroup_open() and cpuset_open() to fs/proc/base.c
ppc: Clean up scanlog
ppc: Clean up rtas_flash driver somewhat
hostap: proc: Use remove_proc_subtree()
drm: proc: Use remove_proc_subtree()
drm: proc: Use minor->index to label things, not PDE->name
drm: Constify drm_proc_list[]
zoran: Don't print proc_dir_entry data in debug
reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
proc: Supply an accessor for getting the data from a PDE's parent
airo: Use remove_proc_subtree()
rtl8192u: Don't need to save device proc dir PDE
rtl8187se: Use a dir under /proc/net/r8180/
proc: Add proc_mkdir_data()
proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
proc: Move PDE_NET() to fs/proc/proc_net.c
...
This commit is contained in:
commit
20b4fb4852
385 changed files with 7396 additions and 14540 deletions
|
|
@ -2527,11 +2527,8 @@ static int dvb_frontend_release(struct inode *inode, struct file *file)
|
|||
|
||||
if (dvbdev->users == -1) {
|
||||
wake_up(&fepriv->wait_queue);
|
||||
if (fepriv->exit != DVB_FE_NO_EXIT) {
|
||||
fops_put(file->f_op);
|
||||
file->f_op = NULL;
|
||||
if (fepriv->exit != DVB_FE_NO_EXIT)
|
||||
wake_up(&dvbdev->wait_queue);
|
||||
}
|
||||
if (fe->ops.ts_bus_ctrl)
|
||||
fe->ops.ts_bus_ctrl(fe, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1479,11 +1479,8 @@ static int dvb_net_close(struct inode *inode, struct file *file)
|
|||
|
||||
dvb_generic_release(inode, file);
|
||||
|
||||
if(dvbdev->users == 1 && dvbnet->exit == 1) {
|
||||
fops_put(file->f_op);
|
||||
file->f_op = NULL;
|
||||
if(dvbdev->users == 1 && dvbnet->exit == 1)
|
||||
wake_up(&dvbdev->wait_queue);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -259,80 +259,47 @@ void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev)
|
|||
static int cx25821_get_audio_data(struct cx25821_dev *dev,
|
||||
const struct sram_channel *sram_ch)
|
||||
{
|
||||
struct file *myfile;
|
||||
struct file *file;
|
||||
int frame_index_temp = dev->_audioframe_index;
|
||||
int i = 0;
|
||||
int line_size = AUDIO_LINE_SIZE;
|
||||
int frame_size = AUDIO_DATA_BUF_SZ;
|
||||
int frame_offset = frame_size * frame_index_temp;
|
||||
ssize_t vfs_read_retval = 0;
|
||||
char mybuf[line_size];
|
||||
char mybuf[AUDIO_LINE_SIZE];
|
||||
loff_t file_offset = dev->_audioframe_count * frame_size;
|
||||
loff_t pos;
|
||||
mm_segment_t old_fs;
|
||||
char *p = NULL;
|
||||
|
||||
if (dev->_audiofile_status == END_OF_FILE)
|
||||
return 0;
|
||||
|
||||
myfile = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0);
|
||||
|
||||
if (IS_ERR(myfile)) {
|
||||
const int open_errno = -PTR_ERR(myfile);
|
||||
pr_err("%s(): ERROR opening file(%s) with errno = %d!\n",
|
||||
__func__, dev->_audiofilename, open_errno);
|
||||
return PTR_ERR(myfile);
|
||||
} else {
|
||||
if (!(myfile->f_op)) {
|
||||
pr_err("%s(): File has no file operations registered!\n",
|
||||
__func__);
|
||||
filp_close(myfile, NULL);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (!myfile->f_op->read) {
|
||||
pr_err("%s(): File has no READ operations registered!\n",
|
||||
__func__);
|
||||
filp_close(myfile, NULL);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
pos = myfile->f_pos;
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
for (i = 0; i < dev->_audio_lines_count; i++) {
|
||||
pos = file_offset;
|
||||
|
||||
vfs_read_retval = vfs_read(myfile, mybuf, line_size,
|
||||
&pos);
|
||||
|
||||
if (vfs_read_retval > 0 && vfs_read_retval == line_size
|
||||
&& dev->_audiodata_buf_virt_addr != NULL) {
|
||||
memcpy((void *)(dev->_audiodata_buf_virt_addr +
|
||||
frame_offset / 4), mybuf,
|
||||
vfs_read_retval);
|
||||
}
|
||||
|
||||
file_offset += vfs_read_retval;
|
||||
frame_offset += vfs_read_retval;
|
||||
|
||||
if (vfs_read_retval < line_size) {
|
||||
pr_info("Done: exit %s() since no more bytes to read from Audio file\n",
|
||||
__func__);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
dev->_audioframe_count++;
|
||||
|
||||
dev->_audiofile_status = (vfs_read_retval == line_size) ?
|
||||
IN_PROGRESS : END_OF_FILE;
|
||||
|
||||
set_fs(old_fs);
|
||||
filp_close(myfile, NULL);
|
||||
file = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0);
|
||||
if (IS_ERR(file)) {
|
||||
pr_err("%s(): ERROR opening file(%s) with errno = %ld!\n",
|
||||
__func__, dev->_audiofilename, -PTR_ERR(file));
|
||||
return PTR_ERR(file);
|
||||
}
|
||||
|
||||
if (dev->_audiodata_buf_virt_addr)
|
||||
p = (char *)dev->_audiodata_buf_virt_addr + frame_offset;
|
||||
|
||||
for (i = 0; i < dev->_audio_lines_count; i++) {
|
||||
int n = kernel_read(file, file_offset, mybuf, AUDIO_LINE_SIZE);
|
||||
if (n < AUDIO_LINE_SIZE) {
|
||||
pr_info("Done: exit %s() since no more bytes to read from Audio file\n",
|
||||
__func__);
|
||||
dev->_audiofile_status = END_OF_FILE;
|
||||
fput(file);
|
||||
return 0;
|
||||
}
|
||||
dev->_audiofile_status = IN_PROGRESS;
|
||||
if (p) {
|
||||
memcpy(p, mybuf, n);
|
||||
p += n;
|
||||
}
|
||||
file_offset += n;
|
||||
}
|
||||
dev->_audioframe_count++;
|
||||
fput(file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -354,81 +321,41 @@ static void cx25821_audioups_handler(struct work_struct *work)
|
|||
static int cx25821_openfile_audio(struct cx25821_dev *dev,
|
||||
const struct sram_channel *sram_ch)
|
||||
{
|
||||
struct file *myfile;
|
||||
int i = 0, j = 0;
|
||||
int line_size = AUDIO_LINE_SIZE;
|
||||
ssize_t vfs_read_retval = 0;
|
||||
char mybuf[line_size];
|
||||
loff_t pos;
|
||||
loff_t offset = (unsigned long)0;
|
||||
mm_segment_t old_fs;
|
||||
char *p = (void *)dev->_audiodata_buf_virt_addr;
|
||||
struct file *file;
|
||||
loff_t offset;
|
||||
int i, j;
|
||||
|
||||
myfile = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0);
|
||||
|
||||
if (IS_ERR(myfile)) {
|
||||
const int open_errno = -PTR_ERR(myfile);
|
||||
pr_err("%s(): ERROR opening file(%s) with errno = %d!\n",
|
||||
__func__, dev->_audiofilename, open_errno);
|
||||
return PTR_ERR(myfile);
|
||||
} else {
|
||||
if (!(myfile->f_op)) {
|
||||
pr_err("%s(): File has no file operations registered!\n",
|
||||
__func__);
|
||||
filp_close(myfile, NULL);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (!myfile->f_op->read) {
|
||||
pr_err("%s(): File has no READ operations registered!\n",
|
||||
__func__);
|
||||
filp_close(myfile, NULL);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
pos = myfile->f_pos;
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
for (j = 0; j < NUM_AUDIO_FRAMES; j++) {
|
||||
for (i = 0; i < dev->_audio_lines_count; i++) {
|
||||
pos = offset;
|
||||
|
||||
vfs_read_retval = vfs_read(myfile, mybuf,
|
||||
line_size, &pos);
|
||||
|
||||
if (vfs_read_retval > 0 &&
|
||||
vfs_read_retval == line_size &&
|
||||
dev->_audiodata_buf_virt_addr != NULL) {
|
||||
memcpy((void *)(dev->
|
||||
_audiodata_buf_virt_addr
|
||||
+ offset / 4), mybuf,
|
||||
vfs_read_retval);
|
||||
}
|
||||
|
||||
offset += vfs_read_retval;
|
||||
|
||||
if (vfs_read_retval < line_size) {
|
||||
pr_info("Done: exit %s() since no more bytes to read from Audio file\n",
|
||||
__func__);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
dev->_audioframe_count++;
|
||||
|
||||
if (vfs_read_retval < line_size)
|
||||
break;
|
||||
}
|
||||
|
||||
dev->_audiofile_status = (vfs_read_retval == line_size) ?
|
||||
IN_PROGRESS : END_OF_FILE;
|
||||
|
||||
set_fs(old_fs);
|
||||
myfile->f_pos = 0;
|
||||
filp_close(myfile, NULL);
|
||||
file = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0);
|
||||
if (IS_ERR(file)) {
|
||||
pr_err("%s(): ERROR opening file(%s) with errno = %ld!\n",
|
||||
__func__, dev->_audiofilename, PTR_ERR(file));
|
||||
return PTR_ERR(file);
|
||||
}
|
||||
|
||||
for (j = 0, offset = 0; j < NUM_AUDIO_FRAMES; j++) {
|
||||
for (i = 0; i < dev->_audio_lines_count; i++) {
|
||||
char buf[AUDIO_LINE_SIZE];
|
||||
int n = kernel_read(file, offset, buf,
|
||||
AUDIO_LINE_SIZE);
|
||||
|
||||
if (n < AUDIO_LINE_SIZE) {
|
||||
pr_info("Done: exit %s() since no more bytes to read from Audio file\n",
|
||||
__func__);
|
||||
dev->_audiofile_status = END_OF_FILE;
|
||||
fput(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (p)
|
||||
memcpy(p + offset, buf, n);
|
||||
|
||||
offset += n;
|
||||
}
|
||||
dev->_audioframe_count++;
|
||||
}
|
||||
dev->_audiofile_status = IN_PROGRESS;
|
||||
fput(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ int av7110_ir_init(struct av7110 *av7110)
|
|||
if (av_cnt == 1) {
|
||||
e = proc_create("av7110_ir", S_IWUSR, NULL, &av7110_ir_proc_fops);
|
||||
if (e)
|
||||
e->size = 4 + 256 * sizeof(u16);
|
||||
proc_set_size(e, 4 + 256 * sizeof(u16));
|
||||
}
|
||||
|
||||
tasklet_init(&av7110->ir.ir_tasklet, av7110_emit_key, (unsigned long) &av7110->ir);
|
||||
|
|
|
|||
|
|
@ -130,14 +130,14 @@ static int zoran_show(struct seq_file *p, void *v)
|
|||
|
||||
static int zoran_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct zoran *data = PDE(inode)->data;
|
||||
struct zoran *data = PDE_DATA(inode);
|
||||
return single_open(file, zoran_show, data);
|
||||
}
|
||||
|
||||
static ssize_t zoran_write(struct file *file, const char __user *buffer,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct zoran *zr = PDE(file_inode(file))->data;
|
||||
struct zoran *zr = PDE_DATA(file_inode(file));
|
||||
char *string, *sp;
|
||||
char *line, *ldelim, *varname, *svar, *tdelim;
|
||||
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ static void ir_lirc_close(void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
static struct file_operations lirc_fops = {
|
||||
static const struct file_operations lirc_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.write = ir_lirc_transmit_ir,
|
||||
.unlocked_ioctl = ir_lirc_ioctl,
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static int lirc_thread(void *irctl)
|
|||
}
|
||||
|
||||
|
||||
static struct file_operations lirc_dev_fops = {
|
||||
static const struct file_operations lirc_dev_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = lirc_dev_fop_read,
|
||||
.write = lirc_dev_fop_write,
|
||||
|
|
|
|||
Loading…
Reference in a new issue