All of lore.kernel.org
 help / color / mirror / Atom feed
* mmotm 2009-01-14-20-31 uploaded
@ 2009-01-15  4:32 akpm
  2009-01-15 19:13   ` Randy Dunlap
  0 siblings, 1 reply; 23+ messages in thread
From: akpm @ 2009-01-15  4:32 UTC (permalink / raw)
  To: mm-commits, linux-kernel

The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to

   http://userweb.kernel.org/~akpm/mmotm/

and will soon be available at

   git://git.zen-sources.org/zen/mmotm.git

It contains the following patches against 2.6.29-rc1:

origin.patch
kernel-upc-omit-it-if-smp=y-use_generic_smp_helpers=n.patch
update-of-documentation-vmtxt-and-proctxt.patch
atmel_serial-fix-flow-control-bug.patch
atmel_spi-allow-transfer-when-max_speed_hz-=-0.patch
gpio-fix-probe-error-return-in-gpio-driver-probes.patch
video-framebuffer-fix-bug-jpegview-cannot-work-on-framebuffer-device-other-than-16bpp.patch
alpha-fix-vmalloc-breakage.patch
alpha-fix-vmalloc-breakage-fix.patch
edac-add-maintainers-entry-for-i5400-edac-driver.patch
sysrq-documentation-remove-the-redundant-updated-date.patch
sysrq-documentation-document-why-the-command-header-only-is-shown.patch
sysrq-add-commentary-on-why-we-use-the-console-loglevel-over-using-kern_emerg.patch
rtc-tw4030-add-alarm-update-interfaces-v2.patch
rtc-pxa-fix-build-failure.patch
rtc-rtc-twl4030-dont-mask-alarm-interrupts-on-shutdown.patch
sgi-xp-eliminate-false-detection-of-no-heartbeat.patch
synclink_gt-enable-ri-interrupt.patch
cgroups-clean-up-kconfig.patch
cgroups-consolidate-cgroup-documents.patch
idr-fix-wrong-kernel-doc.patch
documentation-accounting-getdelaysc-fix-endless-loop.patch
jbd-fix-missing-kernel-doc.patch
resources-fix-parameter-name-and-kernel-doc.patch
maintainers-add-entry-for-freezer.patch
btrfs-squashfs-move-btrfs-and-squashfstos-magic-number-to-linux-magich.patch
nbd-do-not-allow-two-clients-at-the-same-time.patch
checkpatch-handle-missing-if-open-in-context.patch
checkpatch-type-cast-spacing-should-not-check-prefix-spacing.patch
checkpatch-allow-parentheses-on-return-handle-array-values.patch
checkpatch-if-should-not-continue-a-preceeding-brace.patch
checkpatch-struct-seq_operations-should-normally-be-const.patch
checkpatch-version-027.patch
hwmon-applesmc-fix-light-sensor-readings-on-newer-macbooks.patch
memcg-fix-mem_cgroup_get_reclaim_stat_from_page.patch
memcg-fix-error-path-of-mem_cgroup_move_parent.patch
memcg-fix-hierarchical-reclaim.patch
memcg-make-oom-less-frequently.patch
revert-mm-vmalloc-use-mutex-for-purge.patch
kprobes-fix-module-compilation-error-with-config_kprobes=n.patch
kprobes-fix-module-compilation-error-with-config_kprobes=n-fix.patch
kprobes-fix-module-compilation-error-with-config_kprobes=n-fix-fix.patch
alpha-nautilus-fix-compile-failure-with-gcc-43.patch
alpha-nautilus-fix-hang-on-boot.patch
alpha-fix-rtc-on-marvel.patch
alpha-gitignore-vmlinuxlds.patch
alpha-make-pte_alloc_one_kernel-inline.patch
lib-idrc-use-kmem_cache_zalloc-for-the-idr_layer-cache.patch
lis3lv02d-merge-with-leds-hp-disk.patch
lis3-fix-documentation-to-fit-into-80-columns.patch
hp_accel-do-not-call-acpi-from-invalid-context.patch
hp_accel-do-not-call-acpi-from-invalid-context-fix.patch
memcg-fix-section-mismatch.patch
memcg-fix-a-race-when-setting-memoryswappiness.patch
include-of-linux-typesh-is-preferred-over-asm-typesh.patch
i-need-old-gcc.patch
mm-remove-the-might_sleep-from-lock_page.patch
repeatable-slab-corruption-with-ltp-msgctl08.patch
linux-next.patch
next-remove-localversion.patch
arch-ia64-kernel-ia64_ksymsc-dont-export-copy_page-twice.patch
acpi-check-_pss-invalidation-when-bios-report-_pss-with-all-0x80000000.patch
mm-only-enforce-acpi-resource-conflict-checks.patch
x86-hpet-allow-force-enable-on-ich10-hpet.patch
x86-mark-complex-bitopsh-inlines-as-__always_inline.patch
thinkpad-acpi-split-delayed-leds-stuff-clean-up-code.patch
thinkpad-acpi-split-delayed-leds-stuff-clean-up-code-checkpatch-fixes.patch
kgdb-fix-kernel-doc-error.patch
auditsc-fix-kernel-doc-notation.patch
audit-execve-record-remove-bogus-newline.patch
pcmcia-pccard-deadlock-fix.patch
early-platform-drivers-v2.patch
drivers-consolidate-driver_probe_done-loops-into-one-place.patch
drivers-consolidate-driver_probe_done-loops-into-one-place-fix.patch
drivers-consolidate-driver_probe_done-loops-into-one-place-checkpatch-fixes.patch
resume-wait-for-device-probing-to-finish.patch
i2c-incremental-i2c-mpc-driver-fix-for-multi-master-i2c-busses.patch
i2c-fix-i2c-mpc-driver-for-multi-master-i2c-busses.patch
clocksource-pass-clocksource-to-read-callback.patch
clocksource-add-enable-and-disable-callbacks.patch
input-touchscreen-driver-add-support-ad7877-touchscreen-driver.patch
input-mousedev-distinguish-a-moving-finger-from-a-tapping-finger.patch
input-ad7879-touchscreen-driver.patch
input-mouse-alpsc-handle-touchpoints-buttons-correctly.patch
input-ads7846c-sparse-lock-annotation.patch
drivers-input-keyboard-atkbdc-use-function-for-generation-of-keyrelease-events.patch
drivers-input-keyboard-atkbdc-fujitsu-siemens-amilo-pa-1510-quirks.patch
input-allow-certain-ev_abs-events-to-bypass-all-filtering.patch
es-input-allow-certain-ev_abs-events-to-bypass-all-filtering-fix.patch
input-add-a-detailed-multi-touch-finger-data-report-protocol-rev2.patch
input-keyboard-hilkbdc-fix-crash-when-removing-hilkbd-module.patch
drivers-input-serio-hp_sdcc-fix-crash-when-removing-hp_sdc-module.patch
kbuild-fix-kbuildtxt-typos.patch
dmar-fix-endless-unknown-dmar-structure-type-loop.patch
drivers-ata-pata_alic-s-isa_bridge-ali_isa_bridge-to-fix-alpha-build.patch
sm501-fix-section-mismatches.patch
ricoh_mmc-use-suspend-resume_noirq-v2.patch
mmc-s3cmci-fix-hangup-in-do_pio_write.patch
mmc-fixes-and-enhancements-for-the-mmc-spi-driver.patch
mmc-add-modalias-linkage-for-mmc-sd-devices.patch
blackfin-nfc-driver-do-not-clobber-dmac1_perimux.patch
blackfin-nfc-driver-mark-bf5xx_nand_add_partition-as-__devinit.patch
blackfin-nfc-driver-drop-pointless-casts-with-set_dma_callback.patch
jffs2-force-the-jffs2-gc-daemon-to-behave-a-bit-better.patch
forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623.patch
sis900-generate-fake-mac-address-if-the-hardware-doesnt-have-one.patch
e1000e-make-e1000e-default-to-the-same-kconfig-setting-as-e1000.patch
3x59x-fix-pci-resource-management.patch
gpio_free-might-sleep-blackfin-architecture.patch
ext4-allocate-s_blockgroup_lock-separately.patch
ext4-dont-inherit-inappropriate-inode-flags-from-parent.patch
ext4-tighten-restrictions-on-inode-flags.patch
sunrpc-fix-rdma-dependency.patch
pci-msi-bugfix-utilize-for-msi_capability_init.patch
fakephp-allocate-pci-resources-before-adding-the-device.patch
pci-quirks-unhide-overflow-device-on-i828675p-pe-chipsets.patch
pci-quirks-hp-hides-smbus-controller-in-compaq-nx9500-laptops.patch
pci-fix-missing-kernel-doc-and-typos.patch
pcih-fix-struct-pci_platform_pm_ops-kernel-doc.patch
kernel-trace-ring_bufferc-reduce-inlining.patch
kernel-trace-ring_bufferc-use-div_round_up.patch
irq-free-setup_irq-interrupt-using-free_irq.patch
if-0-ses_match_host.patch
scsi-replace-__inline-with-inline.patch
mpt-remove-unused-struct-mpt_proc_entry_t.patch
scsi-use-the-common-hex_asc-array-rather-than-a-private-one.patch
drivers-scsi-a2091c-make-2-functions-static.patch
drivers-scsi-a3000c-make-2-functions-static.patch
scsi-gdthc-use-unaligned-access-helpers.patch
scsi-annotate-gdth_rdcap_data-gdth_rdcap16_data-endianness.patch
esp-fix-section-mismatch-warning.patch
sg_io-dont-perform-unneeded-copy-in-compat-code.patch
scsi-mpt-suppress-debugobjects-warning.patch
paride-pgc-xs-confusion.patch
radio-si470x-add-usb-id-for-dealextreme-usb-radio.patch
usb-another-unusual_devs-entry-for-another-bad-argosy-storage-device.patch
usb-kill-prehistorical-comments-about-usb_ehci_hcd.patch
usb-driver-for-freescale-quicc-engine-usb-host-controller.patch
usb-driver-for-freescale-quicc-engine-usb-host-controller-update.patch
usb-fsl_qe_udc-fix-oops-on-qe-udc-probe-failure.patch
usb-fsl_qe_udc-fix-recursive-locking-bug-in-ch9getstatus.patch
usb-fsl_qe_udc-fix-qe-usb-controller-initialization.patch
usb-fsl_qe_udc-fix-disconnects-reporting-during-bus-reset.patch
usb-fsl_qe_udc-fix-muram-corruption-by-disabled-endpoints.patch
usb-fsl_qe_udc-fix-stalled-tx-requests-bug.patch
vfs-fix-vfs_rename_dir-for-fs_rename_does_d_move-filesystems.patch
raw-fix-rawctl-compat-ioctls-breakage-on-amd64-and-itanic.patch
mm.patch
ext2-update-also-inode-on-disk-when-dir-is-is_dirsync.patch
ext2-update-also-inode-on-disk-when-dir-is-is_dirsync-fix.patch
scripts-add-x86-register-parser-to-markup_oopspl.patch
scripts-add-x86-64-bit-support-to-the-markup_oopspl-script.patch
9p-disallow-rdma-if-rdma-cm-isnt-available.patch
ext2-add-blk_issue_flush-to-syncing-paths.patch
max3100-spi-uart-driver.patch
scsi-dpt_i2o-is-bust-on-ia64.patch
acpi-kconfig-fix-acpi_container-module-name.patch
arm-at91-fix-nr_aic_irqs-undeclared.patch
drivers-net-irda-irda-usbc-fix-buffer-overflow.patch
nommu-fix-a-number-of-issues-with-the-per-mm-vma-patch.patch
powerpc-fix-code-for-reserved-memory-spanning-across-nodes.patch
mm-mminit_validate_memmodel_limits-get-rid-of-redundant-test.patch
vmap-remove-needless-lock-and-list-in-vmap.patch
oom_kill-dont-call-for-int_sqrt0.patch
page_fault-retry-with-nopage_retry.patch
page_fault-retry-with-nopage_retry-fix-3.patch
page_fault-retry-with-nopage_retry-fix-3-fix.patch
radix-tree-gang-set-if-tagged-operation.patch
mm-shmemc-fix-division-by-zero.patch
mm-fix-pdflush-thread-creation-upper-bound.patch
mm-add-proc-controls-for-pdflush-threads.patch
mm-add-proc-controls-for-pdflush-threads-fix.patch
mm-add-proc-controls-for-pdflush-threads-fix-fix.patch
proc-pid-maps-dont-show-pgoff-of-pure-anon-vmas.patch
proc-pid-maps-dont-show-pgoff-of-pure-anon-vmas-checkpatch-fixes.patch
loop-add-ioctl-to-resize-a-loop-device.patch
loop-add-ioctl-to-resize-a-loop-device-security-check-for-loop_set_capacity.patch
loop-add-ioctl-to-resize-a-loop-device-loop_set_capacity-sector_t-may-be-narrow-for-bit-shfit.patch
getrusage-fill-ru_maxrss-value.patch
softirq-introduce-statistics-for-softirq.patch
proc-export-statistics-for-softirq-to-proc.patch
proc-export-statistics-for-softirq-to-proc-fix.patch
proc-update-document-for-proc-softirqs-and-proc-stat.patch
pci-use-pci_ioremap_bar-in-drivers-serial.patch
8250_pci-add-support-for-netmos-9835.patch
kprobes-cleanup-aggr_kprobe-related-code.patch
kprobes-move-export_symbol_gpl-just-after-function-definitions.patch
kprobes-cleanup-comment-style-in-kprobesh.patch
kprobes-rename-kprobe_enabled-to-kprobes_all_disarmed.patch
kprobes-support-per-kprobe-disabling.patch
kprobes-support-kretprobe-and-jprobe-per-probe-disabling.patch
rtc-convert-wm8350-use-new-alarm-and-update-operations.patch
rtc-convert-leap_year-into-an-inline.patch
rtc-add-platform-driver-for-efi.patch
rtc-add-platform-driver-for-efi-fix.patch
gpiolib-allow-gpios-to-be-named.patch
lxfb-fix-it-for-directfb-usage.patch
intelfb-support-i854.patch
pnpbios-fix-warning-if-no-hotplug.patch
pnpbios-propagate-kthread_run-error.patch
ext3-remove-the-bkl-in-ext3-ioctlc.patch
hfsplus-identify-journal-info-block-in-volume-header.patch
hfsplus-fix-journal-detection.patch
ufs-sector_t-cannot-be-negative.patch
ufs-validate-maximum-fast-symlink-size-from-superblock.patch
ufs-dont-truncate-longer-ufs2-fast-symlinks.patch
ufs-ensure-fast-symlinks-are-nul-terminated.patch
ufs-copy-symlink-data-into-the-correct-union-member.patch
relax-ns_can_attach-checks-to-allow-attaching-to-grandchild-cgroups.patch
bin_elf_fdpic-check-the-return-value-of-clear_user.patch
nbd-trivial-cleanups.patch
relay-reset-consumed.patch
trace-code-and-documentation.patch
trace-code-and-documentation-merging-documentation-tracetxt-with-documentation-filesystems-relaytxt.patch
trace-sample.patch
edac-add-more-verbose-debug-info.patch
synchronize-device-shutdown.patch
serios-async-shutdown.patch
sd-async-shutdown.patch
linuxpps-core-support.patch
linuxpps-core-support-sysfs-not-needed-variables-removed.patch
pps-userland-header-file-for-pps-api.patch
pps-documentation-programs-and-examples.patch
pps-linuxpps-clients-support.patch
ldisc-new-dcd_change-method-for-line-disciplines.patch
pps-parallel-port-clients-support.patch
factor-out-ifdefs-from-kernel-spinlockc-to-lock_contended_flags.patch
allow-rwlocks-to-re-enable-interrupts.patch
ia64-implement-interrupt-enabling-rwlocks.patch
nilfs2-add-document.patch
nilfs2-disk-format-and-userland-interface.patch
nilfs2-add-inode-and-other-major-structures.patch
nilfs2-integrated-block-mapping.patch
nilfs2-integrated-block-mapping-remove-nilfs-bmap-wrapper-macros.patch
nilfs2-integrated-block-mapping-remove-nilfs-bmap-wrapper-macros-checkpatch-fixes.patch
nilfs2-b-tree-based-block-mapping.patch
nilfs2-direct-block-mapping.patch
nilfs2-b-tree-node-cache.patch
nilfs2-buffer-and-page-operations.patch
nilfs2-meta-data-file.patch
nilfs2-persistent-object-allocator.patch
nilfs2-disk-address-translator.patch
nilfs2-inode-map-file.patch
nilfs2-checkpoint-file.patch
nilfs2-segment-usage-file.patch
nilfs2-inode-operations.patch
nilfs2-inode-operations-fix.patch
nilfs2-file-operations.patch
nilfs2-directory-entry-operations.patch
nilfs2-pathname-operations.patch
nilfs2-pathname-operations-fix.patch
nilfs2-operations-for-the_nilfs-core-object.patch
nilfs2-super-block-operations.patch
nilfs2-super-block-operations-fix.patch
nilfs2-segment-buffer.patch
nilfs2-segment-constructor.patch
nilfs2-segment-constructor-insert-checks-and-hole-block-allocation-in-page_mkwrite.patch
nilfs2-fix-miss-sync-issue-for-do_sync_mapping_range.patch
nilfs2-recovery-functions.patch
nilfs2-another-dat-for-garbage-collection.patch
nilfs2-block-cache-for-garbage-collection.patch
nilfs2-ioctl-operations.patch
nilfs2-update-makefile-and-kconfig.patch
nilfs2-fix-problems-of-memory-allocation-in-ioctl.patch
nilfs2-cleanup-nilfs_clear_inode.patch
nilfs2-avoid-double-error-caused-by-nilfs_transaction_end.patch
nilfs2-insert-explanations-in-gcinode-file.patch
nilfs2-add-maintainer.patch
nilfs2-fix-gc-failure-on-volumes-keeping-numerous-snapshots.patch
nilfs2-clean-up-indirect-function-calling-conventions.patch
reiser4-vfs-add-super_operationssync_inodes-2.patch
reiser4-export-remove_from_page_cache.patch
reiser4-export-find_get_pages.patch
reiser4.patch
reiser4-adjust-to-the-new-aops.patch
reiser4-adjust-to-the-new-aops-fixup.patch
reiser4-remove-simple_prepare_write-usage.patch
reiser4-remove-simple_prepare_write-usage-checkpatch-fixes.patch
fs-symlink-write_begin-allocation-context-fix-reiser4-fix.patch
reiser4-handling-error-returned-by-d_obtain_alias-fixup.patch
make-sure-nobodys-leaking-resources.patch
journal_add_journal_head-debug.patch
releasing-resources-with-children.patch
make-frame_pointer-default=y.patch
mutex-subsystem-synchro-test-module.patch
slab-leaks3-default-y.patch
put_bh-debug.patch
add-debugging-aid-for-memory-initialisation-problems.patch
shrink_slab-handle-bad-shrinkers.patch
keep-track-of-network-interface-renaming.patch
workaround-for-a-pci-restoring-bug.patch
prio_tree-debugging-patch.patch
single_open-seq_release-leak-diagnostics.patch
add-a-refcount-check-in-dput.patch
getblk-handle-2tb-devices.patch
getblk-handle-2tb-devices-fix.patch
undeprecate-pci_find_device.patch
notify_change-callers-must-hold-i_mutex.patch
drivers-net-bonding-bond_sysfsc-suppress-uninitialized-var-warning.patch
w1-build-fix.patch

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-15  4:32 mmotm 2009-01-14-20-31 uploaded akpm
@ 2009-01-15 19:13   ` Randy Dunlap
  0 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-15 19:13 UTC (permalink / raw)
  To: cluster-devel.redhat.com

akpm at linux-foundation.org wrote:
> The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> 
>    http://userweb.kernel.org/~akpm/mmotm/
> 
> and will soon be available at
> 
>    git://git.zen-sources.org/zen/mmotm.git


when CONFIG_FILE_LOCKING=n:

mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)


since generic_setlease() is a macro/define in that case.

-- 
~Randy



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-15 19:13   ` Randy Dunlap
  0 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-15 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, swhiteho, cluster-devel

akpm@linux-foundation.org wrote:
> The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> 
>    http://userweb.kernel.org/~akpm/mmotm/
> 
> and will soon be available at
> 
>    git://git.zen-sources.org/zen/mmotm.git


when CONFIG_FILE_LOCKING=n:

mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)


since generic_setlease() is a macro/define in that case.

-- 
~Randy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-15 19:13   ` Randy Dunlap
@ 2009-01-16 10:20     ` Steven Whitehouse
  -1 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-16 10:20 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
> akpm at linux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> > 
> >    http://userweb.kernel.org/~akpm/mmotm/
> > 
> > and will soon be available at
> > 
> >    git://git.zen-sources.org/zen/mmotm.git
> 
> 
> when CONFIG_FILE_LOCKING=n:
> 
> mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
> 
> 
> since generic_setlease() is a macro/define in that case.
> 
Hmm, it looks like I'll have to do this, in that case:

diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 99d726f..4580335 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
 	.fsync		= gfs2_fsync,
 	.splice_read	= generic_file_splice_read,
 	.splice_write	= generic_file_splice_write,
+#ifdef CONFIG_FILE_LOCKING
 	.setlease	= generic_setlease,
+#endif /* CONFIG_FILE_LOCKING */
 };
 
 const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){


which is not ideal, but I don't see any easy way to avoid the #ifdef,

Steve.




^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-16 10:20     ` Steven Whitehouse
  0 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-16 10:20 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, Andrew Morton, cluster-devel

Hi,

On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
> akpm@linux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> > 
> >    http://userweb.kernel.org/~akpm/mmotm/
> > 
> > and will soon be available at
> > 
> >    git://git.zen-sources.org/zen/mmotm.git
> 
> 
> when CONFIG_FILE_LOCKING=n:
> 
> mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
> 
> 
> since generic_setlease() is a macro/define in that case.
> 
Hmm, it looks like I'll have to do this, in that case:

diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 99d726f..4580335 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
 	.fsync		= gfs2_fsync,
 	.splice_read	= generic_file_splice_read,
 	.splice_write	= generic_file_splice_write,
+#ifdef CONFIG_FILE_LOCKING
 	.setlease	= generic_setlease,
+#endif /* CONFIG_FILE_LOCKING */
 };
 
 const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){


which is not ideal, but I don't see any easy way to avoid the #ifdef,

Steve.



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-16 10:20     ` Steven Whitehouse
@ 2009-01-16 16:43       ` Andrew Morton
  -1 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2009-01-16 16:43 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Fri, 16 Jan 2009 10:20:03 +0000 Steven Whitehouse <swhiteho@redhat.com> wrote:

> Hi,
> 
> On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
> > akpm at linux-foundation.org wrote:
> > > The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> > > 
> > >    http://userweb.kernel.org/~akpm/mmotm/
> > > 
> > > and will soon be available at
> > > 
> > >    git://git.zen-sources.org/zen/mmotm.git
> > 
> > 
> > when CONFIG_FILE_LOCKING=n:
> > 
> > mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
> > 
> > 
> > since generic_setlease() is a macro/define in that case.
> > 
> Hmm, it looks like I'll have to do this, in that case:
> 
> diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
> index 99d726f..4580335 100644
> --- a/fs/gfs2/ops_file.c
> +++ b/fs/gfs2/ops_file.c
> @@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
>  	.fsync		= gfs2_fsync,
>  	.splice_read	= generic_file_splice_read,
>  	.splice_write	= generic_file_splice_write,
> +#ifdef CONFIG_FILE_LOCKING
>  	.setlease	= generic_setlease,
> +#endif /* CONFIG_FILE_LOCKING */
>  };
>  
>  const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){
> 
> 
> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> 

Take a look in fs.h:

#define generic_setlease(a, b, c) ({ -EINVAL; })

If that wasn't a stupid macro, your code would have compiled and ran
just as intended.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-16 16:43       ` Andrew Morton
  0 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2009-01-16 16:43 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: Randy Dunlap, linux-kernel, cluster-devel

On Fri, 16 Jan 2009 10:20:03 +0000 Steven Whitehouse <swhiteho@redhat.com> wrote:

> Hi,
> 
> On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
> > akpm@linux-foundation.org wrote:
> > > The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> > > 
> > >    http://userweb.kernel.org/~akpm/mmotm/
> > > 
> > > and will soon be available at
> > > 
> > >    git://git.zen-sources.org/zen/mmotm.git
> > 
> > 
> > when CONFIG_FILE_LOCKING=n:
> > 
> > mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
> > 
> > 
> > since generic_setlease() is a macro/define in that case.
> > 
> Hmm, it looks like I'll have to do this, in that case:
> 
> diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
> index 99d726f..4580335 100644
> --- a/fs/gfs2/ops_file.c
> +++ b/fs/gfs2/ops_file.c
> @@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
>  	.fsync		= gfs2_fsync,
>  	.splice_read	= generic_file_splice_read,
>  	.splice_write	= generic_file_splice_write,
> +#ifdef CONFIG_FILE_LOCKING
>  	.setlease	= generic_setlease,
> +#endif /* CONFIG_FILE_LOCKING */
>  };
>  
>  const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){
> 
> 
> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> 

Take a look in fs.h:

#define generic_setlease(a, b, c) ({ -EINVAL; })

If that wasn't a stupid macro, your code would have compiled and ran
just as intended.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-16 16:43       ` Andrew Morton
@ 2009-01-16 17:02         ` Steven Whitehouse
  -1 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-16 17:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Fri, 2009-01-16 at 08:43 -0800, Andrew Morton wrote:
> On Fri, 16 Jan 2009 10:20:03 +0000 Steven Whitehouse <swhiteho@redhat.com> wrote:
> 
> > Hi,
> > 
> > On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
> > > akpm at linux-foundation.org wrote:
> > > > The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> > > > 
> > > >    http://userweb.kernel.org/~akpm/mmotm/
> > > > 
> > > > and will soon be available at
> > > > 
> > > >    git://git.zen-sources.org/zen/mmotm.git
> > > 
> > > 
> > > when CONFIG_FILE_LOCKING=n:
> > > 
> > > mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
> > > 
> > > 
> > > since generic_setlease() is a macro/define in that case.
> > > 
> > Hmm, it looks like I'll have to do this, in that case:
> > 
> > diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
> > index 99d726f..4580335 100644
> > --- a/fs/gfs2/ops_file.c
> > +++ b/fs/gfs2/ops_file.c
> > @@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
> >  	.fsync		= gfs2_fsync,
> >  	.splice_read	= generic_file_splice_read,
> >  	.splice_write	= generic_file_splice_write,
> > +#ifdef CONFIG_FILE_LOCKING
> >  	.setlease	= generic_setlease,
> > +#endif /* CONFIG_FILE_LOCKING */
> >  };
> >  
> >  const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){
> > 
> > 
> > which is not ideal, but I don't see any easy way to avoid the #ifdef,
> > 
> 
> Take a look in fs.h:
> 
> #define generic_setlease(a, b, c) ({ -EINVAL; })
> 
> If that wasn't a stupid macro, your code would have compiled and ran
> just as intended.
> 
There doesn't seem to be an easy answer though. If I #define it to NULL,
that upsets other parts of the code that rely on that macro, and if I
turn it into a inline function which returns -EINVAL, then presumably I
can't take its address for my file_operations.

I could create a small function which then calls generic_setlease I
suppose, but is that any better than this? Its not really very neat
which ever I choose :(

Steve.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-16 17:02         ` Steven Whitehouse
  0 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-16 17:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Randy Dunlap, linux-kernel, cluster-devel

Hi,

On Fri, 2009-01-16 at 08:43 -0800, Andrew Morton wrote:
> On Fri, 16 Jan 2009 10:20:03 +0000 Steven Whitehouse <swhiteho@redhat.com> wrote:
> 
> > Hi,
> > 
> > On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
> > > akpm@linux-foundation.org wrote:
> > > > The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
> > > > 
> > > >    http://userweb.kernel.org/~akpm/mmotm/
> > > > 
> > > > and will soon be available at
> > > > 
> > > >    git://git.zen-sources.org/zen/mmotm.git
> > > 
> > > 
> > > when CONFIG_FILE_LOCKING=n:
> > > 
> > > mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
> > > 
> > > 
> > > since generic_setlease() is a macro/define in that case.
> > > 
> > Hmm, it looks like I'll have to do this, in that case:
> > 
> > diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
> > index 99d726f..4580335 100644
> > --- a/fs/gfs2/ops_file.c
> > +++ b/fs/gfs2/ops_file.c
> > @@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
> >  	.fsync		= gfs2_fsync,
> >  	.splice_read	= generic_file_splice_read,
> >  	.splice_write	= generic_file_splice_write,
> > +#ifdef CONFIG_FILE_LOCKING
> >  	.setlease	= generic_setlease,
> > +#endif /* CONFIG_FILE_LOCKING */
> >  };
> >  
> >  const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){
> > 
> > 
> > which is not ideal, but I don't see any easy way to avoid the #ifdef,
> > 
> 
> Take a look in fs.h:
> 
> #define generic_setlease(a, b, c) ({ -EINVAL; })
> 
> If that wasn't a stupid macro, your code would have compiled and ran
> just as intended.
> 
There doesn't seem to be an easy answer though. If I #define it to NULL,
that upsets other parts of the code that rely on that macro, and if I
turn it into a inline function which returns -EINVAL, then presumably I
can't take its address for my file_operations.

I could create a small function which then calls generic_setlease I
suppose, but is that any better than this? Its not really very neat
which ever I choose :(

Steve.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-16 17:02         ` Steven Whitehouse
@ 2009-01-16 17:06           ` Randy Dunlap
  -1 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-16 17:06 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Steven Whitehouse wrote:
> Hi,
> 
> On Fri, 2009-01-16 at 08:43 -0800, Andrew Morton wrote:
>> On Fri, 16 Jan 2009 10:20:03 +0000 Steven Whitehouse <swhiteho@redhat.com> wrote:
>>
>>> Hi,
>>>
>>> On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
>>>> akpm at linux-foundation.org wrote:
>>>>> The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
>>>>>
>>>>>    http://userweb.kernel.org/~akpm/mmotm/
>>>>>
>>>>> and will soon be available at
>>>>>
>>>>>    git://git.zen-sources.org/zen/mmotm.git
>>>>
>>>> when CONFIG_FILE_LOCKING=n:
>>>>
>>>> mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
>>>>
>>>>
>>>> since generic_setlease() is a macro/define in that case.
>>>>
>>> Hmm, it looks like I'll have to do this, in that case:
>>>
>>> diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
>>> index 99d726f..4580335 100644
>>> --- a/fs/gfs2/ops_file.c
>>> +++ b/fs/gfs2/ops_file.c
>>> @@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
>>>  	.fsync		= gfs2_fsync,
>>>  	.splice_read	= generic_file_splice_read,
>>>  	.splice_write	= generic_file_splice_write,
>>> +#ifdef CONFIG_FILE_LOCKING
>>>  	.setlease	= generic_setlease,
>>> +#endif /* CONFIG_FILE_LOCKING */
>>>  };
>>>  
>>>  const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){
>>>
>>>
>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
>>>
>> Take a look in fs.h:
>>
>> #define generic_setlease(a, b, c) ({ -EINVAL; })
>>
>> If that wasn't a stupid macro, your code would have compiled and ran
>> just as intended.
>>
> There doesn't seem to be an easy answer though. If I #define it to NULL,
> that upsets other parts of the code that rely on that macro, and if I
> turn it into a inline function which returns -EINVAL, then presumably I
> can't take its address for my file_operations.

No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
I've seen a few cases of that).

> I could create a small function which then calls generic_setlease I
> suppose, but is that any better than this? Its not really very neat
> which ever I choose :(


-- 
~Randy



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-16 17:06           ` Randy Dunlap
  0 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-16 17:06 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: Andrew Morton, linux-kernel, cluster-devel

Steven Whitehouse wrote:
> Hi,
> 
> On Fri, 2009-01-16 at 08:43 -0800, Andrew Morton wrote:
>> On Fri, 16 Jan 2009 10:20:03 +0000 Steven Whitehouse <swhiteho@redhat.com> wrote:
>>
>>> Hi,
>>>
>>> On Thu, 2009-01-15 at 11:13 -0800, Randy Dunlap wrote:
>>>> akpm@linux-foundation.org wrote:
>>>>> The mm-of-the-moment snapshot 2009-01-14-20-31 has been uploaded to
>>>>>
>>>>>    http://userweb.kernel.org/~akpm/mmotm/
>>>>>
>>>>> and will soon be available at
>>>>>
>>>>>    git://git.zen-sources.org/zen/mmotm.git
>>>>
>>>> when CONFIG_FILE_LOCKING=n:
>>>>
>>>> mmotm-2009-0114-2031/fs/gfs2/ops_file.c:746: error: 'generic_setlease' undeclared here (not in a function)
>>>>
>>>>
>>>> since generic_setlease() is a macro/define in that case.
>>>>
>>> Hmm, it looks like I'll have to do this, in that case:
>>>
>>> diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
>>> index 99d726f..4580335 100644
>>> --- a/fs/gfs2/ops_file.c
>>> +++ b/fs/gfs2/ops_file.c
>>> @@ -743,7 +743,9 @@ const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operat
>>>  	.fsync		= gfs2_fsync,
>>>  	.splice_read	= generic_file_splice_read,
>>>  	.splice_write	= generic_file_splice_write,
>>> +#ifdef CONFIG_FILE_LOCKING
>>>  	.setlease	= generic_setlease,
>>> +#endif /* CONFIG_FILE_LOCKING */
>>>  };
>>>  
>>>  const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){
>>>
>>>
>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
>>>
>> Take a look in fs.h:
>>
>> #define generic_setlease(a, b, c) ({ -EINVAL; })
>>
>> If that wasn't a stupid macro, your code would have compiled and ran
>> just as intended.
>>
> There doesn't seem to be an easy answer though. If I #define it to NULL,
> that upsets other parts of the code that rely on that macro, and if I
> turn it into a inline function which returns -EINVAL, then presumably I
> can't take its address for my file_operations.

No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
I've seen a few cases of that).

> I could create a small function which then calls generic_setlease I
> suppose, but is that any better than this? Its not really very neat
> which ever I choose :(


-- 
~Randy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-16 17:06           ` Randy Dunlap
@ 2009-01-16 17:35             ` Andrew Morton
  -1 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2009-01-16 17:35 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:

> >>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> >>>
> >> Take a look in fs.h:
> >>
> >> #define generic_setlease(a, b, c) ({ -EINVAL; })
> >>
> >> If that wasn't a stupid macro, your code would have compiled and ran
> >> just as intended.
> >>
> > There doesn't seem to be an easy answer though. If I #define it to NULL,
> > that upsets other parts of the code that rely on that macro, and if I
> > turn it into a inline function which returns -EINVAL, then presumably I
> > can't take its address for my file_operations.
> 
> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> I've seen a few cases of that).
> 

yup.  It measn that we'll get a separate private copy of the
generic_setlease() code in each compilation unit which takes its
address, but I don't think that would kill us.

The prevention is of course to put the stub function in a core kernel
.c file and export it to modules.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-16 17:35             ` Andrew Morton
  0 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2009-01-16 17:35 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Steven Whitehouse, linux-kernel, cluster-devel

On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:

> >>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> >>>
> >> Take a look in fs.h:
> >>
> >> #define generic_setlease(a, b, c) ({ -EINVAL; })
> >>
> >> If that wasn't a stupid macro, your code would have compiled and ran
> >> just as intended.
> >>
> > There doesn't seem to be an easy answer though. If I #define it to NULL,
> > that upsets other parts of the code that rely on that macro, and if I
> > turn it into a inline function which returns -EINVAL, then presumably I
> > can't take its address for my file_operations.
> 
> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> I've seen a few cases of that).
> 

yup.  It measn that we'll get a separate private copy of the
generic_setlease() code in each compilation unit which takes its
address, but I don't think that would kill us.

The prevention is of course to put the stub function in a core kernel
.c file and export it to modules.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-16 17:35             ` Andrew Morton
@ 2009-01-16 17:37               ` Steven Whitehouse
  -1 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-16 17:37 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > >>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> > >>>
> > >> Take a look in fs.h:
> > >>
> > >> #define generic_setlease(a, b, c) ({ -EINVAL; })
> > >>
> > >> If that wasn't a stupid macro, your code would have compiled and ran
> > >> just as intended.
> > >>
> > > There doesn't seem to be an easy answer though. If I #define it to NULL,
> > > that upsets other parts of the code that rely on that macro, and if I
> > > turn it into a inline function which returns -EINVAL, then presumably I
> > > can't take its address for my file_operations.
> > 
> > No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> > I've seen a few cases of that).
> > 
> 
> yup.  It measn that we'll get a separate private copy of the
> generic_setlease() code in each compilation unit which takes its
> address, but I don't think that would kill us.
> 
> The prevention is of course to put the stub function in a core kernel
> .c file and export it to modules.
> 
Ok, I'll have another look at this and try and cook something up,

Steve.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-16 17:37               ` Steven Whitehouse
  0 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-16 17:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Randy Dunlap, linux-kernel, cluster-devel

Hi,

On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > >>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> > >>>
> > >> Take a look in fs.h:
> > >>
> > >> #define generic_setlease(a, b, c) ({ -EINVAL; })
> > >>
> > >> If that wasn't a stupid macro, your code would have compiled and ran
> > >> just as intended.
> > >>
> > > There doesn't seem to be an easy answer though. If I #define it to NULL,
> > > that upsets other parts of the code that rely on that macro, and if I
> > > turn it into a inline function which returns -EINVAL, then presumably I
> > > can't take its address for my file_operations.
> > 
> > No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> > I've seen a few cases of that).
> > 
> 
> yup.  It measn that we'll get a separate private copy of the
> generic_setlease() code in each compilation unit which takes its
> address, but I don't think that would kill us.
> 
> The prevention is of course to put the stub function in a core kernel
> .c file and export it to modules.
> 
Ok, I'll have another look at this and try and cook something up,

Steve.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-16 17:35             ` Andrew Morton
@ 2009-01-19 15:16               ` Steven Whitehouse
  -1 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-19 15:16 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > >>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> > >>>
> > >> Take a look in fs.h:
> > >>
> > >> #define generic_setlease(a, b, c) ({ -EINVAL; })
> > >>
> > >> If that wasn't a stupid macro, your code would have compiled and ran
> > >> just as intended.
> > >>
> > > There doesn't seem to be an easy answer though. If I #define it to NULL,
> > > that upsets other parts of the code that rely on that macro, and if I
> > > turn it into a inline function which returns -EINVAL, then presumably I
> > > can't take its address for my file_operations.
> > 
> > No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> > I've seen a few cases of that).
> > 
> 
> yup.  It measn that we'll get a separate private copy of the
> generic_setlease() code in each compilation unit which takes its
> address, but I don't think that would kill us.
> 
> The prevention is of course to put the stub function in a core kernel
> .c file and export it to modules.
> 
Having looked into this in a bit more detail now, it seems that this
particular function (generic_setlease) is one of a number appearing in
fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
is not set.

So rather than just do the one function, it seemed to make sense to me
to make them all the same. So this uses inline functions as originally
proposed. If you'd prefer that we don't inline them and instead have a
fs/no-locks.c or something like that with stub functions in it, then I"m
happy to revise the patch accordingly.

This patch passes my compile tests, modulo a small change that I need to
make in GFS2 to suppress a warning (not attached). That seems to be
related to yet another set of macros which appear only with
CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
functions as well....

Steve.

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6022f44..392c18a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1057,34 +1057,147 @@ extern int lease_modify(struct file_lock **, int);
 extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
 extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
 #else /* !CONFIG_FILE_LOCKING */
-#define fcntl_getlk(a, b) ({ -EINVAL; })
-#define fcntl_setlk(a, b, c, d) ({ -EACCES; })
+static inline int fcntl_getlk(struct file *file, struct flock __user *user)
+{
+	return -EINVAL;
+}
+
+static inline int fcntl_setlk(unsigned int fd, struct file *file,
+			      unsigned int cmd, struct flock __user *user)
+{
+	return -EACCES;
+}
+
 #if BITS_PER_LONG == 32
-#define fcntl_getlk64(a, b) ({ -EINVAL; })
-#define fcntl_setlk64(a, b, c, d) ({ -EACCES; })
+static inline int fcntl_getlk64(struct file *file, struct flock64 __user *user)
+{
+	return -EINVAL;
+}
+
+static inline int fcntl_setlk64(unsigned int fd, struct file *file,
+				unsigned int cmd, struct flock64 __user *user)
+{
+	return -EACCES;
+}
 #endif
-#define fcntl_setlease(a, b, c) ({ 0; })
-#define fcntl_getlease(a) ({ 0; })
-#define locks_init_lock(a) ({ })
-#define __locks_copy_lock(a, b) ({ })
-#define locks_copy_lock(a, b) ({ })
-#define locks_remove_posix(a, b) ({ })
-#define locks_remove_flock(a) ({ })
-#define posix_test_lock(a, b) ({ 0; })
-#define posix_lock_file(a, b, c) ({ -ENOLCK; })
-#define posix_lock_file_wait(a, b) ({ -ENOLCK; })
-#define posix_unblock_lock(a, b) (-ENOENT)
-#define vfs_test_lock(a, b) ({ 0; })
-#define vfs_lock_file(a, b, c, d) (-ENOLCK)
-#define vfs_cancel_lock(a, b) ({ 0; })
-#define flock_lock_file_wait(a, b) ({ -ENOLCK; })
-#define __break_lease(a, b) ({ 0; })
-#define lease_get_mtime(a, b) ({ })
-#define generic_setlease(a, b, c) ({ -EINVAL; })
-#define vfs_setlease(a, b, c) ({ -EINVAL; })
-#define lease_modify(a, b) ({ -EINVAL; })
-#define lock_may_read(a, b, c) ({ 1; })
-#define lock_may_write(a, b, c) ({ 1; })
+static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
+{
+	return 0;
+}
+
+static inline int fcntl_getlease(struct file *filp)
+{
+	return 0;
+}
+
+static inline void locks_init_lock(struct file_lock *fl)
+{
+	return;
+}
+
+static inline void __locks_copy_lock(struct file_lock *new, struct file_lock *fl)
+{
+	return;
+}
+
+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)
+{
+	return;
+}
+
+static inline void locks_remove_flock(struct file *filp)
+{
+	return;
+}
+
+static inline void posix_test_lock(struct file *filp, struct file_lock *fl)
+{
+	return;
+}
+
+static inline int posix_lock_file(struct file *filp, struct file_lock *fl,
+				  struct file_lock *conflock)
+{
+	return -ENOLCK;
+}
+
+static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
+{
+	return -ENOLCK;
+}
+
+static inline int posix_unblock_lock(struct file *filp,
+				     struct file_lock *waiter)
+{
+	return -ENOENT;
+}
+
+static inline int vfs_test_lock(struct file *filp, struct file_lock *fl)
+{
+	return 0;
+}
+
+static inline int vfs_lock_file(struct file *filp, unsigned int cmd,
+				struct file_lock *fl, struct file_lock *conf)
+{
+	return -ENOLCK;
+}
+
+static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
+{
+	return 0;
+}
+
+static inline int flock_lock_file_wait(struct file *filp,
+				       struct file_lock *request)
+{
+	return -ENOLCK;
+}
+
+static inline int __break_lease(struct inode *inode, unsigned int mode)
+{
+	return 0;
+}
+
+static inline void lease_get_mtime(struct inode *inode, struct timespec *time)
+{
+	return;
+}
+
+static inline int generic_setlease(struct file *filp, long arg,
+				    struct file_lock **flp)
+{
+	return -EINVAL;
+}
+
+static inline int vfs_setlease(struct file *filp, long arg,
+			       struct file_lock **lease)
+{
+	return -EINVAL;
+}
+
+static inline int lease_modify(struct file_lock **before, int arg)
+{
+	return -EINVAL;
+}
+
+static inline int lock_may_read(struct inode *inode, loff_t start,
+				unsigned long len)
+{
+	return 1;
+}
+
+static inline int lock_may_write(struct inode *inode, loff_t start,
+				 unsigned long len)
+{
+	return 1;
+}
+
 #endif /* !CONFIG_FILE_LOCKING */
 
 




^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-19 15:16               ` Steven Whitehouse
  0 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-19 15:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Randy Dunlap, linux-kernel, cluster-devel

Hi,

On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > >>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> > >>>
> > >> Take a look in fs.h:
> > >>
> > >> #define generic_setlease(a, b, c) ({ -EINVAL; })
> > >>
> > >> If that wasn't a stupid macro, your code would have compiled and ran
> > >> just as intended.
> > >>
> > > There doesn't seem to be an easy answer though. If I #define it to NULL,
> > > that upsets other parts of the code that rely on that macro, and if I
> > > turn it into a inline function which returns -EINVAL, then presumably I
> > > can't take its address for my file_operations.
> > 
> > No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> > I've seen a few cases of that).
> > 
> 
> yup.  It measn that we'll get a separate private copy of the
> generic_setlease() code in each compilation unit which takes its
> address, but I don't think that would kill us.
> 
> The prevention is of course to put the stub function in a core kernel
> .c file and export it to modules.
> 
Having looked into this in a bit more detail now, it seems that this
particular function (generic_setlease) is one of a number appearing in
fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
is not set.

So rather than just do the one function, it seemed to make sense to me
to make them all the same. So this uses inline functions as originally
proposed. If you'd prefer that we don't inline them and instead have a
fs/no-locks.c or something like that with stub functions in it, then I"m
happy to revise the patch accordingly.

This patch passes my compile tests, modulo a small change that I need to
make in GFS2 to suppress a warning (not attached). That seems to be
related to yet another set of macros which appear only with
CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
functions as well....

Steve.

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6022f44..392c18a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1057,34 +1057,147 @@ extern int lease_modify(struct file_lock **, int);
 extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
 extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
 #else /* !CONFIG_FILE_LOCKING */
-#define fcntl_getlk(a, b) ({ -EINVAL; })
-#define fcntl_setlk(a, b, c, d) ({ -EACCES; })
+static inline int fcntl_getlk(struct file *file, struct flock __user *user)
+{
+	return -EINVAL;
+}
+
+static inline int fcntl_setlk(unsigned int fd, struct file *file,
+			      unsigned int cmd, struct flock __user *user)
+{
+	return -EACCES;
+}
+
 #if BITS_PER_LONG == 32
-#define fcntl_getlk64(a, b) ({ -EINVAL; })
-#define fcntl_setlk64(a, b, c, d) ({ -EACCES; })
+static inline int fcntl_getlk64(struct file *file, struct flock64 __user *user)
+{
+	return -EINVAL;
+}
+
+static inline int fcntl_setlk64(unsigned int fd, struct file *file,
+				unsigned int cmd, struct flock64 __user *user)
+{
+	return -EACCES;
+}
 #endif
-#define fcntl_setlease(a, b, c) ({ 0; })
-#define fcntl_getlease(a) ({ 0; })
-#define locks_init_lock(a) ({ })
-#define __locks_copy_lock(a, b) ({ })
-#define locks_copy_lock(a, b) ({ })
-#define locks_remove_posix(a, b) ({ })
-#define locks_remove_flock(a) ({ })
-#define posix_test_lock(a, b) ({ 0; })
-#define posix_lock_file(a, b, c) ({ -ENOLCK; })
-#define posix_lock_file_wait(a, b) ({ -ENOLCK; })
-#define posix_unblock_lock(a, b) (-ENOENT)
-#define vfs_test_lock(a, b) ({ 0; })
-#define vfs_lock_file(a, b, c, d) (-ENOLCK)
-#define vfs_cancel_lock(a, b) ({ 0; })
-#define flock_lock_file_wait(a, b) ({ -ENOLCK; })
-#define __break_lease(a, b) ({ 0; })
-#define lease_get_mtime(a, b) ({ })
-#define generic_setlease(a, b, c) ({ -EINVAL; })
-#define vfs_setlease(a, b, c) ({ -EINVAL; })
-#define lease_modify(a, b) ({ -EINVAL; })
-#define lock_may_read(a, b, c) ({ 1; })
-#define lock_may_write(a, b, c) ({ 1; })
+static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
+{
+	return 0;
+}
+
+static inline int fcntl_getlease(struct file *filp)
+{
+	return 0;
+}
+
+static inline void locks_init_lock(struct file_lock *fl)
+{
+	return;
+}
+
+static inline void __locks_copy_lock(struct file_lock *new, struct file_lock *fl)
+{
+	return;
+}
+
+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)
+{
+	return;
+}
+
+static inline void locks_remove_flock(struct file *filp)
+{
+	return;
+}
+
+static inline void posix_test_lock(struct file *filp, struct file_lock *fl)
+{
+	return;
+}
+
+static inline int posix_lock_file(struct file *filp, struct file_lock *fl,
+				  struct file_lock *conflock)
+{
+	return -ENOLCK;
+}
+
+static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
+{
+	return -ENOLCK;
+}
+
+static inline int posix_unblock_lock(struct file *filp,
+				     struct file_lock *waiter)
+{
+	return -ENOENT;
+}
+
+static inline int vfs_test_lock(struct file *filp, struct file_lock *fl)
+{
+	return 0;
+}
+
+static inline int vfs_lock_file(struct file *filp, unsigned int cmd,
+				struct file_lock *fl, struct file_lock *conf)
+{
+	return -ENOLCK;
+}
+
+static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
+{
+	return 0;
+}
+
+static inline int flock_lock_file_wait(struct file *filp,
+				       struct file_lock *request)
+{
+	return -ENOLCK;
+}
+
+static inline int __break_lease(struct inode *inode, unsigned int mode)
+{
+	return 0;
+}
+
+static inline void lease_get_mtime(struct inode *inode, struct timespec *time)
+{
+	return;
+}
+
+static inline int generic_setlease(struct file *filp, long arg,
+				    struct file_lock **flp)
+{
+	return -EINVAL;
+}
+
+static inline int vfs_setlease(struct file *filp, long arg,
+			       struct file_lock **lease)
+{
+	return -EINVAL;
+}
+
+static inline int lease_modify(struct file_lock **before, int arg)
+{
+	return -EINVAL;
+}
+
+static inline int lock_may_read(struct inode *inode, loff_t start,
+				unsigned long len)
+{
+	return 1;
+}
+
+static inline int lock_may_write(struct inode *inode, loff_t start,
+				 unsigned long len)
+{
+	return 1;
+}
+
 #endif /* !CONFIG_FILE_LOCKING */
 
 



^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-19 15:16               ` Steven Whitehouse
@ 2009-01-19 17:05                 ` Randy Dunlap
  -1 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-19 17:05 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Steven Whitehouse wrote:
> Hi,
> 
> On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
>> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>
>>>>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
>>>>>>
>>>>> Take a look in fs.h:
>>>>>
>>>>> #define generic_setlease(a, b, c) ({ -EINVAL; })
>>>>>
>>>>> If that wasn't a stupid macro, your code would have compiled and ran
>>>>> just as intended.
>>>>>
>>>> There doesn't seem to be an easy answer though. If I #define it to NULL,
>>>> that upsets other parts of the code that rely on that macro, and if I
>>>> turn it into a inline function which returns -EINVAL, then presumably I
>>>> can't take its address for my file_operations.
>>> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
>>> I've seen a few cases of that).
>>>
>> yup.  It measn that we'll get a separate private copy of the
>> generic_setlease() code in each compilation unit which takes its
>> address, but I don't think that would kill us.
>>
>> The prevention is of course to put the stub function in a core kernel
>> .c file and export it to modules.
>>
> Having looked into this in a bit more detail now, it seems that this
> particular function (generic_setlease) is one of a number appearing in
> fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
> is not set.
> 
> So rather than just do the one function, it seemed to make sense to me
> to make them all the same. So this uses inline functions as originally
> proposed. If you'd prefer that we don't inline them and instead have a
> fs/no-locks.c or something like that with stub functions in it, then I"m
> happy to revise the patch accordingly.

Acked-by/Tested-by: Randy Dunlap <randy.dunlap@oracle.com>

> This patch passes my compile tests, modulo a small change that I need to
> make in GFS2 to suppress a warning (not attached). That seems to be
> related to yet another set of macros which appear only with
> CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
> functions as well....

You mean these?  Probably should update them as well.

#else /* !CONFIG_FILE_LOCKING */
#define locks_mandatory_locked(a) ({ 0; })
#define locks_mandatory_area(a, b, c, d, e) ({ 0; })
#define __mandatory_lock(a) ({ 0; })
#define mandatory_lock(a) ({ 0; })
#define locks_verify_locked(a) ({ 0; })
#define locks_verify_truncate(a, b, c) ({ 0; })
#define break_lease(a, b) ({ 0; })
#endif /* CONFIG_FILE_LOCKING */



Thanks.

> Steve.
> 
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 6022f44..392c18a 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1057,34 +1057,147 @@ extern int lease_modify(struct file_lock **, int);
>  extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
>  extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
>  #else /* !CONFIG_FILE_LOCKING */
> -#define fcntl_getlk(a, b) ({ -EINVAL; })
> -#define fcntl_setlk(a, b, c, d) ({ -EACCES; })
> +static inline int fcntl_getlk(struct file *file, struct flock __user *user)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int fcntl_setlk(unsigned int fd, struct file *file,
> +			      unsigned int cmd, struct flock __user *user)
> +{
> +	return -EACCES;
> +}
> +
>  #if BITS_PER_LONG == 32
> -#define fcntl_getlk64(a, b) ({ -EINVAL; })
> -#define fcntl_setlk64(a, b, c, d) ({ -EACCES; })
> +static inline int fcntl_getlk64(struct file *file, struct flock64 __user *user)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int fcntl_setlk64(unsigned int fd, struct file *file,
> +				unsigned int cmd, struct flock64 __user *user)
> +{
> +	return -EACCES;
> +}
>  #endif
> -#define fcntl_setlease(a, b, c) ({ 0; })
> -#define fcntl_getlease(a) ({ 0; })
> -#define locks_init_lock(a) ({ })
> -#define __locks_copy_lock(a, b) ({ })
> -#define locks_copy_lock(a, b) ({ })
> -#define locks_remove_posix(a, b) ({ })
> -#define locks_remove_flock(a) ({ })
> -#define posix_test_lock(a, b) ({ 0; })
> -#define posix_lock_file(a, b, c) ({ -ENOLCK; })
> -#define posix_lock_file_wait(a, b) ({ -ENOLCK; })
> -#define posix_unblock_lock(a, b) (-ENOENT)
> -#define vfs_test_lock(a, b) ({ 0; })
> -#define vfs_lock_file(a, b, c, d) (-ENOLCK)
> -#define vfs_cancel_lock(a, b) ({ 0; })
> -#define flock_lock_file_wait(a, b) ({ -ENOLCK; })
> -#define __break_lease(a, b) ({ 0; })
> -#define lease_get_mtime(a, b) ({ })
> -#define generic_setlease(a, b, c) ({ -EINVAL; })
> -#define vfs_setlease(a, b, c) ({ -EINVAL; })
> -#define lease_modify(a, b) ({ -EINVAL; })
> -#define lock_may_read(a, b, c) ({ 1; })
> -#define lock_may_write(a, b, c) ({ 1; })
> +static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
> +{
> +	return 0;
> +}
> +
> +static inline int fcntl_getlease(struct file *filp)
> +{
> +	return 0;
> +}
> +
> +static inline void locks_init_lock(struct file_lock *fl)
> +{
> +	return;
> +}
> +
> +static inline void __locks_copy_lock(struct file_lock *new, struct file_lock *fl)
> +{
> +	return;
> +}
> +
> +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)
> +{
> +	return;
> +}
> +
> +static inline void locks_remove_flock(struct file *filp)
> +{
> +	return;
> +}
> +
> +static inline void posix_test_lock(struct file *filp, struct file_lock *fl)
> +{
> +	return;
> +}
> +
> +static inline int posix_lock_file(struct file *filp, struct file_lock *fl,
> +				  struct file_lock *conflock)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int posix_unblock_lock(struct file *filp,
> +				     struct file_lock *waiter)
> +{
> +	return -ENOENT;
> +}
> +
> +static inline int vfs_test_lock(struct file *filp, struct file_lock *fl)
> +{
> +	return 0;
> +}
> +
> +static inline int vfs_lock_file(struct file *filp, unsigned int cmd,
> +				struct file_lock *fl, struct file_lock *conf)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
> +{
> +	return 0;
> +}
> +
> +static inline int flock_lock_file_wait(struct file *filp,
> +				       struct file_lock *request)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int __break_lease(struct inode *inode, unsigned int mode)
> +{
> +	return 0;
> +}
> +
> +static inline void lease_get_mtime(struct inode *inode, struct timespec *time)
> +{
> +	return;
> +}
> +
> +static inline int generic_setlease(struct file *filp, long arg,
> +				    struct file_lock **flp)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int vfs_setlease(struct file *filp, long arg,
> +			       struct file_lock **lease)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int lease_modify(struct file_lock **before, int arg)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int lock_may_read(struct inode *inode, loff_t start,
> +				unsigned long len)
> +{
> +	return 1;
> +}
> +
> +static inline int lock_may_write(struct inode *inode, loff_t start,
> +				 unsigned long len)
> +{
> +	return 1;
> +}
> +
>  #endif /* !CONFIG_FILE_LOCKING */
>  
>  
> 
> 


-- 
~Randy



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-19 17:05                 ` Randy Dunlap
  0 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-19 17:05 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: Andrew Morton, linux-kernel, cluster-devel

Steven Whitehouse wrote:
> Hi,
> 
> On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
>> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>
>>>>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
>>>>>>
>>>>> Take a look in fs.h:
>>>>>
>>>>> #define generic_setlease(a, b, c) ({ -EINVAL; })
>>>>>
>>>>> If that wasn't a stupid macro, your code would have compiled and ran
>>>>> just as intended.
>>>>>
>>>> There doesn't seem to be an easy answer though. If I #define it to NULL,
>>>> that upsets other parts of the code that rely on that macro, and if I
>>>> turn it into a inline function which returns -EINVAL, then presumably I
>>>> can't take its address for my file_operations.
>>> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
>>> I've seen a few cases of that).
>>>
>> yup.  It measn that we'll get a separate private copy of the
>> generic_setlease() code in each compilation unit which takes its
>> address, but I don't think that would kill us.
>>
>> The prevention is of course to put the stub function in a core kernel
>> .c file and export it to modules.
>>
> Having looked into this in a bit more detail now, it seems that this
> particular function (generic_setlease) is one of a number appearing in
> fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
> is not set.
> 
> So rather than just do the one function, it seemed to make sense to me
> to make them all the same. So this uses inline functions as originally
> proposed. If you'd prefer that we don't inline them and instead have a
> fs/no-locks.c or something like that with stub functions in it, then I"m
> happy to revise the patch accordingly.

Acked-by/Tested-by: Randy Dunlap <randy.dunlap@oracle.com>

> This patch passes my compile tests, modulo a small change that I need to
> make in GFS2 to suppress a warning (not attached). That seems to be
> related to yet another set of macros which appear only with
> CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
> functions as well....

You mean these?  Probably should update them as well.

#else /* !CONFIG_FILE_LOCKING */
#define locks_mandatory_locked(a) ({ 0; })
#define locks_mandatory_area(a, b, c, d, e) ({ 0; })
#define __mandatory_lock(a) ({ 0; })
#define mandatory_lock(a) ({ 0; })
#define locks_verify_locked(a) ({ 0; })
#define locks_verify_truncate(a, b, c) ({ 0; })
#define break_lease(a, b) ({ 0; })
#endif /* CONFIG_FILE_LOCKING */



Thanks.

> Steve.
> 
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 6022f44..392c18a 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1057,34 +1057,147 @@ extern int lease_modify(struct file_lock **, int);
>  extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
>  extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
>  #else /* !CONFIG_FILE_LOCKING */
> -#define fcntl_getlk(a, b) ({ -EINVAL; })
> -#define fcntl_setlk(a, b, c, d) ({ -EACCES; })
> +static inline int fcntl_getlk(struct file *file, struct flock __user *user)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int fcntl_setlk(unsigned int fd, struct file *file,
> +			      unsigned int cmd, struct flock __user *user)
> +{
> +	return -EACCES;
> +}
> +
>  #if BITS_PER_LONG == 32
> -#define fcntl_getlk64(a, b) ({ -EINVAL; })
> -#define fcntl_setlk64(a, b, c, d) ({ -EACCES; })
> +static inline int fcntl_getlk64(struct file *file, struct flock64 __user *user)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int fcntl_setlk64(unsigned int fd, struct file *file,
> +				unsigned int cmd, struct flock64 __user *user)
> +{
> +	return -EACCES;
> +}
>  #endif
> -#define fcntl_setlease(a, b, c) ({ 0; })
> -#define fcntl_getlease(a) ({ 0; })
> -#define locks_init_lock(a) ({ })
> -#define __locks_copy_lock(a, b) ({ })
> -#define locks_copy_lock(a, b) ({ })
> -#define locks_remove_posix(a, b) ({ })
> -#define locks_remove_flock(a) ({ })
> -#define posix_test_lock(a, b) ({ 0; })
> -#define posix_lock_file(a, b, c) ({ -ENOLCK; })
> -#define posix_lock_file_wait(a, b) ({ -ENOLCK; })
> -#define posix_unblock_lock(a, b) (-ENOENT)
> -#define vfs_test_lock(a, b) ({ 0; })
> -#define vfs_lock_file(a, b, c, d) (-ENOLCK)
> -#define vfs_cancel_lock(a, b) ({ 0; })
> -#define flock_lock_file_wait(a, b) ({ -ENOLCK; })
> -#define __break_lease(a, b) ({ 0; })
> -#define lease_get_mtime(a, b) ({ })
> -#define generic_setlease(a, b, c) ({ -EINVAL; })
> -#define vfs_setlease(a, b, c) ({ -EINVAL; })
> -#define lease_modify(a, b) ({ -EINVAL; })
> -#define lock_may_read(a, b, c) ({ 1; })
> -#define lock_may_write(a, b, c) ({ 1; })
> +static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
> +{
> +	return 0;
> +}
> +
> +static inline int fcntl_getlease(struct file *filp)
> +{
> +	return 0;
> +}
> +
> +static inline void locks_init_lock(struct file_lock *fl)
> +{
> +	return;
> +}
> +
> +static inline void __locks_copy_lock(struct file_lock *new, struct file_lock *fl)
> +{
> +	return;
> +}
> +
> +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)
> +{
> +	return;
> +}
> +
> +static inline void locks_remove_flock(struct file *filp)
> +{
> +	return;
> +}
> +
> +static inline void posix_test_lock(struct file *filp, struct file_lock *fl)
> +{
> +	return;
> +}
> +
> +static inline int posix_lock_file(struct file *filp, struct file_lock *fl,
> +				  struct file_lock *conflock)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int posix_unblock_lock(struct file *filp,
> +				     struct file_lock *waiter)
> +{
> +	return -ENOENT;
> +}
> +
> +static inline int vfs_test_lock(struct file *filp, struct file_lock *fl)
> +{
> +	return 0;
> +}
> +
> +static inline int vfs_lock_file(struct file *filp, unsigned int cmd,
> +				struct file_lock *fl, struct file_lock *conf)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
> +{
> +	return 0;
> +}
> +
> +static inline int flock_lock_file_wait(struct file *filp,
> +				       struct file_lock *request)
> +{
> +	return -ENOLCK;
> +}
> +
> +static inline int __break_lease(struct inode *inode, unsigned int mode)
> +{
> +	return 0;
> +}
> +
> +static inline void lease_get_mtime(struct inode *inode, struct timespec *time)
> +{
> +	return;
> +}
> +
> +static inline int generic_setlease(struct file *filp, long arg,
> +				    struct file_lock **flp)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int vfs_setlease(struct file *filp, long arg,
> +			       struct file_lock **lease)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int lease_modify(struct file_lock **before, int arg)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline int lock_may_read(struct inode *inode, loff_t start,
> +				unsigned long len)
> +{
> +	return 1;
> +}
> +
> +static inline int lock_may_write(struct inode *inode, loff_t start,
> +				 unsigned long len)
> +{
> +	return 1;
> +}
> +
>  #endif /* !CONFIG_FILE_LOCKING */
>  
>  
> 
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-19 17:05                 ` Randy Dunlap
@ 2009-01-19 17:27                   ` Steven Whitehouse
  -1 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-19 17:27 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Mon, 2009-01-19 at 09:05 -0800, Randy Dunlap wrote:
> Steven Whitehouse wrote:
> > Hi,
> > 
> > On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
> >> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> >>
> >>>>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> >>>>>>
> >>>>> Take a look in fs.h:
> >>>>>
> >>>>> #define generic_setlease(a, b, c) ({ -EINVAL; })
> >>>>>
> >>>>> If that wasn't a stupid macro, your code would have compiled and ran
> >>>>> just as intended.
> >>>>>
> >>>> There doesn't seem to be an easy answer though. If I #define it to NULL,
> >>>> that upsets other parts of the code that rely on that macro, and if I
> >>>> turn it into a inline function which returns -EINVAL, then presumably I
> >>>> can't take its address for my file_operations.
> >>> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> >>> I've seen a few cases of that).
> >>>
> >> yup.  It measn that we'll get a separate private copy of the
> >> generic_setlease() code in each compilation unit which takes its
> >> address, but I don't think that would kill us.
> >>
> >> The prevention is of course to put the stub function in a core kernel
> >> .c file and export it to modules.
> >>
> > Having looked into this in a bit more detail now, it seems that this
> > particular function (generic_setlease) is one of a number appearing in
> > fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
> > is not set.
> > 
> > So rather than just do the one function, it seemed to make sense to me
> > to make them all the same. So this uses inline functions as originally
> > proposed. If you'd prefer that we don't inline them and instead have a
> > fs/no-locks.c or something like that with stub functions in it, then I"m
> > happy to revise the patch accordingly.
> 
> Acked-by/Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
> 
Ok, Thanks. I'll send a proper patch to a suitable tree. Presumably the
VFS tree would be best for this?

> > This patch passes my compile tests, modulo a small change that I need to
> > make in GFS2 to suppress a warning (not attached). That seems to be
> > related to yet another set of macros which appear only with
> > CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
> > functions as well....
> 
> You mean these?  Probably should update them as well.
> 
> #else /* !CONFIG_FILE_LOCKING */
> #define locks_mandatory_locked(a) ({ 0; })
> #define locks_mandatory_area(a, b, c, d, e) ({ 0; })
> #define __mandatory_lock(a) ({ 0; })
> #define mandatory_lock(a) ({ 0; })
> #define locks_verify_locked(a) ({ 0; })
> #define locks_verify_truncate(a, b, c) ({ 0; })
> #define break_lease(a, b) ({ 0; })
> #endif /* CONFIG_FILE_LOCKING */
> 
> 
Yes, I'll do a patch for those as well then,

Steve.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-19 17:27                   ` Steven Whitehouse
  0 siblings, 0 replies; 23+ messages in thread
From: Steven Whitehouse @ 2009-01-19 17:27 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Andrew Morton, linux-kernel, cluster-devel

Hi,

On Mon, 2009-01-19 at 09:05 -0800, Randy Dunlap wrote:
> Steven Whitehouse wrote:
> > Hi,
> > 
> > On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
> >> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> >>
> >>>>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
> >>>>>>
> >>>>> Take a look in fs.h:
> >>>>>
> >>>>> #define generic_setlease(a, b, c) ({ -EINVAL; })
> >>>>>
> >>>>> If that wasn't a stupid macro, your code would have compiled and ran
> >>>>> just as intended.
> >>>>>
> >>>> There doesn't seem to be an easy answer though. If I #define it to NULL,
> >>>> that upsets other parts of the code that rely on that macro, and if I
> >>>> turn it into a inline function which returns -EINVAL, then presumably I
> >>>> can't take its address for my file_operations.
> >>> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
> >>> I've seen a few cases of that).
> >>>
> >> yup.  It measn that we'll get a separate private copy of the
> >> generic_setlease() code in each compilation unit which takes its
> >> address, but I don't think that would kill us.
> >>
> >> The prevention is of course to put the stub function in a core kernel
> >> .c file and export it to modules.
> >>
> > Having looked into this in a bit more detail now, it seems that this
> > particular function (generic_setlease) is one of a number appearing in
> > fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
> > is not set.
> > 
> > So rather than just do the one function, it seemed to make sense to me
> > to make them all the same. So this uses inline functions as originally
> > proposed. If you'd prefer that we don't inline them and instead have a
> > fs/no-locks.c or something like that with stub functions in it, then I"m
> > happy to revise the patch accordingly.
> 
> Acked-by/Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
> 
Ok, Thanks. I'll send a proper patch to a suitable tree. Presumably the
VFS tree would be best for this?

> > This patch passes my compile tests, modulo a small change that I need to
> > make in GFS2 to suppress a warning (not attached). That seems to be
> > related to yet another set of macros which appear only with
> > CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
> > functions as well....
> 
> You mean these?  Probably should update them as well.
> 
> #else /* !CONFIG_FILE_LOCKING */
> #define locks_mandatory_locked(a) ({ 0; })
> #define locks_mandatory_area(a, b, c, d, e) ({ 0; })
> #define __mandatory_lock(a) ({ 0; })
> #define mandatory_lock(a) ({ 0; })
> #define locks_verify_locked(a) ({ 0; })
> #define locks_verify_truncate(a, b, c) ({ 0; })
> #define break_lease(a, b) ({ 0; })
> #endif /* CONFIG_FILE_LOCKING */
> 
> 
Yes, I'll do a patch for those as well then,

Steve.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
  2009-01-19 17:27                   ` Steven Whitehouse
@ 2009-01-19 17:55                     ` Randy Dunlap
  -1 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-19 17:55 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Steven Whitehouse wrote:
> Hi,
> 
> On Mon, 2009-01-19 at 09:05 -0800, Randy Dunlap wrote:
>> Steven Whitehouse wrote:
>>> Hi,
>>>
>>> On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
>>>> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>>>
>>>>>>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
>>>>>>>>
>>>>>>> Take a look in fs.h:
>>>>>>>
>>>>>>> #define generic_setlease(a, b, c) ({ -EINVAL; })
>>>>>>>
>>>>>>> If that wasn't a stupid macro, your code would have compiled and ran
>>>>>>> just as intended.
>>>>>>>
>>>>>> There doesn't seem to be an easy answer though. If I #define it to NULL,
>>>>>> that upsets other parts of the code that rely on that macro, and if I
>>>>>> turn it into a inline function which returns -EINVAL, then presumably I
>>>>>> can't take its address for my file_operations.
>>>>> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
>>>>> I've seen a few cases of that).
>>>>>
>>>> yup.  It measn that we'll get a separate private copy of the
>>>> generic_setlease() code in each compilation unit which takes its
>>>> address, but I don't think that would kill us.
>>>>
>>>> The prevention is of course to put the stub function in a core kernel
>>>> .c file and export it to modules.
>>>>
>>> Having looked into this in a bit more detail now, it seems that this
>>> particular function (generic_setlease) is one of a number appearing in
>>> fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
>>> is not set.
>>>
>>> So rather than just do the one function, it seemed to make sense to me
>>> to make them all the same. So this uses inline functions as originally
>>> proposed. If you'd prefer that we don't inline them and instead have a
>>> fs/no-locks.c or something like that with stub functions in it, then I"m
>>> happy to revise the patch accordingly.
>> Acked-by/Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
>>
> Ok, Thanks. I'll send a proper patch to a suitable tree. Presumably the
> VFS tree would be best for this?

That sounds correct, but no guarantees.

>>> This patch passes my compile tests, modulo a small change that I need to
>>> make in GFS2 to suppress a warning (not attached). That seems to be
>>> related to yet another set of macros which appear only with
>>> CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
>>> functions as well....
>> You mean these?  Probably should update them as well.
>>
>> #else /* !CONFIG_FILE_LOCKING */
>> #define locks_mandatory_locked(a) ({ 0; })
>> #define locks_mandatory_area(a, b, c, d, e) ({ 0; })
>> #define __mandatory_lock(a) ({ 0; })
>> #define mandatory_lock(a) ({ 0; })
>> #define locks_verify_locked(a) ({ 0; })
>> #define locks_verify_truncate(a, b, c) ({ 0; })
>> #define break_lease(a, b) ({ 0; })
>> #endif /* CONFIG_FILE_LOCKING */
>>
>>
> Yes, I'll do a patch for those as well then,

Thanks.

-- 
~Randy



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: mmotm 2009-01-14-20-31 uploaded (gfs2)
@ 2009-01-19 17:55                     ` Randy Dunlap
  0 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-01-19 17:55 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: Andrew Morton, linux-kernel, cluster-devel

Steven Whitehouse wrote:
> Hi,
> 
> On Mon, 2009-01-19 at 09:05 -0800, Randy Dunlap wrote:
>> Steven Whitehouse wrote:
>>> Hi,
>>>
>>> On Fri, 2009-01-16 at 09:35 -0800, Andrew Morton wrote:
>>>> On Fri, 16 Jan 2009 09:06:23 -0800 Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>>>
>>>>>>>> which is not ideal, but I don't see any easy way to avoid the #ifdef,
>>>>>>>>
>>>>>>> Take a look in fs.h:
>>>>>>>
>>>>>>> #define generic_setlease(a, b, c) ({ -EINVAL; })
>>>>>>>
>>>>>>> If that wasn't a stupid macro, your code would have compiled and ran
>>>>>>> just as intended.
>>>>>>>
>>>>>> There doesn't seem to be an easy answer though. If I #define it to NULL,
>>>>>> that upsets other parts of the code that rely on that macro, and if I
>>>>>> turn it into a inline function which returns -EINVAL, then presumably I
>>>>>> can't take its address for my file_operations.
>>>>> No, gcc will allow &inline_func and out-of-line it if it is needed (AFAIK;
>>>>> I've seen a few cases of that).
>>>>>
>>>> yup.  It measn that we'll get a separate private copy of the
>>>> generic_setlease() code in each compilation unit which takes its
>>>> address, but I don't think that would kill us.
>>>>
>>>> The prevention is of course to put the stub function in a core kernel
>>>> .c file and export it to modules.
>>>>
>>> Having looked into this in a bit more detail now, it seems that this
>>> particular function (generic_setlease) is one of a number appearing in
>>> fs.h which are replaced by macros in the case that CONFIG_FILE_LOCKING
>>> is not set.
>>>
>>> So rather than just do the one function, it seemed to make sense to me
>>> to make them all the same. So this uses inline functions as originally
>>> proposed. If you'd prefer that we don't inline them and instead have a
>>> fs/no-locks.c or something like that with stub functions in it, then I"m
>>> happy to revise the patch accordingly.
>> Acked-by/Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
>>
> Ok, Thanks. I'll send a proper patch to a suitable tree. Presumably the
> VFS tree would be best for this?

That sounds correct, but no guarantees.

>>> This patch passes my compile tests, modulo a small change that I need to
>>> make in GFS2 to suppress a warning (not attached). That seems to be
>>> related to yet another set of macros which appear only with
>>> CONFIG_FILE_LOCKING not set. Maybe I should update those to be inline
>>> functions as well....
>> You mean these?  Probably should update them as well.
>>
>> #else /* !CONFIG_FILE_LOCKING */
>> #define locks_mandatory_locked(a) ({ 0; })
>> #define locks_mandatory_area(a, b, c, d, e) ({ 0; })
>> #define __mandatory_lock(a) ({ 0; })
>> #define mandatory_lock(a) ({ 0; })
>> #define locks_verify_locked(a) ({ 0; })
>> #define locks_verify_truncate(a, b, c) ({ 0; })
>> #define break_lease(a, b) ({ 0; })
>> #endif /* CONFIG_FILE_LOCKING */
>>
>>
> Yes, I'll do a patch for those as well then,

Thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-01-19 17:56 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15  4:32 mmotm 2009-01-14-20-31 uploaded akpm
2009-01-15 19:13 ` [Cluster-devel] Re: mmotm 2009-01-14-20-31 uploaded (gfs2) Randy Dunlap
2009-01-15 19:13   ` Randy Dunlap
2009-01-16 10:20   ` [Cluster-devel] " Steven Whitehouse
2009-01-16 10:20     ` Steven Whitehouse
2009-01-16 16:43     ` [Cluster-devel] " Andrew Morton
2009-01-16 16:43       ` Andrew Morton
2009-01-16 17:02       ` [Cluster-devel] " Steven Whitehouse
2009-01-16 17:02         ` Steven Whitehouse
2009-01-16 17:06         ` [Cluster-devel] " Randy Dunlap
2009-01-16 17:06           ` Randy Dunlap
2009-01-16 17:35           ` [Cluster-devel] " Andrew Morton
2009-01-16 17:35             ` Andrew Morton
2009-01-16 17:37             ` [Cluster-devel] " Steven Whitehouse
2009-01-16 17:37               ` Steven Whitehouse
2009-01-19 15:16             ` [Cluster-devel] " Steven Whitehouse
2009-01-19 15:16               ` Steven Whitehouse
2009-01-19 17:05               ` [Cluster-devel] " Randy Dunlap
2009-01-19 17:05                 ` Randy Dunlap
2009-01-19 17:27                 ` [Cluster-devel] " Steven Whitehouse
2009-01-19 17:27                   ` Steven Whitehouse
2009-01-19 17:55                   ` [Cluster-devel] " Randy Dunlap
2009-01-19 17:55                     ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.