Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755238AbbF0SAR (ORCPT ); Sat, 27 Jun 2015 14:00:17 -0400 Received: from mout3.freenet.de ([195.4.92.93]:37087 "EHLO mout3.freenet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151AbbF0SAK (ORCPT ); Sat, 27 Jun 2015 14:00:10 -0400 X-Greylist: delayed 1522 seconds by postgrey-1.27 at vger.kernel.org; Sat, 27 Jun 2015 14:00:10 EDT From: Andreas Hartmann X-Newsgroups: linux.kernel Subject: f_op->read seems to be always NULL since Linux 4.1 Date: Sat, 27 Jun 2015 19:32:39 +0200 Organization: privat Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 To: linux-kernel@vger.kernel.org X-Originated-At: 217.234.234.219!48202 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1823 Lines: 77 Hello! Given is a module like the following snippet running fine w/ Linux 4.0 and ext4 fs - but doesn't work w/ Linux 4.1 because f->f_op->read is not defined any more (= NULL). Is this the intended behavior now? vfs_read(f, buf, 128, &f->f_pos) works fine. module.c -------------------------------------------------------------------- #include #include #include #include int init_module(void) { struct file *f; char buf[128]; mm_segment_t fs; int i; int len=128; for(i=0;if_op->read) { f->f_op->read(f, buf, len, &f->f_pos); printk(KERN_INFO "buf:%s\n",buf); } else { printk(KERN_INFO "No read method\n"); } set_fs(fs); } filp_close(f,NULL); return 0; } void cleanup_module(void) { printk(KERN_INFO "My module is unloaded\n"); } ----------------------------------------------------------- Makefile: ----------------------------------------------------------- obj-m += module.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean ------------------------------------------------------------ Regards, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/